Description
Returns selection position in model space pertaining to the current animation in render time scope.
When the default syntax is used, command searches first in Memory LOD, then in Geometry LOD, FireGeometry LOD, LandContact LOD, HitPoints LOD and finally in ViewGeometry LOD and returns the first matching find.
The second syntax allows to specify which one of these LODs to search in instead.
Important
Sometimes internally "ViewGeometry" could be equal to "Geometry", and "FireGeometry" could be equal to "ViewGeometry".
In order to pinpoint the actual LOD, use allLODs and LOD resolution as argument for selecting the LOD.
Also note that similar models can have different LOD indexes, for example a soldier model differs from a model of civilian in this regard.
Syntax
Syntax 1
object selectionPosition selectionName
Parameters:
Returns: relative position - If selection does not exist, [0, 0, 0] is returned.
Syntax 2
since arma3 1.50
object selectionPosition [selectionName, LOD, returnMode]
Parameters:
object: Object
selectionName: String
LOD: String or Number - can be one of:
"Memory"
"Geometry"
"FireGeometry"
"LandContact"
"HitPoints"
- Arma 3 v2.06
"ViewGeometry"
When Number is used, command searches for a LOD with the similar LOD resolution (since arma3 2.06)
returnMode: String - (Optional, default "FirstPoint") can be one of:
"FirstPoint"
"AveragePoint"
"BoundingBox" (since arma3 2.08)
Returns: relative position - If selection does not exist, [0, 0, 0] is returned. If returnMode is "BoundingBox", Array of Arrays
Syntax 3
since arma3 2.06
selectionPosition [object, selectionName, LODIndex, isVisual, returnMode]
Parameters:
object: Object
selectionName: String
LODIndex: Number - the index of the target LOD (see allLODs)
isVisual: Boolean - (Optional, default true) true for Render, false for Simulation time scope
returnMode: String - (Optional, default "FirstPoint") can be one of:
"FirstPoint"
"AveragePoint"
"BoundingBox" (since arma3 2.08)
Returns: relative position - If selection does not exist, [0, 0, 0] is returned. If returnMode is "BoundingBox", Array of Arrays
Examples
Example 1
_inModelPosition = player selectionPosition "head_hit";
Example 2
_inModelPosition = player selectionPosition "pelvis";
Example 3
_inModelPosition = player selectionPosition "head";
Example 4
_inModelPosition = player selectionPosition "camera";
Example 5
stomper selectionPosition ["wheel_1_1", "HitPoints", "FirstPoint"];
stomper selectionPosition ["wheel_1_1", "HitPoints", "AveragePoint"];
stomper selectionPosition ["wheel_1_1", "HitPoints", "BoundingBox"];
See also
selectionVectorDirAndUp · modelToWorld · selectionNames · getAllHitPointsDamage · allLODs · LOD resolutions