pXent_setskinwidth (ENTITY*
entity , var width);
Sets the skin penetration width for an entity
(Actor) . It is like decreasing the collision volume. The
simulation deals with inaccuracy when stacking objects by letting
them slightly inter penetrate each other. The amount of permitted
penetration can be regulated with this function.
Parameters:
|
entity |
Registered Entity pointer (Actor) |
|
width |
Penetration width (default: 0.025) |
Returns:
1
if successful, 0
otherwise.
Remarks:
- Skin
width specifies how much objects can inter penetrate, as opposed to
how much they are separated.
- The amount of inter
penetration that is best permitted depends on many things such as
the size of the objects involved but also on the stability of the
simulation, which is usually governed by the gravity setting as well
as the time step size. Lower gravity and smaller time steps
typically result in more stable simulations.
Speed:
Fast
Example:
ENTITY* myCrate;
// ...
// on startup
myCrate = ent_create( "crate.mdl", nullvector, any_function );
pXent_settype( myCrate, PH_RIGID, PH_BOX );
pXent_setskinwidth(myCrate, 0.5);
See also:
pX_setgravity, pX_setunit