ambiera logo

Ambiera Forum

Discussions, Help and Support.

folder icon Ambiera Forum > CopperLicht
forum topic indicator How to set collision for a cube.
person icon
matej
Registered User
Quote
2010-08-23 19:39:10

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.

person icon
erik
Guest
Quote
2010-08-23 19:48:33

Depends on the type of collision you want to have.
See the tutorial here:
http://www.ambiera.com/copperlic...

person icon
matej
Registered User
Quote
2010-08-24 00:41:26

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?

person icon
niko
Moderator
Quote
2010-08-24 16:47:52

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.

person icon
Gobo
Guest
Quote
2010-09-11 14:30:39

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.

person icon
niko
Moderator
Quote
2010-09-11 16:45:16

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.


Create reply:










 

  

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


icon_holyicon_cryicon_devilicon_lookicon_grinicon_kissicon_monkeyicon_hmpf
icon_sadicon_happyicon_smileicon_uhicon_blink   






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