Skip to content

Commit

Permalink
Deploying to gh-pages from @ 3941691 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
jon-edward committed Jul 19, 2024
1 parent 9e91e9a commit 18d4aad
Show file tree
Hide file tree
Showing 4 changed files with 523 additions and 462 deletions.
147 changes: 93 additions & 54 deletions box2d.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,17 @@
overflow-x: auto;
max-width: 100%;
}

@media screen and (max-width: 860px) {
.nine.columns {
padding-left: 0;
}
}

dd > :not(a) {
display: block;
margin-top: 20px;
}
</style>

<!-- JS -->
Expand Down Expand Up @@ -2499,13 +2510,15 @@ <h1><a class="toc-backref" href="#7">Types</a></h1>
<p>Prototype callback for ray casts.</p>
<p>Called for each shape found in the query. You control how the ray cast proceeds by returning a float:</p>
<p>Return -1 to filter, 0 to terminate, fraction to clip the ray for closest hit, 1 to continue</p>
<p><tt class="docutils literal"><span class="pre">shapeId</span></tt> - the shape hit by the ray</p>
<p><tt class="docutils literal"><span class="pre">point</span></tt> - the point of initial intersection</p>
<p><tt class="docutils literal"><span class="pre">normal</span></tt> - the normal vector at the point of intersection</p>
<p><tt class="docutils literal"><span class="pre">fraction</span></tt> - the fraction along the ray at the point of intersection</p>
<p><tt class="docutils literal"><span class="pre">context</span></tt> - the user context</p>
<p>See <a class="reference internal nimdoc" title="proc b2World_CastRay(worldId: b2WorldId; origin: b2Vec2; translation: b2Vec2;
filter: b2QueryFilter; fcn: b2CastResultFcn; context: pointer): void" href="#b2World_CastRay,b2WorldId,b2Vec2,b2Vec2,b2QueryFilter,b2CastResultFcn,pointer">b2World_CastRay</a>.</p>
<p><strong>Params:</strong></p>
<ul class="simple"><li><tt class="docutils literal"><span class="pre">shapeId</span></tt> - the shape hit by the ray</li>
<li><tt class="docutils literal"><span class="pre">point</span></tt> - the point of initial intersection</li>
<li><tt class="docutils literal"><span class="pre">normal</span></tt> - the normal vector at the point of intersection</li>
<li><tt class="docutils literal"><span class="pre">fraction</span></tt> - the fraction along the ray at the point of intersection</li>
<li><tt class="docutils literal"><span class="pre">context</span></tt> - the user context</li>
</ul>


</dd>
Expand Down Expand Up @@ -3073,12 +3086,15 @@ <h1><a class="toc-backref" href="#7">Types</a></h1>
<dd>

<p>Prototype for a pre-solve callback.</p>
<p>This is called after a contact is updated. This allows you to inspect a contact before it goes to the solver. If you are careful, you can modify the contact manifold (e.g. modify the normal). .. note::</p>
<pre>- this function must be thread-safe
- this is only called if the shape has enabled presolve events
- this is called only for awake dynamic bodies
- this is not called for sensors
- the supplied manifold has impulse values from the previous step</pre>
<p>This is called after a contact is updated. This allows you to inspect a contact before it goes to the solver. If you are careful, you can modify the contact manifold (e.g. modify the normal).</p>
<div class="admonition admonition-info"><span class="admonition-info-text"><b>Note:</b></span>
<ul class="simple"><li>this function must be thread-safe</li>
<li>this is only called if the shape has enabled presolve events</li>
<li>this is called only for awake dynamic bodies</li>
<li>this is not called for sensors</li>
<li>the supplied manifold has impulse values from the previous step</li>
</ul>
</div>
<p>Return false if you want to disable the contact this step</p>
<div class="admonition admonition-warning"><span class="admonition-warning-text"><b>Warning:</b></span>
Do not attempt to modify the world inside this callback</div>
Expand Down Expand Up @@ -3784,11 +3800,13 @@ <h1><a class="toc-backref" href="#12">Procs</a></h1>

<p>Apply an angular impulse. The impulse is ignored if the body is not awake.</p>
<p>This optionally wakes the body.</p>
<p><tt class="docutils literal"><span class="pre">bodyId</span></tt> - The body id</p>
<p><tt class="docutils literal"><span class="pre">impulse</span></tt> - the angular impulse, typically in units of kg<em>m</em>m/s</p>
<p><tt class="docutils literal"><span class="pre">wake</span></tt> - also wake up the body</p>
<div class="admonition admonition-warning"><span class="admonition-warning-text"><b>Warning:</b></span>
This should be used for one-shot impulses. If you need a steady force, use a force instead, which will work better with the sub-stepping solver.</div>
<p><strong>Params:</strong></p>
<ul class="simple"><li><tt class="docutils literal"><span class="pre">bodyId</span></tt> - The body id</li>
<li><tt class="docutils literal"><span class="pre">impulse</span></tt> - the angular impulse, typically in units of kg<em>m</em>m/s</li>
<li><tt class="docutils literal"><span class="pre">wake</span></tt> - also wake up the body</li>
</ul>


</dd>
Expand All @@ -3804,10 +3822,12 @@ <h1><a class="toc-backref" href="#12">Procs</a></h1>

<p>Apply a force at a world point. If the force is not applied at the center of mass, it will generate a torque and affect the angular velocity. This optionally wakes up the body.</p>
<p>The force is ignored if the body is not awake.</p>
<p><tt class="docutils literal"><span class="pre">bodyId</span></tt> - The body id</p>
<p><tt class="docutils literal"><span class="pre">force</span></tt> - The world force vector, typically in newtons (N)</p>
<p><tt class="docutils literal"><span class="pre">point</span></tt> - The world position of the point of application</p>
<p><tt class="docutils literal"><span class="pre">wake</span></tt> - Option to wake up the body</p>
<p><strong>Params:</strong></p>
<ul class="simple"><li><tt class="docutils literal"><span class="pre">bodyId</span></tt> - The body id</li>
<li><tt class="docutils literal"><span class="pre">force</span></tt> - The world force vector, typically in newtons (N)</li>
<li><tt class="docutils literal"><span class="pre">point</span></tt> - The world position of the point of application</li>
<li><tt class="docutils literal"><span class="pre">wake</span></tt> - Option to wake up the body</li>
</ul>


</dd>
Expand All @@ -3823,9 +3843,11 @@ <h1><a class="toc-backref" href="#12">Procs</a></h1>

<p>Apply a force to the center of mass. This optionally wakes up the body.</p>
<p>The force is ignored if the body is not awake.</p>
<p><tt class="docutils literal"><span class="pre">bodyId</span></tt> - The body id</p>
<p><tt class="docutils literal"><span class="pre">force</span></tt> - the world force vector, usually in newtons (N).</p>
<p><tt class="docutils literal"><span class="pre">wake</span></tt> - also wake up the body</p>
<p><strong>Params:</strong></p>
<ul class="simple"><li><tt class="docutils literal"><span class="pre">bodyId</span></tt> - The body id</li>
<li><tt class="docutils literal"><span class="pre">force</span></tt> - the world force vector, usually in newtons (N).</li>
<li><tt class="docutils literal"><span class="pre">wake</span></tt> - also wake up the body</li>
</ul>


</dd>
Expand All @@ -3842,12 +3864,14 @@ <h1><a class="toc-backref" href="#12">Procs</a></h1>
<p>Apply an impulse at a point. This immediately modifies the velocity.</p>
<p>It also modifies the angular velocity if the point of application is not at the center of mass. This optionally wakes the body.</p>
<p>The impulse is ignored if the body is not awake.</p>
<p><tt class="docutils literal"><span class="pre">bodyId</span></tt> - The body id</p>
<p><tt class="docutils literal"><span class="pre">impulse</span></tt> - the world impulse vector, typically in N<em>s or kg</em>m/s.</p>
<p><tt class="docutils literal"><span class="pre">point</span></tt> - the world position of the point of application.</p>
<p><tt class="docutils literal"><span class="pre">wake</span></tt> - also wake up the body</p>
<div class="admonition admonition-warning"><span class="admonition-warning-text"><b>Warning:</b></span>
This should be used for one-shot impulses. If you need a steady force, use a force instead, which will work better with the sub-stepping solver.</div>
<p><strong>Params:</strong></p>
<ul class="simple"><li><tt class="docutils literal"><span class="pre">bodyId</span></tt> - The body id</li>
<li><tt class="docutils literal"><span class="pre">impulse</span></tt> - the world impulse vector, typically in N<em>s or kg</em>m/s.</li>
<li><tt class="docutils literal"><span class="pre">point</span></tt> - the world position of the point of application.</li>
<li><tt class="docutils literal"><span class="pre">wake</span></tt> - also wake up the body</li>
</ul>


</dd>
Expand All @@ -3864,11 +3888,13 @@ <h1><a class="toc-backref" href="#12">Procs</a></h1>

<p>Apply an impulse to the center of mass. This immediately modifies the velocity.</p>
<p>The impulse is ignored if the body is not awake. This optionally wakes the body.</p>
<p><tt class="docutils literal"><span class="pre">bodyId</span></tt> - The body id</p>
<p><tt class="docutils literal"><span class="pre">impulse</span></tt> - the world impulse vector, typically in N<em>s or kg</em>m/s.</p>
<p><tt class="docutils literal"><span class="pre">wake</span></tt> - also wake up the body</p>
<div class="admonition admonition-warning"><span class="admonition-warning-text"><b>Warning:</b></span>
This should be used for one-shot impulses. If you need a steady force, use a force instead, which will work better with the sub-stepping solver.</div>
<p><strong>Params:</strong></p>
<ul class="simple"><li><tt class="docutils literal"><span class="pre">bodyId</span></tt> - The body id</li>
<li><tt class="docutils literal"><span class="pre">impulse</span></tt> - the world impulse vector, typically in N<em>s or kg</em>m/s.</li>
<li><tt class="docutils literal"><span class="pre">wake</span></tt> - also wake up the body</li>
</ul>


</dd>
Expand Down Expand Up @@ -3899,9 +3925,11 @@ <h1><a class="toc-backref" href="#12">Procs</a></h1>

<p>Apply a torque. This affects the angular velocity without affecting the linear velocity.</p>
<p>This optionally wakes the body. The torque is ignored if the body is not awake.</p>
<p><tt class="docutils literal"><span class="pre">bodyId</span></tt> - The body id</p>
<p><tt class="docutils literal"><span class="pre">torque</span></tt> - about the z-axis (out of the screen), typically in N*m.</p>
<p><tt class="docutils literal"><span class="pre">wake</span></tt> - also wake up the body</p>
<p><strong>Params:</strong></p>
<ul class="simple"><li><tt class="docutils literal"><span class="pre">bodyId</span></tt> - The body id</li>
<li><tt class="docutils literal"><span class="pre">torque</span></tt> - about the z-axis (out of the screen), typically in N*m.</li>
<li><tt class="docutils literal"><span class="pre">wake</span></tt> - also wake up the body</li>
</ul>


</dd>
Expand Down Expand Up @@ -5579,8 +5607,10 @@ <h1><a class="toc-backref" href="#12">Procs</a></h1>
<dd>

<p>Set the rest length of a distance joint</p>
<p><tt class="docutils literal"><span class="pre">jointId</span></tt> - The id for a distance joint</p>
<p><tt class="docutils literal"><span class="pre">length</span></tt> - The new distance joint length</p>
<p><strong>Params:</strong></p>
<ul class="simple"><li><tt class="docutils literal"><span class="pre">jointId</span></tt> - The id for a distance joint</li>
<li><tt class="docutils literal"><span class="pre">length</span></tt> - The new distance joint length</li>
</ul>


</dd>
Expand Down Expand Up @@ -7230,7 +7260,9 @@ <h1><a class="toc-backref" href="#12">Procs</a></h1>
<dd>

<p>Override the default assert callback</p>
<p><tt class="docutils literal"><span class="pre">assertFcn</span></tt> - a non-null assert callback</p>
<p><strong>Params:</strong></p>
<ul class="simple"><li><tt class="docutils literal"><span class="pre">assertFcn</span></tt> - a non-null assert callback</li>
</ul>


</dd>
Expand Down Expand Up @@ -8294,14 +8326,16 @@ <h1><a class="toc-backref" href="#12">Procs</a></h1>
<p>Cast a ray into the world to collect shapes in the path of the ray.</p>
<p>Your callback function controls whether you get the closest point, any point, or n-points.</p>
<p>The ray-cast ignores shapes that contain the starting point.</p>
<p><tt class="docutils literal"><span class="pre">worldId</span></tt> - The world to cast the ray against</p>
<p><tt class="docutils literal"><span class="pre">origin</span></tt> - The start point of the ray</p>
<p><tt class="docutils literal"><span class="pre">translation</span></tt> - The translation of the ray from the start point to the end point</p>
<p><tt class="docutils literal"><span class="pre">filter</span></tt> - Contains bit flags to filter unwanted shapes from the results</p>
<p><tt class="docutils literal"><span class="pre">fcn</span></tt> - A user implemented callback function</p>
<p><tt class="docutils literal"><span class="pre">context</span></tt> - A user context that is passed along to the callback function</p>
<div class="admonition admonition-info"><span class="admonition-info-text"><b>Note:</b></span>
The callback function may receive shapes in any order</div>
<p><strong>Params:</strong></p>
<ul class="simple"><li><tt class="docutils literal"><span class="pre">worldId</span></tt> - The world to cast the ray against</li>
<li><tt class="docutils literal"><span class="pre">origin</span></tt> - The start point of the ray</li>
<li><tt class="docutils literal"><span class="pre">translation</span></tt> - The translation of the ray from the start point to the end point</li>
<li><tt class="docutils literal"><span class="pre">filter</span></tt> - Contains bit flags to filter unwanted shapes from the results</li>
<li><tt class="docutils literal"><span class="pre">fcn</span></tt> - A user implemented callback function</li>
<li><tt class="docutils literal"><span class="pre">context</span></tt> - A user context that is passed along to the callback function</li>
</ul>


</dd>
Expand Down Expand Up @@ -8396,10 +8430,12 @@ <h1><a class="toc-backref" href="#12">Procs</a></h1>
<dd>

<p>Apply a radial explosion</p>
<p><tt class="docutils literal"><span class="pre">worldId</span></tt> - The world id</p>
<p><tt class="docutils literal"><span class="pre">position</span></tt> - The center of the explosion</p>
<p><tt class="docutils literal"><span class="pre">radius</span></tt> - The radius of the explosion</p>
<p><tt class="docutils literal"><span class="pre">impulse</span></tt> - The impulse of the explosion, typically in kg * m / s or N * s.</p>
<p><strong>Params:</strong></p>
<ul class="simple"><li><tt class="docutils literal"><span class="pre">worldId</span></tt> - The world id</li>
<li><tt class="docutils literal"><span class="pre">position</span></tt> - The center of the explosion</li>
<li><tt class="docutils literal"><span class="pre">radius</span></tt> - The radius of the explosion</li>
<li><tt class="docutils literal"><span class="pre">impulse</span></tt> - The impulse of the explosion, typically in kg * m / s or N * s.</li>
</ul>


</dd>
Expand Down Expand Up @@ -8554,13 +8590,14 @@ <h1><a class="toc-backref" href="#12">Procs</a></h1>
<span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>

<p>Adjust contact tuning parameters</p>
<p><tt class="docutils literal"><span class="pre">worldId</span></tt> - The world id</p>
<p><tt class="docutils literal"><span class="pre">hertz</span></tt> - The contact stiffness (cycles per second)</p>
<p><tt class="docutils literal"><span class="pre">dampingRatio</span></tt> - The contact bounciness with 1 being critical damping (non-dimensional)</p>
<p><tt class="docutils literal"><span class="pre">pushVelocity</span></tt> - The maximum contact constraint push out velocity (meters per second)</p>
<div class="admonition admonition-info"><span class="admonition-info-text"><b>Note:</b></span>
Adjust contact tuning parameters<div class="admonition admonition-info"><span class="admonition-info-text"><b>Note:</b></span>
Advanced feature</div>
<p><strong>Params:</strong></p>
<ul class="simple"><li><tt class="docutils literal"><span class="pre">worldId</span></tt> - The world id</li>
<li><tt class="docutils literal"><span class="pre">hertz</span></tt> - The contact stiffness (cycles per second)</li>
<li><tt class="docutils literal"><span class="pre">dampingRatio</span></tt> - The contact bounciness with 1 being critical damping (non-dimensional)</li>
<li><tt class="docutils literal"><span class="pre">pushVelocity</span></tt> - The maximum contact constraint push out velocity (meters per second)</li>
</ul>


</dd>
Expand Down Expand Up @@ -8644,9 +8681,11 @@ <h1><a class="toc-backref" href="#12">Procs</a></h1>
<dd>

<p>Simulate a world for one time step. This performs collision detection, integration, and constraint solution.</p>
<p><tt class="docutils literal"><span class="pre">worldId</span></tt> - The world to simulate</p>
<p><tt class="docutils literal"><span class="pre">timeStep</span></tt> - The amount of time to simulate, this should be a fixed number. Typically 1/60.</p>
<p><tt class="docutils literal"><span class="pre">subStepCount</span></tt> - The number of sub-steps, increasing the sub-step count can increase accuracy. Typically 4.</p>
<p><strong>Params:</strong></p>
<ul class="simple"><li><tt class="docutils literal"><span class="pre">worldId</span></tt> - The world to simulate</li>
<li><tt class="docutils literal"><span class="pre">timeStep</span></tt> - The amount of time to simulate, this should be a fixed number. Typically 1/60.</li>
<li><tt class="docutils literal"><span class="pre">subStepCount</span></tt> - The number of sub-steps, increasing the sub-step count can increase accuracy. Typically 4.</li>
</ul>


</dd>
Expand Down Expand Up @@ -8675,7 +8714,7 @@ <h1><a class="toc-backref" href="#12">Procs</a></h1>
<div class="twelve-columns footer">
<span class="nim-sprite"></span>
<br>
<small style="color: var(--hint);">Made with Nim. Generated: 2024-07-16 02:47:35 UTC</small>
<small style="color: var(--hint);">Made with Nim. Generated: 2024-07-19 19:17:20 UTC</small>
</div>
</div>
</div>
Expand Down
Loading

0 comments on commit 18d4aad

Please sign in to comment.