DayZ 1.24
Loading...
Searching...
No Matches
Debug Shape API definition
Collaboration diagram for Debug Shape API definition:

Topics

 Diag menu API definition
 

Enumerations

enum  ShapeType {
  BBOX , LINE , SPHERE , CYLINDER ,
  DIAMOND , PYRAMID
}
 
enum  ShapeFlags {
  NOZBUFFER , NOZWRITE , WIREFRAME , TRANSP ,
  DOUBLESIDE , ONCE , NOOUTLINE , BACKFACE ,
  NOCULL , VISIBLE , ADDITIVE
}
 
enum  CollisionFlags
 

Functions

proto native void GetMatrix (out vector mat[4])
 
proto native void SetMatrix (vector mat[4])
 
proto native void SetDirection (vector direction)
 
proto native void SetPosition (vector position)
 Set the world position of the Effect.
 
proto native void SetColor (int color)
 
proto native void SetFlags (ShapeFlags flags)
 
proto native void Destroy ()
 Cleans up the Effect, including unregistering if needed.
 
static proto native Shape Create (ShapeType type, int color, ShapeFlags flags, vector p1, vector p2)
 
static proto native Shape CreateLines (int color, ShapeFlags flags, vector p[], int num)
 
static proto native Shape CreateTris (int color, ShapeFlags flags, vector p[], int num)
 
static proto native Shape CreateSphere (int color, ShapeFlags flags, vector origin, float radius)
 
static proto native Shape CreateFrustum (float horizontalAngle, float verticalAngle, float length, int color, ShapeFlags flags)
 
static proto native Shape CreateCylinder (int color, ShapeFlags flags, vector origin, float radius, float length)
 
static Shape CreateArrow (vector from, vector to, float size, int color, ShapeFlags flags)
 
static Shape CreateBridgeArrow (vector from, vector to, float size, int color, ShapeFlags flags)
 
static void CreateMatrix (vector mat[4])
 

Variables

enum ShapeType ErrorEx
 

Destroy

Methods regarding automatic cleanup

void SetAutodestroy (bool auto_destroy)
 Sets whether Effect automatically cleans up when it stops.
 
bool IsAutodestroy ()
 Get whether Effect automatically cleans up when it stops.
 
bool IsPendingDeletion ()
 Get whether the Effect is queued up for being cleaned up.
 
bool CanDestroy ()
 Get whether the Effect can be destroyed right now.
 
void SetEnableEventFrame (bool enable)
 Enable Event_OnFrameUpdate for the effect.
 

Detailed Description

Enumeration Type Documentation

◆ CollisionFlags

Definition at line 140 of file EnDebug.c.

141{
142 FIRSTCONTACT, //<In many cases only collided=true/false is enough
143 NEARESTCONTACT //<We want only one, the nearest contact
144 ONLYSTATIC //<Only static objects
145 ONLYDYNAMIC //<Only dynamic objects
146 ONLYWATER //<Only water components (legacy support for "walk on geometry")
147 ALLOBJECTS //<Valid when CF_FIRST_CONTACT, we get first contact for each object
148}
FIRSTCONTACT
Definition EnDebug.c:0
NEARESTCONTACT ONLYSTATIC ONLYDYNAMIC ONLYWATER ALLOBJECTS
Definition EnDebug.c:6

◆ ShapeFlags

Enumerator
NOZBUFFER 
NOZWRITE 
WIREFRAME 
TRANSP 
DOUBLESIDE 
ONCE 
NOOUTLINE 
BACKFACE 
NOCULL 
VISIBLE 
ADDITIVE 

Definition at line 125 of file EnDebug.c.

126{
127 NOZBUFFER, //< Do not compare z-buffer when render
128 NOZWRITE, //< Do not update z-buffer when render
129 WIREFRAME, //< Render just wire-frame outline. No solid faces
130 TRANSP, //< Is translucent
131 DOUBLESIDE, //< Double-sided (do not cull back-faces)
132 ONCE, //< Rendered just once and then it's automatically destroyed. Do not keep pointer to these!!
133 NOOUTLINE, //< Render just solid faces. No wire-frame outline.
134 BACKFACE, //< Render just back faces
135 NOCULL, //< Do not cull shapes by view frustum
136 VISIBLE, //< Make it visible. Set by default
137 ADDITIVE //< Additive blending (works with ShapeFlags.TRANSP)
138};
@ NOZWRITE
Definition EnDebug.c:128
@ NOOUTLINE
Definition EnDebug.c:133
@ DOUBLESIDE
Definition EnDebug.c:131
@ WIREFRAME
Definition EnDebug.c:129
@ BACKFACE
Definition EnDebug.c:134
@ NOCULL
Definition EnDebug.c:135
@ VISIBLE
Definition EnDebug.c:136
@ ADDITIVE
Definition EnDebug.c:137
@ TRANSP
Definition EnDebug.c:130
@ NOZBUFFER
Definition EnDebug.c:127
@ ONCE
Definition EnDebug.c:132

◆ ShapeType

Enumerator
BBOX 
LINE 
SPHERE 
CYLINDER 
DIAMOND 
PYRAMID 

Definition at line 115 of file EnDebug.c.

116{
117 BBOX, //< Just box
118 LINE, //< One or more lines
119 SPHERE, //< Sphere represented by triangle mesh
120 CYLINDER, //< Cylinder represented by triangle mesh
121 DIAMOND, //< Eight faced pyramid. Defined by bound-box, where middle part is equal to horizontal extents of box and top/bottom apogees lies on top/bottom side of box.
122 PYRAMID //< Four sided pyramid. Defined by bound-box, where base is equal to bottom side of box.
123};
@ SPHERE
Definition EnDebug.c:119
@ PYRAMID
Definition EnDebug.c:122
@ DIAMOND
Definition EnDebug.c:121
@ LINE
Definition EnDebug.c:118
@ BBOX
Definition EnDebug.c:117
@ CYLINDER
Definition EnDebug.c:120

Function Documentation

◆ CanDestroy()

bool CanDestroy ( )
protected

Get whether the Effect can be destroyed right now.

Returns
bool Whether the Effect can be destroyed right now

Definition at line 258 of file Effect.c.

259 {
260 return true;
261 }

◆ Create()

static proto native Shape Create ( ShapeType type,
int color,
ShapeFlags flags,
vector p1,
vector p2 )
static

Referenced by CreateMatrix().

◆ CreateArrow()

static Shape CreateArrow ( vector from,
vector to,
float size,
int color,
ShapeFlags flags )
static

Definition at line 173 of file EnDebug.c.

174 {
175 vector dir = to - from;
176 dir.Normalize();
177 vector dir1 = dir * size;
178 size = size * 0.5;
179
180 vector dir2 = dir.Perpend() * size;
181
182 vector pts[5];
183 pts[0] = from;
184 pts[1] = to;
185 pts[2] = to - dir1 - dir2;
186 pts[3] = to - dir1 + dir2;
187 pts[4] = to;
188
189 return CreateLines(color, flags, pts, 5);
190 }
proto float Normalize()
Normalizes vector. Returns length.
vector Perpend()
Returns perpendicular vector. Perpendicular vector is computed as cross product between input vector ...
Definition EnConvert.c:209
static proto native Shape CreateLines(int color, ShapeFlags flags, vector p[], int num)

References CreateLines(), vector::Normalize(), and vector::Perpend().

◆ CreateBridgeArrow()

static Shape CreateBridgeArrow ( vector from,
vector to,
float size,
int color,
ShapeFlags flags )
static

Definition at line 192 of file EnDebug.c.

193 {
194 vector dir = to - from;
195 dir.Normalize();
196
197 vector dir1 = Vector(0, 0, -size);
198 size = size * 0.5;
199
200 vector dir2 = dir.Perpend() * size;
201
202 vector pts[7];
203 pts[0] = from;
204 pts[1] = from + "0 0 1";
205 pts[2] = to + "0 0 1";
206 pts[3] = to;
207 pts[4] = to - dir1 - dir2;
208 pts[5] = to - dir1 + dir2;
209 pts[6] = to;
210
211 return CreateLines(color, flags, pts, 7);
212 }
proto native vector Vector(float x, float y, float z)
Vector constructor from components.

References CreateLines(), vector::Normalize(), vector::Perpend(), and Vector().

◆ CreateCylinder()

static proto native Shape CreateCylinder ( int color,
ShapeFlags flags,
vector origin,
float radius,
float length )
static

◆ CreateFrustum()

static proto native Shape CreateFrustum ( float horizontalAngle,
float verticalAngle,
float length,
int color,
ShapeFlags flags )
static

◆ CreateLines()

static proto native Shape CreateLines ( int color,
ShapeFlags flags,
vector p[],
int num )
static

Referenced by CreateArrow(), and CreateBridgeArrow().

◆ CreateMatrix()

static void CreateMatrix ( vector mat[4])
static

Definition at line 214 of file EnDebug.c.

215 {
216 vector org = mat[3];
217 int flags = ShapeFlags.NOZWRITE | ShapeFlags.DOUBLESIDE | ShapeFlags.TRANSP | ShapeFlags.ONCE;
218 Create(ShapeType.LINE, 0xffff0000, flags, org, mat[0] * 0.5 + org);
219 Create(ShapeType.LINE, 0xff00ff00, flags, org, mat[1] * 0.5 + org);
220 Create(ShapeType.LINE, 0xff0000ff, flags, org, mat[2] * 0.5 + org);
221 }
static proto native Shape Create(ShapeType type, int color, ShapeFlags flags, vector p1, vector p2)
ShapeType
Definition EnDebug.c:116
ShapeFlags
Definition EnDebug.c:126

References Create().

◆ CreateSphere()

static proto native Shape CreateSphere ( int color,
ShapeFlags flags,
vector origin,
float radius )
static

◆ CreateTris()

static proto native Shape CreateTris ( int color,
ShapeFlags flags,
vector p[],
int num )
static

◆ Destroy()

proto native void Destroy ( )

Cleans up the Effect, including unregistering if needed.

Note
Will stop the Effect and queue up the deletion in the callqueue
Is intended for usage from within the Effect itself, use SEffectManager.DestroyEffect when working from a pointer

Cleans up the Effect, including unregistering if needed.

Definition at line 207 of file Effect.c.

208 {
209 // Already queued
210 if (IsPendingDeletion())
211 return;
212
213 // Mark it to prevent queuing it up multiple times or get stuck in a call loop
214 m_IsPendingDeletion = true;
215
216 // Stop it, so that the effects can clean up themselves
217 // Since if for example this is EffectParticle and the particle is looping
218 // It NEEDS to be stopped to clean up the Particle
219 Stop();
220
221 // Queue up the destroying, as we should not do it while we are accessing it here
222 if (GetGame())
224 }
void Stop()
Stops all elements this effect consists of.
Definition Effect.c:175
bool m_IsPendingDeletion
Whether the Destroy process has already been called.
Definition Effect.c:35
Manager class for managing Effect (EffectParticle, EffectSound)
static void DestroyEffect(Effect effect)
Unregisters, stops and frees the Effect.
proto native CGame GetGame()
bool IsPendingDeletion()
Get whether the Effect is queued up for being cleaned up.
Definition Effect.c:249
const int CALL_CATEGORY_GAMEPLAY
Definition tools.c:10

References CALL_CATEGORY_GAMEPLAY, DestroyDamageTriggerEx(), SEffectManager::DestroyEffect(), GetGame(), IsPendingDeletion(), m_IsPendingDeletion, OnTriggerDestroyed(), and Stop().

Referenced by EntityLightSource::CheckLifetime(), EntityLightSource::HandleBrightnessFadeing(), EntityLightSource::HandleRadiusFadeing(), and ~AreaDamageManager().

◆ GetMatrix()

proto native void GetMatrix ( out vector mat[4])

◆ IsAutodestroy()

bool IsAutodestroy ( )
protected

Get whether Effect automatically cleans up when it stops.

Returns
bool Whether Effect automatically cleans up when it stops

Definition at line 240 of file Effect.c.

241 {
242 return m_IsAutodestroy;
243 }
bool m_IsAutodestroy
Whether the Effect cleans up after itself when stopped.
Definition Effect.c:33

References m_IsAutodestroy.

◆ IsPendingDeletion()

bool IsPendingDeletion ( )
protected

Get whether the Effect is queued up for being cleaned up.

Returns
bool Whether the Effect is queued up for being cleaned up

Definition at line 249 of file Effect.c.

250 {
251 return m_IsPendingDeletion;
252 }

References m_IsPendingDeletion.

Referenced by Destroy(), and Entity::IsSetForDeletion().

◆ SetAutodestroy()

void SetAutodestroy ( bool auto_destroy)
protected

Sets whether Effect automatically cleans up when it stops.

Note
This means that it will be unregistered from SEffectManager as well
Parameters
auto_destroybool Whether Effect automatically cleans up when it stops

Definition at line 231 of file Effect.c.

232 {
234 }

References m_IsAutodestroy.

◆ SetColor()

proto native void SetColor ( int color)

◆ SetDirection()

proto native void SetDirection ( vector direction)

◆ SetEnableEventFrame()

void SetEnableEventFrame ( bool enable)
protected

Enable Event_OnFrameUpdate for the effect.

Note
Read SEffectManager.Event_OnFrameUpdate for more info

Definition at line 270 of file Effect.c.

271 {
272 if (enable)
274 else
276 }
void Event_OnFrameUpdate(float time_delta)
Event called on frame when enabled by SetEnableEventFrame(true)
Definition Effect.c:328
static ref ScriptInvoker Event_OnFrameUpdate
Static invoker for the SEffectManager.Event_OnFrameUpdate called form MissionGameplay....

References Event_OnFrameUpdate(), and SEffectManager::Event_OnFrameUpdate.

Referenced by EffEngineSmoke::EffEngineSmoke(), EffectSound::UpdateEvents(), and ~Effect().

◆ SetFlags()

◆ SetMatrix()

proto native void SetMatrix ( vector mat[4])

◆ SetPosition()

proto native void SetPosition ( vector pos)

Variable Documentation

◆ ErrorEx

enum ShapeType ErrorEx

Referenced by And(), ScriptedWidgetEventHandler::Apply(), Assert(), EntityLightSource::AttachOnMemoryPoint(), Entity::AttemptDestructionBehaviour(), WeaponParticlesBase::CheckParticleOverride(), SEffectManager::Cleanup(), ConstructData(), EmoteConstructor::ConstructEmotes(), CreateBleedingEffect(), Particle::CreateParticleEffect(), ParticleSource::CreateParticleEffect(), CreateParticleEx(), ParticleSource::CreateParticleEx(), CreditsLoader::CreateTestJson(), Weapon::CreateWeaponWithAmmo(), StaminaHandler::DepleteStamina(), ParticleSource::DestroyParticleEffect(), array< Class T >::DifferentAtPosition(), Effect(), SEffectManager::EffectRegister(), EmoteBase::EmoteFBStanceCheck(), ParticleSource::EOnFrame(), MenuDefaultCharacterData::EquipDefaultCharacter(), ImpactMaterials::EvaluateImpactEffect(), Math::Factorial(), Ammunition_Base::GetAmmoWeightByBulletType(), FireworksLauncher::GetColorSequence(), GetControlMappingInfo(), UIScriptedMenu::GetControlMappingInfo(), DayZPlayerCameraBase::GetCurrentSightInfo(), HitDirectionEffectBase::GetCurrentType(), Weapon_Base::GetCylinderRotation(), CreditsLoader::GetData(), DlcDataLoader::GetData(), UndergroundAreaLoader::GetData(), EffectAreaLoader::GetData(), UIScriptedMenu::GetData(), JsonMissionLoaderData::GetData(), FireworksLauncherClientEvent::GetExplParticleFromSequence(), AnniversaryFireworksLauncherClientEvent::GetExplParticleFromSequence(), GetLastClientMessage(), GetLastServerMessage(), GetLightPosition(), GetMemoryPointPosition(), Weapon::GetMuzzleStates(), ParticleList::GetParticleID(), ParticleList::GetParticleIDByName(), ParticleList::GetParticlePath(), GameplayEffectsData::GetProbabilities(), DayZProfilesOptions::GetProfileOptionDefaultBool(), DayZProfilesOptions::GetProfileOptionDefaultFloat(), DayZProfilesOptions::GetProfileOptionDefaultInt(), GetStringVariant(), Hologram::Hologram(), ScriptedWidgetEventHandler::Init(), Init(), BleedChanceData::InitInfectedChanceMap(), BleedChanceData::InitMeleeChanceMap(), Interact(), Hologram::IsBehindObstacle(), IsFacingFireplace(), IsParticlePlaying(), JsonFileLoader< Class T >::JsonLoadData(), JsonFileLoader< Class T >::JsonLoadFile(), LoadConfig(), ScriptedWidgetEventHandler::LoadContentList(), CfgGameplayHandler::LoadData(), PlayerSpawnHandler::LoadData(), UIScriptedMenu::LoadData(), ScriptedWidgetEventHandler::LoadFilters(), NotificationSystem::LoadNotificationData(), LoadPlayerAttachmentIndexes(), AmmoTypesAPI::MagazineTypeToAmmoType(), WeaponParticlesBase::OnActivate(), ParticleSource::OnCheckAutoDelete(), MissionBase::OnClientNewEvent(), OnErrorThrown(), ActionDigInStash::OnFinishProgressServer(), OnFinishProgressServer(), ActionUnrestrainTargetHands::OnFinishProgressServer(), OnInit(), CfgGameplayHandler::OnRPC(), UndergroundAreaLoader::OnRPC(), CGame::OnRPC(), ParticleSource::OnToDelete(), Or(), EffectArea::PlaceParticles(), PlayEmote(), SEffectManager::PlayOnObject(), PlayParticle(), DestructionEffectBase::PlayParticle(), PlayParticleEx(), IEntity::PlaySoundSetAtMemoryPoint(), HFSMBase< WeaponStateBase, WeaponEventBase, WeaponActionBase, WeaponGuardBase >::RandomizeFSMStateEx(), InventoryLocation::ReadFromContext(), GameplayEffectsData::RegisterData(), ParticleList::RegisterParticle(), ResetParticle(), RestartParticle(), TFModule::Run(), array::Run(), UIScriptedMenu::SaveData(), ScriptedWidgetEventHandler::SaveFilters(), Entity::SetAttachmentExclusionMaskSlot(), ManBase::SetHairLevelToHide(), FireworksLauncherClientEvent::SetupLight(), AnniversaryFireworksLauncherClientEvent::SetupLight(), ItemOptics::ShowReddot(), EffectSound::SoundError(), Weapon::SpawnAttachedMagazine(), ObjectSpawnerHandler::SpawnObjects(), SpawnDataConverter::SpawnObjects(), SEffectManager::Stop(), StopParticle(), ClientData::SyncEvent_PreprocessPlayerList(), EnProfilerTests::TestFuncCountData(), ScriptedWidgetEventHandler::TutorialKeybinds(), UnregisterEntrance(), UnregisterPanel(), ParticleSource::UpdateState(), ValidateMuzzleArray(), EffectParticle::ValidateStart(), and WeaponParticlesBase::WeaponParticlesBase().