Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
enworld.c
Go to the documentation of this file.
1 
6 //----------------------------------------------
12 typedef int[] WorldHandle;
13 
14 proto native float GetWorldTime();
15 
19 proto native WorldHandle SetCurrentWorld(WorldHandle world);
20 
21 //proto native void SchedulePreload(vector pos, float radius);
22 
23 proto native IEntity FindEntityByName(IEntity worldEnt, string name);
24 proto native IEntity FindEntityByID(IEntity worldEnt, int ID);
25 
27 proto native int GetNumActiveEntities(IEntity worldEntity);
29 proto native IEntity GetActiveEntity(IEntity worldEntity, int index);
31 
32 //----------------------------------------------
39 {
42 };
43 
45 proto native void SetListenerCamera(int camera);
46 
53 proto native void SetCamera(int cam, vector origin, vector angle);
54 
56 proto native void SetCameraEx(int cam, const vector mat[4]);
57 
59 proto native void GetCamera(int cam, out vector mat[4]);
60 
61 proto native void SetCameraVerticalFOV(int cam, float fovy);
62 proto native void SetCameraFarPlane(int cam, float farplane); //default 160000 units
63 proto native void SetCameraNearPlane(int cam, float nearplane); //default 5 units
64 
65 proto native void SetCameraType(int cam, CameraType type);
66 
72 {
91  Median,//unused?
94  SSR //not available
95 };
104 proto native void SetCameraPostProcessEffect(int cam, int priority, PostProcessEffectType type, string materialPath);
105 
106 //ent can be NULL for world-space coords
107 proto vector ProjectVector(int cam, IEntity ent, vector vec);
108 proto vector UnprojectVector(int cam, float x, float y, vector dir);
109 
111 
112 //----------------------------------------------
118 typedef int[] HLIGHT;
120 
122 {
123  POINT, //< point light, all directional light
124  SPOT, //< spot light, direction is determined by owner (entity)
127 };
128 
130 {
140 };
141 
145 proto HLIGHT AddLight(IEntity owner, LightType type, LightFlags flags, float radius, vector color);
147 proto native bool RemoveLight(HLIGHT light);
148 proto native bool SetLightEx(HLIGHT light, float radius, vector color);
150 proto native bool SetLightTexture(HLIGHT light, string cubemap);
151 proto native int SetLightFlags(HLIGHT light, LightFlags flags);
152 proto native int ClearLightFlags(HLIGHT light, LightFlags flags);
154 proto native bool SetLightCone(HLIGHT light, float cone);
155 
159 proto native float GetSceneHDRMul(int camera);
161 
162 
163 
164 //----------------------------------------------
171 {
172  BONES, //< tests collision geometries around bones of animated objects
173  ENTS, //< tests entities
174  WORLD, //< tests world bounding box
176  WATER, //< tests collision with water surface
177  PASSTRANSLUCENT,//< Do not intersects with entities with EntityFlags.TRANSLUCENT set
178  RAGDOLLS, //< tests ragdolls
179  VISTEST, //< performs visibility test first. Not necessary for entities receiving EntityEvent.VISIBLE, because there is a certainty that a camera will see them
182 };
183 
185 {
190 };
191 
195 {
196  float Fraction;
197  int Content;
198  int Surfparm;
199  int MaterialFlags;
200  int Triangle;
201  int SurfaceID;
202  owned string MaterialName;
203  owned string OriginalMaterialName;
204  float Plane[4];
205  vector Point;
206 }
207 
208 proto native bool TraceLineToEntity(IEntity ent, vector start, vector end, out TraceContact contact);
209 
210 //bool FilterCallback(Class target [, vector rayorigin, vector raydirection])
211 
213 {
214  vector Start;
215  vector End;
216  int LayerMask = 0xffffffff;
217  TraceFlags Flags;
218  IEntity Exclude;
219 
220 };
221 
223 {
224  float Radius;
225 };
226 
228 {
229  vector Mins;
230  vector Maxs;
231 };
232 
234 {
235  vector Mat[3];
236 };
237 
248 proto volatile float TraceMove(TraceParam param, out IEntity cent, out float plane[4], out int surfparm, func filtercallback);
249 
250 
262 proto native int P2PVisibilityEx(vector from, vector to,int flags);
263 
265 proto int SphereQuery(vector origin, float radius, out IEntity visents[], int ents, int fmask);
266 
271 proto native bool IsBoxVisible(vector mins, vector maxs, int flags);
272 
282 proto int VisEntities(vector origin, vector look, float angle, float radius, out IEntity ents[2], int maxents, int fmask);
283 
288 {
289  proto private void ~OcclusionQuery();
290 
297  proto native int GetResult();
298 
300  proto native void SetPosition(vector pos);
302  proto native void Destroy();
303 };
304 
306 
307 //----------------------------------------------
312 typedef int[] hDecal;
313 
326 proto native hDecal CreateDecal(IEntity entity, vector origin, vector project, float nearclip, float angle, float size, string materialName, float lifetime, int flags);
327 
328 proto native void RemoveDecal(hDecal decal);
329 
342 proto native hDecal CreateLandMarkDecal(IEntity entity, vector origin, vector normal, float edgeSize, float lifeTime, string materialName, hDecal prevDecal, float alpha);
343 
344 
357 proto native int CanAddToLandMarkDecal(hDecal lmDecal, IEntity entity, string mat, vector newPoint);
358 
368 proto native bool AddPointToLandMarkDecal(hDecal lmDecal, vector point, vector normal, float alpha);
369 
377 proto native void FinalizeLandMarkDecal(hDecal lmDecal, bool addAlpha, float alphaDist);
378 
383 proto native bool IsLandMarkFinalized(hDecal lmDecal);
384 
389 proto native vector GetLastLandMarkPoint(hDecal lmDecal);
390 
397 proto native void SetGlobalLandMarkParams(float minSegmentLength, float maxSegmentLength, float degAngle);
398 
399 
401 
402 
403 //----------------------------------------------
412 proto native bool IsOcean();
413 
419 proto native float GetOceanHeight(float worldX, float worldZ);
420 
421 
427 proto native vector GetOceanHeightAndDisplace(float worldX, float worldZ);
428 
429 
430 
432 
433 
434 
436 
PostProcessEffectType
PostProcessEffectType
Post-process effect type.
Definition: enworld.c:71
FinalizeLandMarkDecal
proto native void FinalizeLandMarkDecal(hDecal lmDecal, bool addAlpha, float alphaDist)
TraceShape
TraceShape
Definition: enworld.c:184
LightType
LightType
Definition: enworld.c:121
ChromAber
@ ChromAber
Definition: enworld.c:83
CanAddToLandMarkDecal
proto native int CanAddToLandMarkDecal(hDecal lmDecal, IEntity entity, string mat, vector newPoint)
BONES
@ BONES
Definition: enworld.c:172
hDecal
int[] hDecal
Definition: enworld.c:312
CreateLandMarkDecal
proto native hDecal CreateLandMarkDecal(IEntity entity, vector origin, vector normal, float edgeSize, float lifeTime, string materialName, hDecal prevDecal, float alpha)
ColorGrading
@ ColorGrading
Definition: enworld.c:86
ONLY_PHYSICS
@ ONLY_PHYSICS
Definition: enworld.c:175
SetLightEx
proto native bool SetLightEx(HLIGHT light, float radius, vector color)
LightFlags
LightFlags
Definition: enworld.c:129
HLIGHT
int[] HLIGHT
Light handle.
Definition: enworld.c:119
ENTS
@ ENTS
Definition: enworld.c:173
ProjectVector
proto vector ProjectVector(int cam, IEntity ent, vector vec)
BOX
@ BOX
Definition: enworld.c:187
FindEntityByName
proto native IEntity FindEntityByName(IEntity worldEnt, string name)
SetLightTexture
proto native bool SetLightTexture(HLIGHT light, string cubemap)
sets lookup texture for projection lights
PASSTRANSLUCENT
@ PASSTRANSLUCENT
Definition: enworld.c:177
SetLightFlags
proto native int SetLightFlags(HLIGHT light, LightFlags flags)
P2PVisibilityEx
proto native int P2PVisibilityEx(vector from, vector to, int flags)
CreateDecal
proto native hDecal CreateDecal(IEntity entity, vector origin, vector project, float nearclip, float angle, float size, string materialName, float lifetime, int flags)
VisEntities
proto int VisEntities(vector origin, vector look, float angle, float radius, out IEntity ents[2], int maxents, int fmask)
y
Icon y
RAGDOLLS
@ RAGDOLLS
Definition: enworld.c:178
Managed
TODO doc.
Definition: enscript.c:117
SetCamera
proto native void SetCamera(int cam, vector origin, vector angle)
TraceParam
Definition: enworld.c:212
LINE
@ LINE
Definition: enworld.c:186
GetSceneHDRMul
proto native float GetSceneHDRMul(int camera)
TraceBox
Definition: enworld.c:227
UnprojectVector
proto vector UnprojectVector(int cam, float x, float y, vector dir)
OBB
@ OBB
Definition: enworld.c:188
CHEAP
@ CHEAP
for cheaper dynamic lights, like muzzle flashes (might use cheaper rendering method)
Definition: enworld.c:139
FindEntityByID
proto native IEntity FindEntityByID(IEntity worldEnt, int ID)
func
Definition: enconvert.c:10
SetCameraVerticalFOV
proto native void SetCameraVerticalFOV(int cam, float fovy)
HBAO
@ HBAO
Definition: enworld.c:77
GetNumActiveEntities
proto native int GetNumActiveEntities(IEntity worldEntity)
returns number of active (simulated) Entities in the world
Median
@ Median
Definition: enworld.c:91
IEntity
Definition: enentity.c:164
GetWorldTime
proto native float GetWorldTime()
DIRECTIONAL
@ DIRECTIONAL
Definition: enworld.c:125
VISTEST
@ VISTEST
Definition: enworld.c:179
PERSPECTIVE
@ PERSPECTIVE
Definition: enworld.c:40
SetCurrentWorld
proto native WorldHandle SetCurrentWorld(WorldHandle world)
UnderWater
@ UnderWater
Definition: enworld.c:74
NOTRACE
@ NOTRACE
Definition: enworld.c:180
ORTHOGRAPHIC
@ ORTHOGRAPHIC
Definition: enworld.c:41
GetCamera
proto native void GetCamera(int cam, out vector mat[4])
Returns current camera transformation.
ClearLightFlags
proto native int ClearLightFlags(HLIGHT light, LightFlags flags)
vector
Definition: enconvert.c:105
Rain
@ Rain
Definition: enworld.c:80
RadialBlur
@ RadialBlur
Definition: enworld.c:82
DepthOfField
@ DepthOfField
Definition: enworld.c:76
SSR
@ SSR
Definition: enworld.c:94
GetOceanHeight
proto native float GetOceanHeight(float worldX, float worldZ)
AddPointToLandMarkDecal
proto native bool AddPointToLandMarkDecal(hDecal lmDecal, vector point, vector normal, float alpha)
POINT
@ POINT
Definition: enworld.c:123
GetLastLandMarkPoint
proto native vector GetLastLandMarkPoint(hDecal lmDecal)
GetOceanHeightAndDisplace
proto native vector GetOceanHeightAndDisplace(float worldX, float worldZ)
SMAA
@ SMAA
Definition: enworld.c:89
TRANSPARENT_OCCLUDERS
@ TRANSPARENT_OCCLUDERS
Definition: enworld.c:181
RemoveLight
proto native bool RemoveLight(HLIGHT light)
removes light
AMBIENT
@ AMBIENT
Definition: enworld.c:126
TraceMove
proto volatile float TraceMove(TraceParam param, out IEntity cent, out float plane[4], out int surfparm, func filtercallback)
IsOcean
proto native bool IsOcean()
SPOT
@ SPOT
Definition: enworld.c:124
WORLD
@ WORLD
Definition: enworld.c:174
SetCameraFarPlane
proto native void SetCameraFarPlane(int cam, float farplane)
SetCameraPostProcessEffect
proto native void SetCameraPostProcessEffect(int cam, int priority, PostProcessEffectType type, string materialPath)
DYNAMIC
@ DYNAMIC
Dynamic objects are included in the query.
Definition: enworld.c:136
TraceLineToEntity
TraceParam TraceLineToEntity
SPHERE
@ SPHERE
Definition: enworld.c:189
AddLight
proto HLIGHT AddLight(IEntity owner, LightType type, LightFlags flags, float radius, vector color)
GetActiveEntity
proto native IEntity GetActiveEntity(IEntity worldEntity, int index)
returns active entity
TraceContact
collision and tracing WARNING: Non-managed, needs manual delete call, should not be ref'd
Definition: enworld.c:194
TraceOBB
Definition: enworld.c:233
name
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
x
Icon x
SSAO
@ SSAO
Definition: enworld.c:75
SunMask
@ SunMask
Definition: enworld.c:92
SetCameraType
proto native void SetCameraType(int cam, CameraType type)
TraceFlags
TraceFlags
Definition: enworld.c:170
WorldHandle
int[] WorldHandle
Definition: enworld.c:12
SetCameraEx
proto native void SetCameraEx(int cam, const vector mat[4])
Changes camera matrix.
IsBoxVisible
proto native bool IsBoxVisible(vector mins, vector maxs, int flags)
FXAA
@ FXAA
Definition: enworld.c:90
CASTSHADOW
@ CASTSHADOW
Definition: enworld.c:137
GodRays
@ GodRays
Definition: enworld.c:79
GaussFilter
@ GaussFilter
Definition: enworld.c:93
IsLandMarkFinalized
proto native bool IsLandMarkFinalized(hDecal lmDecal)
SetListenerCamera
proto native void SetListenerCamera(int camera)
sets which camera will be a listener (for sound engine)
CameraType
CameraType
Definition: enworld.c:38
SetGlobalLandMarkParams
proto native void SetGlobalLandMarkParams(float minSegmentLength, float maxSegmentLength, float degAngle)
TraceSphere
Definition: enworld.c:222
RotBlur
@ RotBlur
Definition: enworld.c:78
RemoveDecal
proto native void RemoveDecal(hDecal decal)
FilmGrain
@ FilmGrain
Definition: enworld.c:81
OcclusionQuery
Definition: enworld.c:287
DynamicBlur
@ DynamicBlur
Definition: enworld.c:85
Glow
@ Glow
Definition: enworld.c:88
WATER
@ WATER
Definition: enworld.c:176
WetDistort
@ WetDistort
Definition: enworld.c:84
Colors
@ Colors
Definition: enworld.c:87
None
@ None
Definition: enworld.c:73
SphereQuery
proto int SphereQuery(vector origin, float radius, out IEntity visents[], int ents, int fmask)
finds all entities in a radius
SetCameraNearPlane
proto native void SetCameraNearPlane(int cam, float nearplane)
SetLightCone
proto native bool SetLightCone(HLIGHT light, float cone)
Sets light cone in degrees (for LightType.SPOT).