function CreateHingeConstraint( actorA, frameA, useReferenceFrameA )

Simulates a hinge joint, which allows two actors (or an actor and the world) to rotate around a single axis while restricting movement along the other axes. This is similar to the way a door swings on its hinges or how an elbow joint functions in the human body.

actorA = CreateCubeActor(100) 'Creates a cube actor
frameA = DimMatrix(44) 'A transform matrix must be a 4x4 matrix
SetIdentityMatrix(frameA, 4) 'Sets frameB to a 4x4 identity matrix
SetMatrixTranslation(frameA, 010) 'Sets the attach point of the constraint to the top of the cube
hinge = CreateHingeConstraint(actorA, frameA, true) 

Note: It is recommended to use CreateSlideConstraintEx() in most cases


Related: CreateHingeConstraintEx SetIdentityMatrix SetMatrixTranslation SetMatrixRotation