jit.phys.body question

Oct 26, 2011 at 4:39pm

jit.phys.body question

Very basic question about jit.phys.body.

The docs say that it “represents a rigid body and collision shape in a physics simulation”.

But as far as I can tell, there’s no way to add a collision shape only – am I missing something? Tried to find an attribute that would allow the rigid body to be toggled off – the most likely candidates seem to be enable_sim and kinematic – but both of these seem to take the object out of the physics sim altogether.

So: is there any way to add a collider to an object *without* adding a rigidbody to that same object – such that the object is not affected by gravity etc but that other rigidbody objects bounce off it?

Simple example: a terrain or a tabletop which stays where it is while other rigidbody objects collide with it.

#59566
Oct 28, 2011 at 3:52am

hi perry. this is very easy to achieve. simply set the @mass attribute to 0.
this causes the body to be “static”, where dynamic forces have no effect, but collisions still occur.

alternatively, if you are changing the body’s postion or rotation, you will want to set @kinematic 1.

hope that explains it.

#214364
Oct 29, 2011 at 7:55pm

Another question, it looks like its posible create a body from a jit.gl.model; but for me is always static, like “out” of the world, any ideas? someone tryed it?

#214365
Oct 29, 2011 at 9:40pm

this requires jit.gl.model @matrixout to work. unfortunately a bug slipped into the release version that broke this functionality. it will be fixed for the next update.
the help file to jit.phys.body shows how to do this, when @matrixoutput i working again.

thanks for your patience.

#214366
Nov 11, 2011 at 12:00pm

It works perfect now with the update¡ Thank you¡

#214367

You must be logged in to reply to this topic.