Difference between revisions of "R3d.Body:setIsAllowedToSleep"

From GiderosMobile
m (Text replacement - "</source>" to "</syntaxhighlight>")
 
Line 7: Line 7:
 
r3d.Body:setIsAllowedToSleep(allowed)
 
r3d.Body:setIsAllowedToSleep(allowed)
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
 +
The sleeping technique is used to disable the simulation of resting bodies. By default, the bodies are allowed to sleep when they come to rest.
  
 
=== Parameters ===
 
=== Parameters ===
Line 13: Line 15:
 
=== Example ===
 
=== Example ===
 
<syntaxhighlight lang="lua">
 
<syntaxhighlight lang="lua">
 +
// This rigid body cannot sleep
 
ship.body:setIsAllowedToSleep(false)
 
ship.body:setIsAllowedToSleep(false)
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
{{R3d.Body}}
 
{{R3d.Body}}

Latest revision as of 11:16, 16 December 2025