isAwake: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
m (Replaced <code> with <sqf>)
(12 intermediate revisions by 2 users not shown)
Line 3: Line 3:
|game1= arma3
|game1= arma3
|version1= 2.08
|version1= 2.08
|branch= dev
|arg= global
|arg= global
|eff= local
|eff= local
Line 10: Line 8:
|gr1= Object Manipulation
|gr1= Object Manipulation


|descr= Returns resting state of a PhysX object. If object of class <tt>Man</tt> is used for the argument, the command returns [[false]] if ragdoll simulation is active and [[true]] if there is no ragdoll simulation. Destroyed and null objects return [[false]].  
|descr= Returns resting state of a PhysX (EPE) object. Some EPE objects are deliberately put to sleep by the engine to save resources. This command returns [[true]] when object is simulating and [[false]] when it is put to sleep. With units of type {{hl|Man}} the behaviour is slightly different. As units never get put to sleep, the command outputs ragdoll state of a unit instead. There are 6 states for the output of the command:
* EPE object is simulaing - [[true]]
* EPE object is put to sleep - [[false]]
* Unit is [[alive]], ragdoll is active - [[false]]
* Unit is [[alive]], ragdoll is NOT active - [[true]]
* {{GVI|arma3|2.10}} Unit is NOT [[alive]], ragdoll is active - [[true]]
* {{GVI|arma3|2.10}} Unit is NOT [[alive]], ragdoll is NOT active - [[false]]
It may look counter-intuitive but there is a simple formula to return ragdoll state of a unit (since {{GVI|arma3|2.10}}):
<sqf>private _unitIsInRagdoll = alive _unit != isAwake _unit;</sqf>


|s1= [[isAwake]] object
|s1= [[isAwake]] object
Line 16: Line 22:
|p1= object: [[Object]] - PhysX object or unit
|p1= object: [[Object]] - PhysX object or unit


|r1= [[Boolean]]
|r1= [[Boolean]] - see description


|x1= <code>_isAwake = [[isAwake]] _object;</code>
|x1= <sqf>private _isAwake = isAwake _object;</sqf>


|seealso= [[awake]] [[addTorque]] [[addForce]] [[vectorModelToWorld]] [[vectorModelToWorldVisual]] [[selectionPosition]]
|seealso= [[awake]] [[addTorque]] [[addForce]] [[vectorModelToWorld]] [[vectorModelToWorldVisual]] [[selectionPosition]]
}}
}}

Revision as of 14:22, 14 May 2022

Hover & click on the images for description

Description

Description:
Returns resting state of a PhysX (EPE) object. Some EPE objects are deliberately put to sleep by the engine to save resources. This command returns true when object is simulating and false when it is put to sleep. With units of type Man the behaviour is slightly different. As units never get put to sleep, the command outputs ragdoll state of a unit instead. There are 6 states for the output of the command: It may look counter-intuitive but there is a simple formula to return ragdoll state of a unit (since Arma 3 logo black.png2.10):
private _unitIsInRagdoll = alive _unit != isAwake _unit;
Groups:
Object Manipulation

Syntax

Syntax:
isAwake object
Parameters:
object: Object - PhysX object or unit
Return Value:
Boolean - see description

Examples

Example 1:
private _isAwake = isAwake _object;

Additional Information

See also:
awake addTorque addForce vectorModelToWorld vectorModelToWorldVisual selectionPosition

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note