Dayz Explorer 1.28.160049
Loading...
Searching...
No Matches
enentity.c
Go to the documentation of this file.
1typedef int[] BaseContainer;
2typedef int[] IEntitySource;
3typedef int[] WidgetSource;
4
6{
7 proto native owned string GetClassName();
8 proto native owned string GetName();
9 proto native int VarIndex(string varName);
10 proto native bool IsVariableSet(int varIndex);
11 proto bool IsType(int varIndex, typename type);
12 proto bool Get(int varIndex, out void val);
13};
14
16{
17 proto native IEntitySource GetChildren();
18 proto native IEntitySource GetSibling();
19 proto native IEntitySource GetParent();
20};
21
23{
24 proto native WidgetSource GetChildren();
25 proto native WidgetSource GetSibling();
26 proto native WidgetSource GetParent();
27};
28
42
45{
48
56
63
70
76
82
83//Only with MeshObject
84//ANIMEND - End of AF_ONCE animation, extra = slot number 0...11
85//ANIMBLEND - Animation blended from previous one, extra = slot number 0...11
86
87
88//SOUNDEND - playing of SFL_ONCE sound has ended
89// extra = pointer to a sound handle
90
91//USER
92
103
108
110 ALL
112
160
165{
166//DO NOT INSERT ANYTHING BELOW - order of event methods matters!
171 event protected void EOnTouch(IEntity other, int extra)
172 {
173 }
174 event protected void EOnInit(IEntity other, int extra)
175 {
176 }
177 event protected void EOnExtra(IEntity other, int extra)
178 {
179 }
180 event protected void EOnNotVisible(IEntity other, int extra)
181 {
182 }
183 event protected void EOnFrame(IEntity other, float timeSlice)
184 {
185 }
186 event protected int EOnVisible(IEntity other, int extra)
187 {
188 }
189 event protected void EOnPostFrame(IEntity other, int extra)
190 {
191 }
192 event protected void EOnWorldProcess(IEntity other, int extra)
193 {
194 }
195 event protected void EOnAnimEvent(IEntity other, AnimEvent extra)
196 {
197 }
198 event protected void EOnSoundEvent(IEntity other, SoundEvent extra)
199 {
200 }
201 event protected void EOnSimulate(IEntity other, float dt)
202 {
203 }
204 event protected void EOnPostSimulate(IEntity other, float timeSlice)
205 {
206 }
207 event protected void EOnJointBreak(IEntity other, int extra)
208 {
209 }
210 event protected void EOnPhysicsMove(IEntity other, int extra)
211 {
212 }
213 event protected void EOnContact(IEntity other, Contact extra)
214 {
215 }
216 protected void EOnUser0(IEntity other, int extra)
217 {
218 }
219 protected void EOnUser1(IEntity other, int extra)
220 {
221 }
222 event protected void EOnEnter(IEntity other, int extra)
223 {
224 }
225 event protected void EOnLeave(IEntity other, int extra)
226 {
227 }
228 protected void EOnUser4(IEntity other, int extra)
229 {
230 }
231 protected void EOnDummy020(IEntity other, int extra)
232 {
233 }
234 protected void EOnDummy021(IEntity other, int extra)
235 {
236 }
237 protected void EOnDummy022(IEntity other, int extra)
238 {
239 }
240 protected void EOnDummy023(IEntity other, int extra)
241 {
242 }
243 protected void EOnDummy024(IEntity other, int extra)
244 {
245 }
246 protected void EOnDummy025(IEntity other, int extra)
247 {
248 }
249 protected void EOnDummy026(IEntity other, int extra)
250 {
251 }
252 protected void EOnDummy027(IEntity other, int extra)
253 {
254 }
255 protected void EOnDummy028(IEntity other, int extra)
256 {
257 }
258 protected void EOnDummy029(IEntity other, int extra)
259 {
260 }
261 protected void EOnDummy030(IEntity other, int extra)
262 {
263 }
264 protected void EOnDummy031(IEntity other, int extra)
265 {
266 }
268//DO NOT INSERT ANYTHING ABOVE - order of event methods matters!
269
274
288 proto external void GetTransform(out vector mat[]);
289
303 proto external void GetRenderTransform(out vector mat[]);
304
318 proto external void GetLocalTransform(out vector mat[]);
319
337 proto native external vector GetTransformAxis(int axis);
338
356 proto native external void SetTransform(vector mat[4]);
357
368 proto native external vector GetOrigin();
369
380 proto external vector GetLocalPosition();
381
392 proto native external vector GetYawPitchRoll();
393
397 proto native external vector GetAngles();
398
409 proto native external vector GetLocalYawPitchRoll();
410
414 proto native external vector GetLocalAngles();
415
427 proto native external void SetYawPitchRoll(vector angles);
428
432 proto native external void SetAngles(vector angles);
433
445 proto native external void SetOrigin(vector orig);
446
447 proto native external float GetScale();
448 proto native external void SetScale(float scale);
460 proto native external vector VectorToParent(vector vec);
461
473 proto native external vector CoordToParent(vector coord);
474
486 proto native external vector VectorToLocal(vector vec);
487
499 proto native external vector CoordToLocal(vector coord);
500
502
503
507
518 proto native int GetID();
519
531 proto native void SetID(int id);
532
533 proto native void SetName(string name);
534 proto native external owned string GetName();
536
537
542
551 proto native external bool AddChild(notnull IEntity child, int pivot, bool positionOnly = false);
552
560 proto native external bool RemoveChild(notnull IEntity child, bool keepTransform = false);
561
562 proto native external Physics GetPhysics();
563
565 proto native bool IsHierarchyPositionOnly();
566
568 proto native int GetHierarchyPivot();
569
571 proto native IEntity GetParent();
573 proto native IEntity GetChildren();
575 proto native IEntity GetSibling();
577
595 proto external void GetBounds(out vector mins, out vector maxs);
596
614 proto external void GetWorldBounds(out vector mins, out vector maxs);
615
630 proto native external EntityFlags GetFlags();
631
643 proto native external bool IsFlagSet(EntityFlags flags);
644
658 proto native external EntityFlags SetFlags(EntityFlags flags, bool recursively);
659
673 proto native external EntityFlags ClearFlags(EntityFlags flags, bool recursively);
674
675
686 proto native external EntityEvent GetEventMask();
687
701 proto native external EntityEvent SetEventMask(EntityEvent e );
702
718 proto native external EntityEvent ClearEventMask(EntityEvent e);
719
721 proto external volatile void SendEvent(notnull IEntity actor, EntityEvent e, void extra);
722
724
729
737 proto native external void SetObject(vobject object, string options);
738
742 proto native vobject GetVObject();
743
745 proto native external int Animate(float speed, int loop);
747 proto native external int AnimateEx(float speed, int loop, out vector lin, out vector ang);
748
750 proto native external int SetCameraMask(int mask);
752
756 proto native external void FilterNextTrace();
757
766 proto native external int Update();
767
768#ifdef COMPONENT_SYSTEM
770 protected void IEntity(IEntitySource src, IEntity parent);
771#endif
772};
773
774#ifdef ENF_DONE
775// Set fixed LOD. -1 for non-fixed LOD
776proto native void SetFixedLOD(IEntity ent, int lod);
777//Sets the texture that can be referenced from material as $renderview
778//and connects it with camera cam_index. Size iz recommended size of
779//rendertarget (0 is default)
780proto native void SetRenderView(IEntity ent, int cam_index, int width, int height);
781proto void GetRenderView(IEntity ent, out int cam_index, out int width, out int height);
782#endif
783
784
791{
792 string m_Key;
793 string m_Value;
794 string m_Desc;
795
796 void ParamEnum(string key, string value, string desc = "")
797 {
798 m_Key = key;
799 m_Value = value;
800 m_Desc = desc;
801 }
802}
803
804class ParamEnumArray: array<ref ParamEnum>
805{
806 static ParamEnumArray FromEnum(typename e)
808 ParamEnumArray params = new ParamEnumArray();
809 int cnt = e.GetVariableCount();
810 int val;
812 for (int i = 0; i < cnt; i++)
813 {
814 if (e.GetVariableType(i) == int && e.GetVariableValue(NULL, i, val))
815 {
816 params.Insert(new ParamEnum(e.GetVariableName(i), val.ToString()));
817 }
818 }
819
820 return params;
821 }
822}
823
824// -------------------------------------------------------------------------
826{
827 string m_DefValue;
828 string m_UiWidget;
829 string m_RangeScale;
830 string m_Desc;
831 ref ParamEnumArray m_Enums;
832
833 void Attribute(string defvalue, string uiwidget, string desc = "", string rangescale = "", ParamEnumArray enums = NULL)
834 {
835 m_DefValue = defvalue;
836 m_UiWidget = uiwidget;
837 m_RangeScale = rangescale;
838 m_Desc = desc;
839 m_Enums = enums;
840 }
841}
842
843class EditorAttribute
844{
845 string m_Style;
846 string m_Category;
850 string m_Color;
851 string m_Color2;
855
856 void EditorAttribute(string style, string category, string description, vector sizeMin, vector sizeMax, string color, string color2 = "0 0 0 0", bool visible = true, bool insertable = true, bool dynamicBox = false)
857 {
858 m_Style = style;
859 m_Category = category;
860 m_Description = description;
861 m_SizeMin = sizeMin;
862 m_SizeMax = sizeMax;
863 m_Color = color;
864 m_Color2 = color2;
865 m_Visible = visible;
866 m_Insertable = insertable;
867 m_DynamicBox = dynamicBox;
868 }
869}
871
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
TODO doc.
Definition enscript.c:118
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
int[] BaseContainer
Definition enentity.c:1
int[] IEntitySource
Definition enentity.c:2
int[] WidgetSource
Definition enentity.c:3
void EOnWorldProcess(IEntity other, int extra)
EntityEvent.WORLDPROCESS.
Definition enentity.c:192
void EOnDummy022(IEntity other, int extra)
Placeholder.
Definition enentity.c:237
void EOnExtra(IEntity other, int extra)
EntityEvent.EXTRA.
Definition enentity.c:177
void ParamEnum(string key, string value, string desc="")
Definition enentity.c:811
proto native vobject GetVObject()
Returns visual object set to this Entity. No reference is added.
void EOnDummy031(IEntity other, int extra)
Placeholder.
Definition enentity.c:264
class Attribute m_Style
can be "box", "sphere", "cylinder", "pyramid", "diamond" or custom style name
proto native external int AnimateEx(float speed, int loop, out vector lin, out vector ang)
Updates animation (either xob, or particle, whatever)
proto native external void SetAngles(vector angles)
Same as SetYawPitchRoll, but sets rotation around X, Y and Z axis.
proto native external void SetTransform(vector mat[4])
Sets entity transformation.
proto native void SetID(int id)
Set unique entity ID.
void EOnDummy026(IEntity other, int extra)
Placeholder.
Definition enentity.c:249
void EOnUser4(IEntity other, int extra)
EntityEvent.EV_USER+4.
Definition enentity.c:228
string m_Key
Definition enentity.c:807
void EOnSimulate(IEntity other, float dt)
EntityEvent.SIMULATE.
Definition enentity.c:201
void EOnDummy023(IEntity other, int extra)
Placeholder.
Definition enentity.c:240
proto native external EntityFlags SetFlags(EntityFlags flags, bool recursively)
Sets Entity flags. It's OR operation, not rewrite. Returns previous flags.
proto native external vector VectorToLocal(vector vec)
Transforms world space vector to local space.
proto native external void SetYawPitchRoll(vector angles)
Sets angles for entity (Yaw, Pitch, Roll)
proto native external void SetOrigin(vector orig)
Sets origin for entity.
string m_Category
folder structure eg. StaticEntities/Walls
Definition enentity.c:846
proto native external vector GetTransformAxis(int axis)
Returns one row of Entity transformation matrix.
int EOnVisible(IEntity other, int extra)
EntityEvent.VISIBLE.
Definition enentity.c:186
bool m_Insertable
Definition enentity.c:853
void EOnUser1(IEntity other, int extra)
EntityEvent.EV_USER+1.
Definition enentity.c:219
proto external void GetBounds(out vector mins, out vector maxs)
Returns local bounding box of model on Entity.
proto native external int Animate(float speed, int loop)
Updates animation (either xob, or particle, whatever)
proto native external vector GetLocalYawPitchRoll()
Returns local orientation when it's in hierarchy (Yaw, Pitch, Roll)
proto native int GetHierarchyPivot()
Returns the hierarchy component pivot.
void EOnUser0(IEntity other, int extra)
EntityEvent.EV_USER+0.
Definition enentity.c:216
void EOnContact(IEntity other, Contact extra)
EntityEvent.CONTACT.
Definition enentity.c:213
void EOnFrame(IEntity other, float timeSlice)
EntityEvent.FRAME.
Definition enentity.c:183
proto native external EntityEvent ClearEventMask(EntityEvent e)
Clears event mask.
proto native external vector GetAngles()
Same as GetYawPitchRoll, but returns rotation vector around X, Y and Z axis.
proto native external int SetCameraMask(int mask)
Sets visibility mask for cameras, where Entity will be rendered.
proto native external EntityEvent SetEventMask(EntityEvent e)
Sets event mask.
proto external volatile void SendEvent(notnull IEntity actor, EntityEvent e, void extra)
Dynamic event invokation. Parameters are the same as in IEntity::EOnXXXX() methods.
bool m_Visible
Definition enentity.c:852
proto native external owned string GetName()
proto native external vector GetYawPitchRoll()
Returns orientation of Entity in world space (Yaw, Pitch, Roll)
void EOnDummy024(IEntity other, int extra)
Placeholder.
Definition enentity.c:243
proto native int GetID()
Return unique entity ID.
void EOnSoundEvent(IEntity other, SoundEvent extra)
EntityEvent.SOUNDEVENT.
Definition enentity.c:198
void EOnTouch(IEntity other, int extra)
EntityEvent.TOUCH.
Definition enentity.c:171
string m_Color2
Definition enentity.c:851
proto native external vector GetOrigin()
Returns origin of Entity.
void EOnDummy025(IEntity other, int extra)
Placeholder.
Definition enentity.c:246
proto native external bool AddChild(notnull IEntity child, int pivot, bool positionOnly=false)
Adds child entity to this entity.
proto native external int Update()
proto external vector GetLocalPosition()
Returns local position of Entity.
proto native external vector CoordToLocal(vector coord)
Transforms world space position to local space.
proto native IEntity GetSibling()
Returns pointer to next child Entity on the same hierarchy.
void EOnAnimEvent(IEntity other, AnimEvent extra)
EntityEvent.ANIMEVENT.
Definition enentity.c:195
proto native bool IsHierarchyPositionOnly()
Returns if the hierarchy component was created with positionOnly.
proto external void GetWorldBounds(out vector mins, out vector maxs)
Returns quantized world-bound-box of Entity.
string m_Description
class purpose description
Definition enentity.c:847
proto external void GetTransform(out vector mat[])
Returns transformation of Entity. It returns only so much vectors as array is big.
proto native external float GetScale()
proto native external bool IsFlagSet(EntityFlags flags)
Test if one or more of specified flags are set.
string m_Desc
Definition enentity.c:809
ParamEnum Managed FromEnum(typename e)
Definition enentity.c:806
proto native external vector GetLocalAngles()
Same as GetLocalYawPitchRoll, but returns rotation vector around X, Y and Z axis.
EntityEvent
Entity events for event-mask, or throwing event from code.
Definition enentity.c:45
proto native IEntity GetParent()
Returns pointer to parent Entity in hierarchy.
proto native external Physics GetPhysics()
void EOnDummy030(IEntity other, int extra)
Placeholder.
Definition enentity.c:261
proto native void SetName(string name)
void EOnDummy028(IEntity other, int extra)
Placeholder.
Definition enentity.c:255
proto native external vector CoordToParent(vector coord)
Transforms local position to world space.
proto native IEntity GetChildren()
Returns pointer to first child Entity in hierarchy.
string m_Value
Definition enentity.c:808
proto native external void SetObject(vobject object, string options)
void EOnPostSimulate(IEntity other, float timeSlice)
EntityEvent.POSTSIMULATE.
Definition enentity.c:204
void EOnPostFrame(IEntity other, int extra)
EntityEvent.POSTFRAME.
Definition enentity.c:189
proto native external void FilterNextTrace()
When called, the Entity is excluded from consequent TraceMove/TraceLine.
string m_Color
Definition enentity.c:850
proto native external void SetScale(float scale)
void EOnEnter(IEntity other, int extra)
EntityEvent.ENTER.
Definition enentity.c:222
bool m_DynamicBox
Definition enentity.c:854
EntityFlags
Entity flags.
Definition enentity.c:115
void EOnLeave(IEntity other, int extra)
EntityEvent.LEAVE.
Definition enentity.c:225
proto native external bool RemoveChild(notnull IEntity child, bool keepTransform=false)
Removes child entity from hierarchy.
void EOnInit(IEntity other, int extra)
EntityEvent.INIT.
Definition enentity.c:174
proto native external EntityFlags GetFlags()
Returns Entity flags.
void EOnJointBreak(IEntity other, int extra)
EntityEvent.JOINTBREAK.
Definition enentity.c:207
void EOnDummy020(IEntity other, int extra)
Placeholder.
Definition enentity.c:231
proto external void GetRenderTransform(out vector mat[])
Returns render transformation of Entity. Must pass in vector array size of 4.
proto native external EntityFlags ClearFlags(EntityFlags flags, bool recursively)
Clear Entity flags. Returns cleared flags.
void EOnDummy027(IEntity other, int extra)
Placeholder.
Definition enentity.c:252
void EOnDummy029(IEntity other, int extra)
Placeholder.
Definition enentity.c:258
void EOnPhysicsMove(IEntity other, int extra)
EntityEvent.PHYSICSMOVE.
Definition enentity.c:210
proto native external EntityEvent GetEventMask()
Returns current event mask.
vector m_SizeMax
max vector of a bounding box
Definition enentity.c:849
void EOnNotVisible(IEntity other, int extra)
EntityEvent.NOTVISIBLE.
Definition enentity.c:180
proto external void GetLocalTransform(out vector mat[])
Returns local transformation of Entity. It returns only so much vectors as array is big.
void EditorAttribute(string style, string category, string description, vector sizeMin, vector sizeMax, string color, string color2="0 0 0 0", bool visible=true, bool insertable=true, bool dynamicBox=false)
Definition enentity.c:856
proto native external vector VectorToParent(vector vec)
Transforms local vector to world space.
void EOnDummy021(IEntity other, int extra)
Placeholder.
Definition enentity.c:234
vector m_SizeMin
min vector of a bounding box
Definition enentity.c:848
@ PHYSICSMOVE
Definition enentity.c:96
@ INIT
Definition enentity.c:81
@ FRAME
Definition enentity.c:69
@ PHYSICSSTEADY
Definition enentity.c:101
@ POSTSIMULATE
Definition enentity.c:95
@ NOTVISIBLE
Definition enentity.c:62
@ TOUCH
entity was touched by other entity
Definition enentity.c:47
@ CONTACT
Definition enentity.c:97
@ SOUNDEVENT
Definition enentity.c:100
@ ENTER
Object entered Trigger.
Definition enentity.c:105
@ ANIMEVENT
Definition enentity.c:99
@ SIMULATE
Definition enentity.c:94
@ JOINTBREAK
Definition enentity.c:93
@ ALL
Mask of all events.
Definition enentity.c:110
@ POSTFRAME
Definition enentity.c:75
@ LEAVE
Object left Trigger.
Definition enentity.c:107
@ USER
Definition enentity.c:102
@ EXTRA
Definition enentity.c:98
@ USER6
Definition enentity.c:158
@ TRIGGER
Is not collidable, but invokes touch events.
Definition enentity.c:124
@ SOLID
Is collidable by various trace methods.
Definition enentity.c:123
@ ACTIVE
Definition enentity.c:142
@ WATER
Used by tracing methods. Traceable only with flag TraceFlags.WATER.
Definition enentity.c:136
@ USER4
Definition enentity.c:156
@ USER5
Definition enentity.c:157
@ USER1
Flags for custom usage and filterings.
Definition enentity.c:153
@ TRANSLUCENT
Definition enentity.c:133
@ USER2
Definition enentity.c:154
@ TOUCHTRIGGERS
Interacts with triggers.
Definition enentity.c:125
@ FEATURE
Scene rendering hint for dominant objects that are not culled by standard way.
Definition enentity.c:128
@ VISIBLE
Definition enentity.c:55
@ USER3
Definition enentity.c:155
@ STATIC
Static objects are included in the query.
Definition enentity.c:150
@ SYNCHRONIZATION_DIRTY
Entity wants to synchronize (network)
Definition enentity.c:126
override float Get()