Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperLicht
BoundingBox Collisions

boxbee
Registered User
Quote
2013-01-16 22:43:52

I have been working on collisions for a week now, with little success. I have a bunch of cube scene nodes that I am trying to use as the ground of my game. I am trying to check collision with all of the cubes on engine.animate. I want to see if the player is on top of the cubes and if not he falls.

What is the best way to check for collisions? Can you get a handle to all Scene Nodes in a scene? When creating the ground is it not smart to use cubes as the ground, because I will need to create a lot of these?

Any help or advice would be appreciated. Thanks.


niko
Moderator
Quote
2013-01-30 09:28:05

The best would be to use a CollisionResponseAnimator: http://www.ambiera.com/copperlic...
Put all your cubes into a MetaTriangleSelector and use this as world triangle selector for that animator. Then everything works automatically. See the collision tutorials for this: http://www.ambiera.com/copperlic...

Alternatively, for manually checking: Get the transformed bounding box of your cubes (SceneNode.getTransformedBoundingBox()) and the returned object has a few methods like intersectsWithBox() and intersectsWithLine() and isPointInside(): http://www.ambiera.com/copperlic...


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Internatio?al" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact