DanielChappuis / reactphysics3d

Open source C++ physics engine library in 3D
http://www.reactphysics3d.com
zlib License
1.51k stars 218 forks source link

Child somewhat-static collision shape #379

Open ghost opened 6 months ago

ghost commented 6 months ago

Hi,

I have a humanoid entity in my application and I am modelling the collision for it using an RP3D sphere, and I am happy with how it feels to move around.

However, the humanoid has a shape of around 1m x 1m x 2m - ie it is twice as tall as it is wide. I am modelling it as a 1m x 1m x 1m sphere at ground level, and again I am happy with how this feels, but the issue is that there is no collision on the top half to stop the entity's head going through low ceilings.

So what I really want is a collision object which looks a bit like: | - a stick o - the sphere

Where:

The sphere is modelled as normal (because this works well physically for my feeling of movement) The stick collides against other things, stopping the whole object in its tracks BUT The stick has no mass and is always in the same global position compared to the sphere, and does not impact the sphere's physics.

I'm sorry, this is quite difficult to explain. Do I make any sense?

DanielChappuis commented 3 months ago

Hello. Sorry for my late answer.

Could you use a CapsuleShape or a SphereShape and a thin CapsuleShape (for the stick)?

I don't really understand what you mean when you say:

The sphere is modelled as normal

Also what exactly do you mean by:

The stick has no mass and is always in the same global position compared to the sphere