phcon_add ( var constraintType, ENTITY* entity1, ENTITY* entity2 );
Establishes a new constraint on entity1 and entity2. The type of constraint is specified by constraintType. When successful, a constraint_id is returned which has to be used in subsequent phcon_ calls.
entity2 can be set to 0 for most constraints (excluding PH_WHEEL, which requires 2 entities)- in this case entity1 is constrained to the world instead.
Some constraints automatically set up default values, PH_HINGE and PH_BALL set the anchor point to lie in the middle between the entities' origins.
||one of the supported constraint constants PH_HINGE, PH_WHEEL, PH_BALL, PH_SLIDER
||first entity of constraint
||second entity of constraint or NULL when not required
constraint_id - unique identifier of this constraint. Store this ID for removing constraint or altering its properties.
var axis= 1,0,0; // pendulum is allowed to rotate only along the x-axis
vec_set( anchor, blade_entity.x );
anchor.z = ceiling_height; // anchor point is now above blade at the specified height
// this sets up a hinged pendulum, suspended from the ceiling
hingeID= phcon_add( PH_HINGE, blade_entity,NULL);
constraints, phcon_remove, phcon_setparams1, phcon_setparams2