Arma Reforger Script API
Loading...
Searching...
No Matches
SCR_EntityHelper Interface Reference

Static Public Member Functions

static Managed FindComponent (notnull IEntity entity, TypeName componentType, SCR_EComponentFinderQueryFlags queryFlags=SCR_EComponentFinderQueryFlags.ENTITY|SCR_EComponentFinderQueryFlags.SLOTS)
 Find a specific component on the provided entity or the entity's parent/slottedEntities/siblings/rootparents etc.
 
static int GetChildrenCount (IEntity parent, bool recursive=false)
 Returns number of children the input entity has.
 
static void DeleteEntityAndChildren (IEntity entity)
 Deletes input parent entity and all children Just a wrapper for RplComponent.DeleteRplEntity(entity, false);.
 
static vector GetEntitySize (notnull IEntity entity)
 Returns the size of an entity from its bounding box.
 
static vector GetEntityCenterWorld (notnull IEntity entity)
 Returns the center of the entity from its bounding box in world coordinates.
 
static float GetEntityRadius (notnull IEntity entity)
 Returns the radius of the entity based on the size of its bounding box.
 
static void GetHierarchyEntityList (notnull IEntity entity, notnull inout array< IEntity > output)
 Returns a list of all entities in the hierarchy.
 
static void SnapToGround (notnull IEntity entity, array< IEntity > excludeArray=null, float maxLength=10, vector startOffset="0 0 0", bool onlyStatic=false)
 
static void OrientUpToVector (vector newUp, inout vector mat[4])
 
static IEntity GetMainParent (IEntity entity, bool self=false)
 Returns the main parent of the input entity.
 
static void SetHierarchyTransform (notnull IEntity entity, vector newTransform[4])
 Set transform for the whole hierarchy.
 
static bool GetRelativeLocalTransform (notnull IEntity owner, notnull IEntity member, out vector relativeTransform[4])
 Get relative transform from member to owner local space.
 
static RplComponent GetEntityRplComponent (notnull IEntity entity)
 Atempts to find RplComponent in the fastest possible way.
 
static void QuickSortEntitiesByDistanceToPoint (notnull inout array< IEntity > arr, vector pos, int low, int high)
 QuickSort algorithm for ordering an array of Entities by distance to the specified world position.
 

Static Protected Member Functions

static bool OnlyStaticCallback (notnull IEntity entity)
 
static void SetHierarchyChildTransform (notnull IEntity entity, vector oldTransform[4], vector newTransform[4], bool recursive=true)
 Set child transformation.
 
static int Partition (notnull inout array< IEntity > arr, vector pos, int low, int high)
 Method used for sorting part of the provided array of entities based on their distance to the specified position.
 

Member Function Documentation

◆ DeleteEntityAndChildren()

static void SCR_EntityHelper.DeleteEntityAndChildren ( IEntity entity)
static

Deletes input parent entity and all children Just a wrapper for RplComponent.DeleteRplEntity(entity, false);.

Parameters
[in]entity

◆ FindComponent()

static Managed SCR_EntityHelper.FindComponent ( notnull IEntity entity,
TypeName componentType,
SCR_EComponentFinderQueryFlags queryFlags = SCR_EComponentFinderQueryFlags::ENTITY | SCR_EComponentFinderQueryFlags::SLOTS )
static

Find a specific component on the provided entity or the entity's parent/slottedEntities/siblings/rootparents etc.

Parameters
[in]entityEntity to use to find the component on
[in]componentTypeComponent Class to find
[in]queryFlagsWhere to find the component on. It can have multiple flags and is checked in order of lowest to highest flag value
Returns
Component is any is found

◆ GetChildrenCount()

static int SCR_EntityHelper.GetChildrenCount ( IEntity parent,
bool recursive = false )
static

Returns number of children the input entity has.

Parameters
[in]parent
[in]recursivechecks children's children if set to true, the number of direct children otherwise
Returns
0 if the provided entity is null

◆ GetEntityCenterWorld()

static vector SCR_EntityHelper.GetEntityCenterWorld ( notnull IEntity entity)
static

Returns the center of the entity from its bounding box in world coordinates.

Parameters
[in]entity
Returns
bounding box' centre in world coordinates

◆ GetEntityRadius()

static float SCR_EntityHelper.GetEntityRadius ( notnull IEntity entity)
static

Returns the radius of the entity based on the size of its bounding box.

Parameters
[in]entitythe entity to measure

◆ GetEntityRplComponent()

static RplComponent SCR_EntityHelper.GetEntityRplComponent ( notnull IEntity entity)
static

Atempts to find RplComponent in the fastest possible way.

Parameters
[in]entityfrom which RplComponent should be retrived

◆ GetEntitySize()

static vector SCR_EntityHelper.GetEntitySize ( notnull IEntity entity)
static

Returns the size of an entity from its bounding box.

Parameters
[in]entity
Returns
vector of width, height, length

◆ GetHierarchyEntityList()

static void SCR_EntityHelper.GetHierarchyEntityList ( notnull IEntity entity,
notnull inout array< IEntity > output )
static

Returns a list of all entities in the hierarchy.

Parameters
[in]entity
[in,out]output

◆ GetMainParent()

static IEntity SCR_EntityHelper.GetMainParent ( IEntity entity,
bool self = false )
static

Returns the main parent of the input entity.

Parameters
[in]entityEntity to get the main parent from
[in]selfreturn entity if there is no parent, false otherwise
Returns

◆ GetRelativeLocalTransform()

static bool SCR_EntityHelper.GetRelativeLocalTransform ( notnull IEntity owner,
notnull IEntity member,
out vector relativeTransform[4] )
static

Get relative transform from member to owner local space.

Parameters
[in]ownerStarting entity.
[in]memberEnding entity.
[out]relativeTransformtransformation from member to owner local space
Returns
whether the result is reliable

◆ OnlyStaticCallback()

static bool SCR_EntityHelper.OnlyStaticCallback ( notnull IEntity entity)
staticprotected
Parameters
[in]entity
Returns
true if entity does not have physics or is not dynamic, false otherwise

◆ OrientUpToVector()

static void SCR_EntityHelper.OrientUpToVector ( vector newUp,
inout vector mat[4] )
static
Parameters
[in]newUp
[in,out]mat

◆ Partition()

static int SCR_EntityHelper.Partition ( notnull inout array< IEntity > arr,
vector pos,
int low,
int high )
staticprotected

Method used for sorting part of the provided array of entities based on their distance to the specified position.

Parameters
[in,out]arrarray whose content will be sorted
[in]posworld space position to which distance will be measured
[in]lowindex from the array that will be used as a starting point for sorting
[in]highindex from the array that will be used as the end point for sorting
Returns

◆ QuickSortEntitiesByDistanceToPoint()

static void SCR_EntityHelper.QuickSortEntitiesByDistanceToPoint ( notnull inout array< IEntity > arr,
vector pos,
int low,
int high )
static

QuickSort algorithm for ordering an array of Entities by distance to the specified world position.

Parameters
[in,out]arrarray whose content will be sorted
[in]posworld space position to which distance will be measured
[in]lowindex from the array that will be used as a starting point for sorting
[in]highindex from the array that will be used as the end point for sorting

◆ SetHierarchyChildTransform()

static void SCR_EntityHelper.SetHierarchyChildTransform ( notnull IEntity entity,
vector oldTransform[4],
vector newTransform[4],
bool recursive = true )
staticprotected

Set child transformation.

Parameters
[in]entity
[in]oldTransform
[in]newTransform
[in]recursive

◆ SetHierarchyTransform()

static void SCR_EntityHelper.SetHierarchyTransform ( notnull IEntity entity,
vector newTransform[4] )
static

Set transform for the whole hierarchy.

Parameters
[in]entity
[in]newTransform

◆ SnapToGround()

static void SCR_EntityHelper.SnapToGround ( notnull IEntity entity,
array< IEntity > excludeArray = null,
float maxLength = 10,
vector startOffset = "0 0 0",
bool onlyStatic = false )
static
Parameters
[in]entitythe entity to snap to the ground
[in]excludeArray
[in]maxLength
[in]startOffset
[in]onlyStaticonly check static physics

The documentation for this interface was generated from the following file: