Difference between revisions of "R3d.Body:setIsAllowedToSleep"

From GiderosMobile
(Created page with "'''Available since:''' Gideros 2019.10<br/> '''Class:''' R3d.Body<br/> === Description === Allows or disallows a body to sleep. <source lang="lua"> r3d.Body:setIsAllowedT...")
 
 
(2 intermediate revisions by one other user not shown)
Line 4: Line 4:
 
=== Description ===
 
=== Description ===
 
Allows or disallows a body to sleep.
 
Allows or disallows a body to sleep.
<source lang="lua">
+
<syntaxhighlight lang="lua">
 
r3d.Body:setIsAllowedToSleep(allowed)
 
r3d.Body:setIsAllowedToSleep(allowed)
</source>
+
</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 12: Line 14:
  
 
=== Example ===
 
=== Example ===
<source lang="lua">
+
<syntaxhighlight lang="lua">
 +
// This rigid body cannot sleep
 
ship.body:setIsAllowedToSleep(false)
 
ship.body:setIsAllowedToSleep(false)
</source>
+
</syntaxhighlight>
  
 
{{R3d.Body}}
 
{{R3d.Body}}

Latest revision as of 11:16, 16 December 2025