Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
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. |
||||
|
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... |
|