Rotating Box collision problem

I have a problem with collision and when the player in my FPS walks into a wall.  Since the collision box rotates with the player, when the player simply turns this can cause a collision (since the corner of the box moves into the wall) which I don't want. 



Is the solution to not rotate the player's collision box, and if so, how do I do this if the collision box is attached to the same node as the player?



Thanks in advance.

maybe you can use a sphere / capsule or cylinder as boundingvolume.

That way it wont change its size when the player turns.

Is it possible to use a cylinder as the bounding volume?  I can only see BoundingBox, Sphere and Capsule in the com.jme.bounding package. 

not boudning volume, but physics bounding volume, or wathever it's called, you have to create for your dynamic physics node (the player node) a capsule using the method mahphysicsnode.createCapsule() for instance, even tough i like the cylinder most ;D



well, something like it, gl

cylinder is a spacial case, like Guedez said, you'd have to create scale and roatate it yourself.

But if you use a jme BoundingCapsule, jmephysics will also create a PhysicsCapsule when you call generatePhysicsGeometry().

Thanks for the help, but I'm having trouble finding the words PhysicsCapsule or generatePhysicsGeometry anywhere in the JME source code.  Can you give me a few pointers where to look?


It is part of jmePhysics:



Have a look here:



http://wiki.jmephysics.irrisor.net/tiki-index.php



or here:



=physics#retrieving_jme_physics_2_and_correcting_build_path_problems]http://www.jmonkeyengine.com/wiki/doku.php?id=setting_up_eclipse_to_build_jme_2&s[]=physics#retrieving_jme_physics_2_and_correcting_build_path_problems

Thanks for the pointers.  However, it sounds like a lot of overkill just to get around a "simple" problem.  I might just use a non-rotating BoundingBox()!



Thanks all for your help.

I think you mean a fixed size bounding box.



The default BoundingBox is axis aligned and is not rotating (just changeing its size), a OrientedBoundingBox rotates with the object (and keeps its size).



Did using a BoundingSphere not help in your case?

The only problem with a bounding sphere is that the player's avatar isn't rally that spherical :wink:



Unfortunately, those other two options don't work either, since I don't want it to change size, nor do I want it to rotate (since this would cause a collision even if the avatar remained stationary, if they were stood near a wall).



What I'm going to do is have a box on a separate node to the player, that is mapped to the player's node's localtranslation, but doesn't rotate with the player.  I'll check for collisions against that.

hmm good idea :slight_smile: