Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
I am programaticaly creating cubes. The cubes are created and displayed but collision does not work. What do I have to do to enable collision on these cubes? Thank you. |
||||
|
Depends on the type of collision you want to have. See the tutorial here: http://www.ambiera.com/copperlic... |
||||
|
The collision works for the objects created in coppercube but not for cubes created with javascript. Do I have to set a special Selector for CubeSceneNode if yes how? |
||||
|
Something like a bounding box triangle selector is missing, I'm sorry. But the CubeSceneNode is derived from the MeshSceneNode, so you can safely use a MeshTriangleSelector to do the collision. |
||||
|
Something like a bounding box triangle selector is missing, I'm sorry. But the CubeSceneNode is derived from the MeshSceneNode, so you can safely use a MeshTriangleSelector to do the collision. I could not get the MeshTriangleSelector to be used for collision detection with an AnimatorCameraFPS in my scene of CubeSceneNodes. var box = new CubeSceneNode(); box.Selector = new MeshTriangleSelector(box.getMesh(), box); scene.getRootSceneNode().addChild(box); Will let the camera pass through the cube, the cam stays in freeflight. Setting the selector after adding the node to the scene does not help. Maybe the sixth tutorial could be changed to make the fired projectile box block the camera movement to clear things up. On a related note: what does the JumpSpeed value affect? I did not find a jump key yet, so I guess it is used in the climbing of stairs code maybe. |
||||
|
You need to let the camera know that you want this to the world collision geometry as well: Create a AnimatorCollisionResponse for the camera (if you haven't already) and call setWorld() of it with the MeshTriangleSelector of your box. Then it will collide with the box. The JuomSpeed value is reserved for future use, not yet used yes. |
|