Enfusion Script API
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
IEntity Interface Reference
Inheritance diagram for IEntity:
[legend]

Public Member Functions

proto external EntityID GetID ()
 Return unique entity ID.
 
proto external IEntity GetParent ()
 Returns parent of this entity (entity on upper level of hierarchy).
 
proto external IEntity GetRootParent ()
 Returns top-parent of this entity.
 
proto external IEntity GetChildren ()
 Returns first child from this level of hierarchy if there is any.
 
proto external IEntity GetSibling ()
 Returns next sibling of this entity (next entity on this level of hierarchy).
 
proto external VObject GetVObject ()
 Returns visual object set to this Entity. No reference is added.
 
proto external EntityPrefabData GetPrefabData ()
 
proto external EntityComponentPrefabData FindComponentData (TypeName typeName)
 
proto external BaseWorld GetWorld ()
 
proto external void SetFixedLOD (int lod)
 Set fixed LOD. Use -1 for non-fixed LOD.
 
proto external void GetTransform (out vector mat[])
 Returns world transformation of Entity.
 
proto external void GetWorldTransform (out vector mat[])
 See IEntity::GetTransform.
 
proto external void GetLocalTransform (out vector mat[])
 See IEntity::GetTransform.
 
proto external vector VectorToParent (vector vec)
 Transforms local vector to parent(world) space.
 
proto external vector CoordToParent (vector coord)
 Transforms local position to parent(world) space.
 
proto external vector VectorToLocal (vector vec)
 Transforms world space vector to local space.
 
proto external vector CoordToLocal (vector coord)
 Transforms world space position to local space.
 
proto external vector GetYawPitchRoll ()
 Returns orientation of Entity in world space (Yaw, Pitch, Roll).
 
proto external void SetYawPitchRoll (vector angles)
 Sets angles for entity (Yaw, Pitch, Roll).
 
proto external vector GetWorldTransformAxis (int axis)
 See IEntity::GetTransformAxis.
 
proto external vector GetTransformAxis (int axis)
 See IEntity::GetTransformAxis.
 
proto external vector GetLocalTransformAxis (int axis)
 See IEntity::GetTransformAxis.
 
proto external bool SetLocalTransform (vector mat[4])
 See IEntity::SetTransform. Returns false, if there is no change in transformation.
 
proto external bool SetWorldTransform (vector mat[4])
 See IEntity::SetTransform. Returns false, if there is no change in transformation.
 
proto external TNodeId GetPivot ()
 Returns pivot ID from hierarchy component.
 
proto external bool SetTransform (vector mat[4])
 Sets entity world transformation.
 
proto external vector GetLocalAngles ()
 Same as GetLocalYawPitchRoll(), but returns rotation vector around X, Y and Z axis.
 
proto external vector GetLocalYawPitchRoll ()
 Returns local orientation when it's in hierarchy (Yaw, Pitch, Roll).
 
proto external vector GetAngles ()
 Same as GetYawPitchRoll(), but returns rotation vector around X, Y and Z axis.
 
proto external void SetAngles (vector angles)
 Same as SetYawPitchRoll(), but sets rotation around X, Y and Z axis.
 
proto external vector GetOrigin ()
 Returns origin of Entity.
 
proto external void SetOrigin (vector orig)
 Sets origin for entity.
 
proto external void SetScale (float scale)
 
proto external float GetScale ()
 
proto external void GetBounds (out vector mins, out vector maxs)
 Returns local bounding box of model on Entity.
 
proto external void GetWorldBounds (out vector mins, out vector maxs)
 Returns quantized world-bound-box of Entity.
 
proto external volatile void SendEvent (notnull IEntity actor, EntityEvent e, void extra)
 Dynamic event invocation. Parameters are the same as in IEntity::EOnXXXX() methods.
 
proto external string GetName ()
 
proto external int SetVComponentFlags (VCFlags flags)
 Sets component flags.
 
proto external void SetObject (VObject object, string options)
 Sets the visual object to this entity.
 
proto external EntityFlags SetFlags (EntityFlags flags, bool recursively=false)
 Sets Entity flags.
 
proto external EntityFlags ClearFlags (EntityFlags flags, bool recursively=false)
 Clear Entity flags.
 
proto external EntityFlags GetFlags ()
 Returns Entity flags.
 
proto external EntityEvent SetEventMask (EntityEvent e)
 Sets event mask.
 
proto external EntityEvent ClearEventMask (EntityEvent e)
 Clears event mask.
 
proto external EntityEvent GetEventMask ()
 Returns current event mask.
 
proto external bool IsLoaded ()
 
proto external bool IsRemoved ()
 
proto external bool IsDeleted ()
 
proto external int Update ()
 Updates entity state/position.
 
proto external int AddChild (notnull IEntity child, TNodeId pivot, EAddChildFlags flags=EAddChildFlags.AUTO_TRANSFORM)
 Add Entity to hierarchy. Pivot is pivot index, or -1 for center of parent.
 
proto external void RemoveChild (notnull IEntity child, bool keepTransform=false)
 Remove Entity from hierarchy.
 
proto external void SetName (string name)
 
proto external int SetCameraMask (int mask)
 Sets visibility mask for cameras, where Entity will be rendered.
 
proto external Physics GetPhysics ()
 
proto external Particles GetParticles ()
 
proto external Animation GetAnimation ()
 
proto external int Animate (float speed, int loop)
 Updates animation (either xob, or particle, whatever).
 
proto external int AnimateEx (float speed, int loop, out vector lin, out vector ang)
 Updates animation (either xob, or particle, whatever).
 
proto external void SetBone (TNodeId bone, vector angles, vector trans, float scale)
 
proto external bool SetBoneMatrix (TNodeId bone, vector mat[4])
 
proto external bool GetBoneMatrix (TNodeId bone, out vector mat[4])
 
proto external TNodeId GetBoneIndex (string boneName)
 
proto external void GetBoneNames (out notnull array< string > boneNames)
 
proto external bool GetBoneLocalMatrix (TNodeId bone, out vector mat[4])
 
proto external Managed FindComponent (TypeName typeName)
 Finds first occurance of the coresponding component.
 
proto external int FindComponents (TypeName typeName, notnull array< Managed > outComponents)
 Finds all occurances of the coresponding component.
 
- Public Member Functions inherited from Managed
proto external ref Managed Clone ()
 Return shallow copy of object, or null if it is not allowed (not public constructor)
 

Protected Member Functions

void EOnTouch (IEntity owner, IEntity other, int touchTypesMask)
 Event when touched by other entity.
 
void EOnInit (IEntity owner)
 Event after entity is allocated and initialized.
 
void EOnVisible (IEntity owner, int frameNumber)
 Event when we are visible.
 
void EOnFrame (IEntity owner, float timeSlice)
 Event every frame.
 
void EOnPostFrame (IEntity owner, float timeSlice)
 Event after physics update.
 
void EOnAnimEvent (IEntity owner, int type, int slot)
 Event from animation system.
 
void EOnSimulate (IEntity owner, float timeSlice)
 Event before every physics fixed step (can be multiple calls per engine update)
 
void EOnPostSimulate (IEntity owner, float timeSlice)
 Event after every physics fixed step (can be multiple calls per engine update)
 
void EOnJointBreak (IEntity owner, IEntity other)
 Event when joint attached to RigidBody of this entity is broken.
 
void EOnPhysicsMove (IEntity owner)
 Event when physics engine has moved with this Entity.
 
void EOnContact (IEntity owner, IEntity other, Contact contact)
 Event when physics engine registered contact with other RigidBody.
 
void EOnPhysicsActive (IEntity owner, bool activeState)
 Event when a RigidBody active state is changed between consecutive fixed steps.
 
void EOnFixedFrame (IEntity owner, float timeSlice)
 Event every fixed frame.
 
void EOnFixedPostFrame (IEntity owner, float timeSlice)
 Event after physics update every fixed frame.
 
void EOnUser0 (IEntity other, int extra)
 EntityEvent.EV_USER+0.
 
void EOnUser1 (IEntity other, int extra)
 EntityEvent.EV_USER+1.
 
void EOnUser2 (IEntity other, int extra)
 EntityEvent.EV_USER+2.
 
void EOnUser3 (IEntity other, int extra)
 EntityEvent.EV_USER+3.
 
void EOnUser4 (IEntity other, int extra)
 EntityEvent.EV_USER+4.
 
void IEntity (IEntitySource src, IEntity parent)
 protected script Constructor
 

Constructor & Destructor Documentation

◆ IEntity()

void IEntity.IEntity ( IEntitySource  src,
IEntity  parent 
)
protected

protected script Constructor

Member Function Documentation

◆ AddChild()

proto external int IEntity.AddChild ( notnull IEntity  child,
TNodeId  pivot,
EAddChildFlags  flags = EAddChildFlags.AUTO_TRANSFORM 
)

Add Entity to hierarchy. Pivot is pivot index, or -1 for center of parent.

◆ Animate()

proto external int IEntity.Animate ( float  speed,
int  loop 
)

Updates animation (either xob, or particle, whatever).

◆ AnimateEx()

proto external int IEntity.AnimateEx ( float  speed,
int  loop,
out vector  lin,
out vector  ang 
)

Updates animation (either xob, or particle, whatever).

◆ ClearEventMask()

proto external EntityEvent IEntity.ClearEventMask ( EntityEvent  e)

Clears event mask.

Man player = g_Game.GetPlayer();
player.SetEventMask(EntityEvent.VISIBLE );
Print( player.GetEventMask() );
player.ClearEventMask(EntityEvent.ALL );
Print( player.GetEventMask() );
>> 128
>> 0
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
EntityEvent
Various entity events.
Definition: EntityEvent.c:14
Parameters
eevent mask
Returns
event mask

◆ ClearFlags()

proto external EntityFlags IEntity.ClearFlags ( EntityFlags  flags,
bool  recursively = false 
)

Clear Entity flags.

Returns cleared flags.

Man player = g_Game.GetPlayer();
player.ClearFlags(EntityFlags.VISIBLE|EntityFlags.TRACEABLE );
Print( player.GetFlags() );
>> 1610612744
EntityFlags
Various entity flags.
Definition: EntityFlags.c:14
Parameters
flagsFlags to be set
recursivelyFlags will be recursively applied to children of hierarchy too
Returns
cleared flags

◆ CoordToLocal()

proto external vector IEntity.CoordToLocal ( vector  coord)

Transforms world space position to local space.

Man player = g_Game.GetPlayer();
Print( player.CoordToLocal("500 10 155") );
>> <15254,-54.2004,8745.53>
Parameters
coordworld space position to transform
Returns
position in local space

◆ CoordToParent()

proto external vector IEntity.CoordToParent ( vector  coord)

Transforms local position to parent(world) space.

Man player = g_Game.GetPlayer();
Print( player.CoordToParent("1 2 3") );
>> <2549,17.6478,2857>
Parameters
coordlocal position to transform
Returns
position in parent space

◆ EOnAnimEvent()

void IEntity.EOnAnimEvent ( IEntity  owner,
int  type,
int  slot 
)
protected

Event from animation system.

Parameters
ownerThe owner entity
type
slot

◆ EOnContact()

void IEntity.EOnContact ( IEntity  owner,
IEntity  other,
Contact  contact 
)
protected

Event when physics engine registered contact with other RigidBody.

Parameters
ownerThe owner entity
otherOther Entity who contacted us
contactStructure describing the contact

◆ EOnFixedFrame()

void IEntity.EOnFixedFrame ( IEntity  owner,
float  timeSlice 
)
protected

Event every fixed frame.

Parameters
ownerThe owner entity
timeSliceFixed time step

Implemented in RplExample3Controller.

◆ EOnFixedPostFrame()

void IEntity.EOnFixedPostFrame ( IEntity  owner,
float  timeSlice 
)
protected

Event after physics update every fixed frame.

Parameters
ownerThe owner entity
timeSliceFixed time step

◆ EOnFrame()

void IEntity.EOnFrame ( IEntity  owner,
float  timeSlice 
)
protected

Event every frame.

Parameters
ownerThe owner entity
timeSliceTime passed since last frame

Implemented in AutotestGrid, FPS_Autotest, MotionAutoTest, Screenshot_Autotest, EntityWithRplRpc, RplExampleDebugShape, and RplExample3Controller.

◆ EOnInit()

void IEntity.EOnInit ( IEntity  owner)
protected

Event after entity is allocated and initialized.

Parameters
ownerThe owner entity

Implemented in AutotestGrid, FPS_Autotest, MotionZone, MotionAutoTest, Screenshot_Autotest, CrossroadEntity, and WorldDecal.

◆ EOnJointBreak()

void IEntity.EOnJointBreak ( IEntity  owner,
IEntity  other 
)
protected

Event when joint attached to RigidBody of this entity is broken.

Parameters
ownerThe owner entity
otherOther Entity attached to the joint

◆ EOnPhysicsActive()

void IEntity.EOnPhysicsActive ( IEntity  owner,
bool  activeState 
)
protected

Event when a RigidBody active state is changed between consecutive fixed steps.

Parameters
ownerThe owner entity

◆ EOnPhysicsMove()

void IEntity.EOnPhysicsMove ( IEntity  owner)
protected

Event when physics engine has moved with this Entity.

Parameters
ownerThe owner entity

◆ EOnPostFrame()

void IEntity.EOnPostFrame ( IEntity  owner,
float  timeSlice 
)
protected

Event after physics update.

Parameters
ownerThe owner entity
timeSliceTime passed since last frame

Implemented in ScriptCamera.

◆ EOnPostSimulate()

void IEntity.EOnPostSimulate ( IEntity  owner,
float  timeSlice 
)
protected

Event after every physics fixed step (can be multiple calls per engine update)

Parameters
ownerThe owner entity
timeSliceTime slice of physics fixed step

◆ EOnSimulate()

void IEntity.EOnSimulate ( IEntity  owner,
float  timeSlice 
)
protected

Event before every physics fixed step (can be multiple calls per engine update)

Parameters
ownerThe owner entity
timeSliceTime slice of physics fixed step

◆ EOnTouch()

void IEntity.EOnTouch ( IEntity  owner,
IEntity  other,
int  touchTypesMask 
)
protected

Event when touched by other entity.

Note
You need to have TouchComponent in entity to receive this event.
Parameters
ownerThe owner entity
otherEntity who touched us
touchTypesMaskBitmask of touch types TODO

◆ EOnUser0()

void IEntity.EOnUser0 ( IEntity  other,
int  extra 
)
protected

EntityEvent.EV_USER+0.

◆ EOnUser1()

void IEntity.EOnUser1 ( IEntity  other,
int  extra 
)
protected

EntityEvent.EV_USER+1.

◆ EOnUser2()

void IEntity.EOnUser2 ( IEntity  other,
int  extra 
)
protected

EntityEvent.EV_USER+2.

◆ EOnUser3()

void IEntity.EOnUser3 ( IEntity  other,
int  extra 
)
protected

EntityEvent.EV_USER+3.

◆ EOnUser4()

void IEntity.EOnUser4 ( IEntity  other,
int  extra 
)
protected

EntityEvent.EV_USER+4.

◆ EOnVisible()

void IEntity.EOnVisible ( IEntity  owner,
int  frameNumber 
)
protected

Event when we are visible.

Parameters
ownerThe owner entity
frameNumberFrame number

◆ FindComponent()

proto external Managed IEntity.FindComponent ( TypeName  typeName)

Finds first occurance of the coresponding component.

Parameters
typeNametype of the component

◆ FindComponentData()

proto external EntityComponentPrefabData IEntity.FindComponentData ( TypeName  typeName)

◆ FindComponents()

proto external int IEntity.FindComponents ( TypeName  typeName,
notnull array< Managed outComponents 
)

Finds all occurances of the coresponding component.

Parameters
typeNametype of the component
outComponentsarray to fill with selected components

◆ GetAngles()

proto external vector IEntity.GetAngles ( )

Same as GetYawPitchRoll(), but returns rotation vector around X, Y and Z axis.

◆ GetAnimation()

proto external Animation IEntity.GetAnimation ( )

◆ GetBoneIndex()

proto external TNodeId IEntity.GetBoneIndex ( string  boneName)

◆ GetBoneLocalMatrix()

proto external bool IEntity.GetBoneLocalMatrix ( TNodeId  bone,
out vector  mat[4] 
)

◆ GetBoneMatrix()

proto external bool IEntity.GetBoneMatrix ( TNodeId  bone,
out vector  mat[4] 
)

◆ GetBoneNames()

proto external void IEntity.GetBoneNames ( out notnull array< string boneNames)

◆ GetBounds()

proto external void IEntity.GetBounds ( out vector  mins,
out vector  maxs 
)

Returns local bounding box of model on Entity.

Man player = g_Game.GetPlayer();
vector mins, maxs;
player.GetBounds(mins, maxs );
Print( mins );
Print( maxs );
>> <0,0,0>
>> <0,0,0>
Definition: vector.c:13
Parameters
[out]minsminimum point of bounding box
[out]maxsmaximum point of bounding box

◆ GetChildren()

proto external IEntity IEntity.GetChildren ( )

Returns first child from this level of hierarchy if there is any.

Returns
Pointer to child entity, or nullptr

◆ GetEventMask()

proto external EntityEvent IEntity.GetEventMask ( )

Returns current event mask.

Man player = g_Game.GetPlayer();
Print( player.GetEventMask() );
>> 0
Returns
current event mask

◆ GetFlags()

proto external EntityFlags IEntity.GetFlags ( )

Returns Entity flags.

Man player = g_Game.GetPlayer();
Print( player.GetFlags() );
>> 1610612745
Returns
Entity flags

◆ GetID()

proto external EntityID IEntity.GetID ( )

Return unique entity ID.

ItemBase apple = g_Game.CreateObject( "FruitApple", String2Vector("0 10 0"), false );
Print( apple.GetID() );
>> 0

◆ GetLocalAngles()

proto external vector IEntity.GetLocalAngles ( )

Same as GetLocalYawPitchRoll(), but returns rotation vector around X, Y and Z axis.

◆ GetLocalTransform()

proto external void IEntity.GetLocalTransform ( out vector  mat[])

◆ GetLocalTransformAxis()

proto external vector IEntity.GetLocalTransformAxis ( int  axis)

◆ GetLocalYawPitchRoll()

proto external vector IEntity.GetLocalYawPitchRoll ( )

Returns local orientation when it's in hierarchy (Yaw, Pitch, Roll).

Man player = g_Game.GetPlayer();
Print( player.GetLocalYawPitchRoll() );
>> <180,-57.2585,180>
Returns
local orientation

◆ GetName()

proto external string IEntity.GetName ( )

◆ GetOrigin()

proto external vector IEntity.GetOrigin ( )

Returns origin of Entity.

Man player = g_Game.GetPlayer();
Print( player.GetOrigin() );
>> <2577.02,15.6837,2924.27>
Returns
entity origin

◆ GetParent()

proto external IEntity IEntity.GetParent ( )

Returns parent of this entity (entity on upper level of hierarchy).

Returns
Pointer to parent entity, or nullptr, when we are not child.

◆ GetParticles()

proto external Particles IEntity.GetParticles ( )

◆ GetPhysics()

proto external Physics IEntity.GetPhysics ( )

◆ GetPivot()

proto external TNodeId IEntity.GetPivot ( )

Returns pivot ID from hierarchy component.

◆ GetPrefabData()

proto external EntityPrefabData IEntity.GetPrefabData ( )

◆ GetRootParent()

proto external IEntity IEntity.GetRootParent ( )

Returns top-parent of this entity.

Returns
Pointer to root entity, or self, when we are not child.

◆ GetScale()

proto external float IEntity.GetScale ( )

◆ GetSibling()

proto external IEntity IEntity.GetSibling ( )

Returns next sibling of this entity (next entity on this level of hierarchy).

Returns
Pointer to sibling entity, or nullptr

◆ GetTransform()

proto external void IEntity.GetTransform ( out vector  mat[])

Returns world transformation of Entity.

It returns only as many vectors as is array length.

Man player = g_Game.GetPlayer();
vector mat[4];
player.GetTransform(mat);
Print( mat );
>> <0.989879,-0,0.141916>,<0,1,0>,<-0.141916,0,0.989879>,<2545.08,15.6754,2867.49>
Parameters
matvector[1...4] matrix to be get

◆ GetTransformAxis()

proto external vector IEntity.GetTransformAxis ( int  axis)

◆ GetVObject()

proto external VObject IEntity.GetVObject ( )

Returns visual object set to this Entity. No reference is added.

◆ GetWorld()

proto external BaseWorld IEntity.GetWorld ( )

◆ GetWorldBounds()

proto external void IEntity.GetWorldBounds ( out vector  mins,
out vector  maxs 
)

Returns quantized world-bound-box of Entity.

Man player = g_Game.GetPlayer();
vector mins, maxs;
player.GetWorldBounds( mins, maxs );
Print( mins );
Print( maxs );
>> <2547.2,15.5478,2852.85>
>> <2548.8,17.5478,2855.05>
Parameters
[out]minsminimum point of bounding box
[out]maxsmaximum point of bounding box

◆ GetWorldTransform()

proto external void IEntity.GetWorldTransform ( out vector  mat[])

◆ GetWorldTransformAxis()

proto external vector IEntity.GetWorldTransformAxis ( int  axis)

◆ GetYawPitchRoll()

proto external vector IEntity.GetYawPitchRoll ( )

Returns orientation of Entity in world space (Yaw, Pitch, Roll).

Man player = g_Game.GetPlayer();
Print( player.GetYawPitchRoll() );
>> <180,-76.5987,180>
Returns
entity orientation

◆ IsDeleted()

proto external bool IEntity.IsDeleted ( )
Returns
true if entity was deleted (entity pointer valid until the end of the frame).

◆ IsLoaded()

proto external bool IEntity.IsLoaded ( )
Returns
true when entity is loaded from map, false when dynamically spawned.

◆ IsRemoved()

proto external bool IEntity.IsRemoved ( )
Returns
true if entity is ready to be deleted.

◆ RemoveChild()

proto external void IEntity.RemoveChild ( notnull IEntity  child,
bool  keepTransform = false 
)

Remove Entity from hierarchy.

◆ SendEvent()

proto external volatile void IEntity.SendEvent ( notnull IEntity  actor,
EntityEvent  e,
void  extra 
)

Dynamic event invocation. Parameters are the same as in IEntity::EOnXXXX() methods.

◆ SetAngles()

proto external void IEntity.SetAngles ( vector  angles)

Same as SetYawPitchRoll(), but sets rotation around X, Y and Z axis.

◆ SetBone()

proto external void IEntity.SetBone ( TNodeId  bone,
vector  angles,
vector  trans,
float  scale 
)

◆ SetBoneMatrix()

proto external bool IEntity.SetBoneMatrix ( TNodeId  bone,
vector  mat[4] 
)

◆ SetCameraMask()

proto external int IEntity.SetCameraMask ( int  mask)

Sets visibility mask for cameras, where Entity will be rendered.

◆ SetEventMask()

proto external EntityEvent IEntity.SetEventMask ( EntityEvent  e)

Sets event mask.

Man player = g_Game.GetPlayer();
Print( player.GetEventMask() );
player.SetEventMask( EntityEvent.VISIBLE );
Print( player.GetEventMask() );
>> 0
>> 128
Parameters
eCombined mask of one or more members of EntityEvent enum

◆ SetFixedLOD()

proto external void IEntity.SetFixedLOD ( int  lod)

Set fixed LOD. Use -1 for non-fixed LOD.

◆ SetFlags()

proto external EntityFlags IEntity.SetFlags ( EntityFlags  flags,
bool  recursively = false 
)

Sets Entity flags.

It's OR operation, not rewrite. Returns previous flags.

Man player = g_Game.GetPlayer();
player.SetFlags(EntityFlags.VISIBLE|EntityFlags.TRACEABLE );
Print( player.GetFlags() );
>> 1610612747
Parameters
flagsFlags to be set
recursivelyFlags will be recursively applied to children of hierarchy too
Returns
previous flags

◆ SetLocalTransform()

proto external bool IEntity.SetLocalTransform ( vector  mat[4])

See IEntity::SetTransform. Returns false, if there is no change in transformation.

◆ SetName()

proto external void IEntity.SetName ( string  name)

◆ SetObject()

proto external void IEntity.SetObject ( VObject  object,
string  options 
)

Sets the visual object to this entity.

Reference is added and released upon entity destruction.

Parameters
objectHandle to object got by GetObject().
optionsString, dependent on object type. The only one supported for XOB objects: "$remap 'original material name' 'new material'; [$remap 'another original material name' 'another new material']"

◆ SetOrigin()

proto external void IEntity.SetOrigin ( vector  orig)

Sets origin for entity.

Man player = g_Game.GetPlayer();
player.SetOrigin("2550 10 2900" );
Print( player.GetOrigin() );
>> <2550,10,2900>
Parameters
origorigin to be set

◆ SetScale()

proto external void IEntity.SetScale ( float  scale)

◆ SetTransform()

proto external bool IEntity.SetTransform ( vector  mat[4])

Sets entity world transformation.

vector mat[4];
Math3D.MatrixIdentity( mat )
Man player = g_Game.GetPlayer();
player.SetTransform( mat );
vector outmat[4];
player.GetTransform(outmat );
Print( outmat );
>> <1,0,0>,<0,1,0>,<0,0,1>,<0,0,0>
Definition: Math3D.c:13
Parameters
matmatrix to be set

◆ SetVComponentFlags()

proto external int IEntity.SetVComponentFlags ( VCFlags  flags)

Sets component flags.

◆ SetWorldTransform()

proto external bool IEntity.SetWorldTransform ( vector  mat[4])

See IEntity::SetTransform. Returns false, if there is no change in transformation.

◆ SetYawPitchRoll()

proto external void IEntity.SetYawPitchRoll ( vector  angles)

Sets angles for entity (Yaw, Pitch, Roll).

Man player = g_Game.GetPlayer();
player.SetYawPitchRoll("180 50 180" );
Print( player.GetYawPitchRoll() );
>> <-180,50,-180>
Parameters
anglesangles to be set

◆ Update()

proto external int IEntity.Update ( )

Updates entity state/position.

Should be called when you want to manually commit position changes etc before trace methods etc. Entity is updated automatically at the end and the beginning of simulation step, when it has EntityFlags.TFL_ACTIVE flag set.

Returns
Mask with flags:
  • EntityFlags.UPDATE - hierarchy has been updated
  • EntityFlags.UPDATE_MDL - model hierarchy has been updated

◆ VectorToLocal()

proto external vector IEntity.VectorToLocal ( vector  vec)

Transforms world space vector to local space.

Man player = g_Game.GetPlayer();
Print( player.VectorToLocal("2 1 5") );
>> <-0.166849,1,5.38258>
Parameters
vecworld space vector to transform
Returns
local space vector

◆ VectorToParent()

proto external vector IEntity.VectorToParent ( vector  vec)

Transforms local vector to parent(world) space.

Man player = g_Game.GetPlayer();
Print( player.VectorToParent("1 2 3") );
>> <2.89791,2,1.26575>
Parameters
veclocal space vector to transform
Returns
parent space vector

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