33 lines
1.9 KiB
HTML
33 lines
1.9 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<link rel="stylesheet" href="style.css">
|
|
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
|
|
<title>CreateHingeConstraint [RCBasic Doc] </title>
|
|
</head>
|
|
|
|
<body>
|
|
<p><h2>function CreateHingeConstraint( actorA, frameA, useReferenceFrameA ) </h2></p>
|
|
<p>
|
|
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.
|
|
</p>
|
|
<p id="rc_code"><code>
|
|
actorA = CreateCubeActor<b>(</b><span class="rc_number">100</span><b>)</b> <span class="rc_comment">'Creates a cube actor </span><br>
|
|
frameA = DimMatrix<b>(</b><span class="rc_number">4</span>, <span class="rc_number">4</span><b>)</b> <span class="rc_comment">'A transform matrix must be a 4x4 matrix </span><br>
|
|
SetIdentityMatrix<b>(</b>frameA, <span class="rc_number">4</span><b>)</b> <span class="rc_comment">'Sets frameB to a 4x4 identity matrix </span><br>
|
|
SetMatrixTranslation<b>(</b>frameA, <span class="rc_number">0</span>, <span class="rc_number">1</span>, <span class="rc_number">0</span><b>)</b> <span class="rc_comment">'Sets the attach point of the constraint to the top of the cube </span><br>
|
|
hinge = CreateHingeConstraint<b>(</b>actorA, frameA, <span class="rc_keyword">true</span><b>)</b> <br>
|
|
</code></p>
|
|
<p>
|
|
Note: It is recommended to use CreateSlideConstraintEx() in most cases
|
|
</p>
|
|
<br><p>Related:
|
|
<a href="createhingeconstraintex.html">CreateHingeConstraintEx</a>
|
|
<a href="setidentitymatrix.html">SetIdentityMatrix</a>
|
|
<a href="setmatrixtranslation.html">SetMatrixTranslation</a>
|
|
<a href="setmatrixrotation.html">SetMatrixRotation</a>
|
|
</p>
|
|
<p>
|
|
|
|
</body>
|
|
</html> |