Files
RCBASIC4/doc/doc_files/createhingeconstraint.html
2024-10-24 23:25:02 -04:00

101 lines
3.1 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<style>
table, th, td { border: 1px solid black; } th, td { padding: 10px; }
body { background-color: #064066; color: #FFFFFF; }
a { color: #40bfb8; }
a::before {
content: "---";
font-family: monospace, monospace;
display: inline-block;
margin-right: 6px;
color: #064066;
}
.rc_number { color: #0b9898; }
.rc_string { color: #dd4040; }
.rc_keyword { color: #6084a8; font-weight: bold; }
.rc_comment { color: #6e716e; }
#rc_code { font-family: Consolas,"courier new"; background-color: #2d3335; padding: 2px; font-size: 105%; }
ul, #myUL {
list-style-type: none;
}
#myUL {
margin: 0;
padding: 0;
}
.box {
cursor: pointer;
-webkit-user-select: none; /* Safari 3.1+ */
-moz-user-select: none; /* Firefox 2+ */
-ms-user-select: none; /* IE 10+ */
user-select: none;
}
.box::before {
content: "[+]";
font-family: monospace, monospace;
font-weight: bold;
color: #40bfb8;
display: inline-block;
margin-right: 6px;
}
.box {
font-weight: bold;
color: #40bfb8;
text-decoration: underline;
}
.check-box::before {
content: "[-]";
font-family: monospace, monospace;
font-weight: bold;
//color: dodgerblue;
color: #40bfb8;
}
.nested {
display: none;
}
.active {
display: block;
}
</style>
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
<title>createHingeConstraint [RCBasic Doc] </title>
</head>
<body>
<p><h1>function createHingeConstraint( actorA, frameA, useReferenceFrameA ) </h1></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&nbsp;=&nbsp;CreateCubeActor<b>(</b><span class="rc_number">100</span><b>)</b>&nbsp;<span class="rc_comment">'Creates a cube actor </span><br>
frameA&nbsp;=&nbsp;DimMatrix<b>(</b><span class="rc_number">4</span>,&nbsp;<span class="rc_number">4</span><b>)</b>&nbsp;<span class="rc_comment">'A transform matrix must be a 4x4 matrix </span><br>
SetIdentityMatrix<b>(</b>frameA,&nbsp;<span class="rc_number">4</span><b>)</b>&nbsp;<span class="rc_comment">'Sets frameB to a 4x4 identity matrix </span><br>
SetMatrixTranslation<b>(</b>frameA,&nbsp;<span class="rc_number">0</span>,&nbsp;<span class="rc_number">1</span>,&nbsp;<span class="rc_number">0</span><b>)</b>&nbsp;<span class="rc_comment">'Sets the attach point of the constraint to the top of the cube </span><br>
hinge&nbsp;=&nbsp;CreateHingeConstraint<b>(</b>actorA,&nbsp;frameA,&nbsp;<span class="rc_keyword">true</span><b>)</b>&nbsp;<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>