Difference between revisions of "R3d.FixedJoint"

From GiderosMobile
m (Text replacement - "<source" to "<syntaxhighlight")
Line 4: Line 4:
 
=== Description ===
 
=== Description ===
 
The FixedJoint class describes a fixed joint between two bodies. In a fixed joint, there is no degree of freedom, the bodies are not allowed to translate or rotate with respect to each other. In order to create a fixed joint, you simply need to specify an anchor point (in world-space) to create the FixedJointInfo object.
 
The FixedJoint class describes a fixed joint between two bodies. In a fixed joint, there is no degree of freedom, the bodies are not allowed to translate or rotate with respect to each other. In order to create a fixed joint, you simply need to specify an anchor point (in world-space) to create the FixedJointInfo object.
<source lang="lua">
+
<syntaxhighlight lang="lua">
 
r3d.FixedJoint
 
r3d.FixedJoint
 
</source>
 
</source>
Line 13: Line 13:
  
 
=== Example ===
 
=== Example ===
<source lang="lua">
+
<syntaxhighlight lang="lua">
 
</source>
 
</source>
  
 
{{R3d.Joint}}
 
{{R3d.Joint}}

Revision as of 15:30, 13 July 2023

Available since: Gideros 2019.10
Class: R3d.Joint

Description

The FixedJoint class describes a fixed joint between two bodies. In a fixed joint, there is no degree of freedom, the bodies are not allowed to translate or rotate with respect to each other. In order to create a fixed joint, you simply need to specify an anchor point (in world-space) to create the FixedJointInfo object. <syntaxhighlight lang="lua"> r3d.FixedJoint </source>

Now, it is possible to create the actual joint in the dynamics world using the DynamicsWorld::createJoint() method.

Note that this method will also return a pointer to the FixedJoint object that has been created internally. You will then be able to use that pointer to change properties of the joint and also to destroy it at the end.

Example

<syntaxhighlight lang="lua"> </source>