Difference between revisions of "R3d.Body:applyTorque"

From GiderosMobile
(Created page with "'''Available since:''' Gideros 2019.10<br/> '''Class:''' R3d.Body<br/> === Description === Applies a torque to the body. <source lang="lua"> r3d.Body:applyTorque(torqueX,...")
 
m (Text replacement - "<source" to "<syntaxhighlight")
Line 4: Line 4:
 
=== Description ===
 
=== Description ===
 
Applies a torque to the body.
 
Applies a torque to the body.
<source lang="lua">
+
<syntaxhighlight lang="lua">
 
r3d.Body:applyTorque(torqueX,torqueY,torqueZ)
 
r3d.Body:applyTorque(torqueX,torqueY,torqueZ)
 
</source>
 
</source>
Line 14: Line 14:
  
 
=== Example ===
 
=== Example ===
<source lang="lua">
+
<syntaxhighlight lang="lua">
 
if isleft then ship.body:applyTorque(0, -24 * 64, 0) end
 
if isleft then ship.body:applyTorque(0, -24 * 64, 0) end
 
</source>
 
</source>
  
 
{{R3d.Body}}
 
{{R3d.Body}}

Revision as of 14:30, 13 July 2023

Available since: Gideros 2019.10
Class: R3d.Body

Description

Applies a torque to the body. <syntaxhighlight lang="lua"> r3d.Body:applyTorque(torqueX,torqueY,torqueZ) </source>

Parameters

torqueX: (number) applies a torque on the X axis
torqueY: (number) applies a torque on the Y axis
torqueZ: (number) applies a torque on the Z axis

Example

<syntaxhighlight lang="lua"> if isleft then ship.body:applyTorque(0, -24 * 64, 0) end </source>