phcon_setmotor (var constraint_ID, VECTOR* vecParam1, VECTOR* vecParam2, VECTOR* vecParam3 );

This turns a static joint into a motorized one. For a slider this means that the entities will be pushed apart along the sliders axis with a certain velocity. For hinges and wheels the motor tries to rotate the entities with a given angular velocity. In order to reach the velocity specified by the user a certain amount of force or torque is required. Therefore the maximum amount of force/torque available also needs to be specified. If this value is very low objects might not start moving at all. If it is high the desired velocity will be attained almost instanteously. vecParam1[0] is the desired velocity, vecParam1[1] is the maximum amount of force or torque that may be used for hinges/sliders. For a wheel vecParam1[0] and vecParam1[1] are used for the first axis while vecParam2[0] and vecParam2[1] define the second axis' behavior.


constraint_id unique identifier of the constraint to be configured
vecParam1 vector with configuration information
vecParam2 vector with configuration information
vecParam3 not used yet - set to nullvector


1 if successful, 0 otherwise.




phcon_semotor(constraint1, vector(10,50,0), nullvector, nullvector);

See also:

phcon_setparams ► latest version online