Difference between revisions of "R3d.World:createFixedJoint"
m (Text replacement - "</source>" to "</syntaxhighlight>") |
|||
| Line 3: | Line 3: | ||
=== Description === | === Description === | ||
| − | Creates a fixed joint | + | Creates a fixed joint. |
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
| − | r3d.World:createFixedJoint(bodyA,bodyB,anchorX,anchorY,anchorZ,params) | + | r3d.World:createFixedJoint(bodyA,bodyB,anchorX,anchorY,anchorZ[,params]) |
</syntaxhighlight> | </syntaxhighlight> | ||
| + | |||
| + | 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. | ||
| + | |||
| + | '''Note''' 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 | ||
=== Parameters === | === Parameters === | ||
| Line 19: | Line 23: | ||
=== Example === | === Example === | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
| − | world:createFixedJoint(cube01body, cube02body, 0, | + | world:createFixedJoint(cube01body, cube02body, 0, 2, 0, { isCollisionEnabled=false, } ) |
</syntaxhighlight> | </syntaxhighlight> | ||
{{R3d.World}} | {{R3d.World}} | ||
Latest revision as of 08:25, 18 December 2025
Available since: Gideros 2019.10
Class: R3d.World
Description
Creates a fixed joint.
r3d.World:createFixedJoint(bodyA,bodyB,anchorX,anchorY,anchorZ[,params])
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.
Note 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
Parameters
bodyA: (b3d body) body A
bodyB: (b3d body) body B
anchorX: (number) anchor x
anchorY: (number) anchor y
anchorZ: (number) anchor z
params: (table) optional any of the followings:
- isCollisionEnabled (bool)
Example
world:createFixedJoint(cube01body, cube02body, 0, 2, 0, { isCollisionEnabled=false, } )
- R3d.World
- R3d.World.new
- R3d.World:createBallAndSocketJoint
- R3d.World:createBody
- R3d.World:createFixedJoint
- R3d.World:createHingeJoint
- R3d.World:createSliderJoint
- R3d.World:destroyBody
- R3d.World:destroyJoint
- R3d.World:getGravity
- R3d.World:raycast
- R3d.World:setEventListener
- R3d.World:setGravity
- R3d.World:step
- R3d.World:testCollision
- R3d.World:testOverlap