Scene Composer Collsion

after adding various nodes with idependent object to the scene in scene composer. Then i add it in tho code by assetManager and add collsions(setKinematics(true)), after rotating for example a door, the collisions stay in the old place. Is there any way to fix that?

when setting kinematic mode you move the spatials and the physics collision shapes move along with it.

yes in this case it dosent. Could it be that i export the whole scene as one. And then add collisions to it in code ?

Ok I`ll try to show what is the problem here:

-this is my model structure in the scene composer:

http://imgur.com/B7s02

-this is my code for loading asset, and collisions

httphttp://i.imgur.com/rly1m.jpg://i.imgur.com/q5lmt.jpg

-and on the end the screen how it looks like in the “game”. When i rotate the door the “collisions” stays in former place

http://i.imgur.com/Y5Pjv.png

Yeah it does because you created the shape for the whole scene, you cannot move just parts of a compound collisin shape.

so using this way of composing scene, is there a possiblity to add separate “moving” collisions to my door meshes?

Make a separate rigidbody. You can also add the collision shapes in the editor.

@normen said:
Make a separate rigidbody. You can also add the collision shapes in the editor.

where exactly can i add collisions in the editor, becouse i cant find it ?

Right-click a node and select “Control->Static RigidBody” for static meshes and in the Scene Composer you can use the “create collision shape” button with the dynamic checkbox checked for dynamic shapes.

2 Likes

what now? In the game the`re still no collsions

http://img685.imageshack.us/img685/5346/beztytuuphv.png

physicsSpace.addAll(loadedModel)… and RTFM

@normen said:
physicsSpace.addAll(loadedModel)... and RTFM

sorry but i dont understand what you meant by that.

http://hub.jmonkeyengine.org/javadoc/com/jme3/bullet/PhysicsSpace.html#addAll(com.jme3.scene.Spatial)

ok so i add the control static rigid body as you can see on the picture above. Then i load the whole scene as sceneModel and use the method like this space.addAll(sceneModel); where space is a new instance of physicsspace class. And still no collsisions :frowning:

What should collide? Only ohysics objects will collide or raytests will give results? You expect the world to explode or the camera to stop before a wall or what? Read the tutorials if thats the case.