Hi all,
I experiment with collision fo a while now. With blener I made a (Space-)station, now I want to add collision to it. It should colide with a Spaceship (also made with blender). The problem is, that the station(s) are not full colidable. The collidable area is only a part at the center.
The second problem is, that the ship is no Cube or something like that. How can I make them collide?
The Physic of the class Station (for every single station):
[java] CollisionShape sceneShape = CollisionShapeFactory.createMeshShape(this.station);
control = new RigidBodyControl(sceneShape, 0);
control.setKinematic(true);
this.station.addControl(control);[/java]
The Physic of the class Ship (otherwise it will not collide at all):
[java]CapsuleCollisionShape capsuleShape = new CapsuleCollisionShape(1.5f, 6f, 1);
control = new RigidBodyControl(capsuleShape, 3f);
this.ship.addControl(control);[/java]
the other version
The Physic of the class Ship (otherwise it will not collide at all):
[java] control = new RigidBodyControl(3f);
this.ship.addControl(control);[/java]
the second version cause very big lags and freezes.
I’m shure I’m doing someting wrong…
Is there a way to do this without Physic (if it’s faster)?
so I made a video now. I hope now you’re able to give me an answer
http://www.youtube.com/watch?v=hb1_ywtKOTQ
anyone here?
Enable the physics debug view: PhysicsSpace.enableDebug(assetManager); Then you’ll probably have more information to debug your software.
1 Like
Thank you very much. The problem was, I scaled the station after creating the CollisionShape.
Is there a way to use CollisionShapeFactory.createMeshShape(this.ship); also for the ship or must I use a kind of BoxCollisionShape?
Use a hull shape (created for a whole hierarchy of spatials when using createDynamicMeshShape).
1 Like
thanks much