ENTITY* entity, var mass, var hulltype );
Sets the entity's physical mass. A definition of mass is "resistance to change
Thus by increasing an object's
mass you will have to use a stronger force (or torque) to make them move,
or to stop them from moving.
||Entity to be affected
||Mass of the object
in kilograms, or 0 for a fixed object
||Shape of this object defining its rotational behavior: PH_SPHERE,
PH_CYLINDER, or PH_POLY.
1 if successful, 0 otherwise.
To be consistent with standards you should use kilograms as the unit
of mass. The conversion factor from pounds (on Earth) to kilograms
is 1 lb. = 0.45 kg. The smallest mass you can specify is 0.001. When
mass to 0, you will have a fixed object. This means that
the object won’t move under any circumstances, making it an ideal
choice for “anchors” to
connect other objects to.
An object's hull type determines its resistance
to torque and thus the way it rotates. You can use one of the predefined
constants to use an approximation of the object's shape or use PH_POLY to
deduce the actual shape.
- The hull type specified with phent_setmass does not affect
the collision detection. Use phent_settype to
change the collision hull. phent_setmass only affects how
the object rotates along different axes when a torque is applied.
A sphere will resist rotation along all axes
in the same way, whereas a cylinder has a preferred axis. When specifying PH_POLY,
phent_setmass will calculate an accurate inertia tensor for
For stability reasons it is recommended to use PH_SPHERE whenever
Slow (first time object is set) / Medium
phent_setmass(my, 0, PH_SPHERE);