Arma Reforger Script API
Loading...
Searching...
No Matches
Static Public Member Functions | Static Protected Member Functions | List of all members
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)
 Function to find specific component on given entity or entity 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 IEntity GetPlayer ()
 Return the player-controlled entity See EntityUtils.GetPlayer()
 
static bool IsPlayer (IEntity entity)
 Check if the provided entity is the local player See EntityUtils.GetPlayer()
 
static bool IsAPlayer (IEntity entity)
 Check if the provided entity is -a- player - a human-controlled entity See EntityUtils.IsPlayer()
 
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 local transform from member to owner.
 

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.
 

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
entity

◆ FindComponent()

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

Function to find specific component on given entity or entity parent/slottedEntities/siblings/rootparents etc.

Parameters
entityEntity to use to find the component on
componentTypeComponent Class to find
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
parent
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
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
entitythe entity to measure

◆ GetEntitySize()

static vector SCR_EntityHelper.GetEntitySize ( notnull IEntity  entity)
static

Returns the size of an entity from its bounding box.

Parameters
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
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
entityEntity to get the main parent from
selfreturn entity if there is no parent, false otherwise - default = false

◆ GetPlayer()

static IEntity SCR_EntityHelper.GetPlayer ( )
static

Return the player-controlled entity See EntityUtils.GetPlayer()

◆ GetRelativeLocalTransform()

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

Get relative local transform from member to owner.

Currently supports single hierarchy only.

Parameters
[in]ownerStarting entity. Read as IEntity for convenience, but it has to be BaseGameEntity.
[in]memberEnding entity. Has to be BaseGameEntity if it's not parent of owner. Must be in the same hierarchy as owner.
[out]relativeTransformtransformation from member to owner local space
Returns
whether the result is reliable

◆ IsAPlayer()

static bool SCR_EntityHelper.IsAPlayer ( IEntity  entity)
static

Check if the provided entity is -a- player - a human-controlled entity See EntityUtils.IsPlayer()

Parameters
entity

◆ IsPlayer()

static bool SCR_EntityHelper.IsPlayer ( IEntity  entity)
static

Check if the provided entity is the local player See EntityUtils.GetPlayer()

Parameters
entity

◆ OnlyStaticCallback()

static bool SCR_EntityHelper.OnlyStaticCallback ( notnull IEntity  entity)
staticprotected
Parameters
entity

◆ OrientUpToVector()

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

◆ SetHierarchyChildTransform()

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

Set child transformation.

Parameters
entity
oldTransform
newTransform
recursive

◆ SetHierarchyTransform()

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

Set transform for the whole hierarchy.

Parameters
entity
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
entitythe entity to snap to the ground
excludeArray
maxLength
startOffset
onlyStaticonly check static physics

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