DayZ 1.24
Loading...
Searching...
No Matches
DayZPlayerImplementMeleeCombat.c
Go to the documentation of this file.
18
20{
22 protected const float TARGETING_ANGLE_NORMAL = 30.0;
23 protected const float TARGETING_ANGLE_SPRINT = 15.0;
24 protected const float TARGETING_MIN_HEIGHT = -2.0;
25 protected const float TARGETING_MAX_HEIGHT = 2.0;
26 protected const float TARGETING_RAY_RADIUS_EX = 0.5;
27 protected const float TARGETING_RAY_RADIUS = 0.25;
28 protected const float TARGETING_RAY_DIST = 5.0;
29 protected const float TARGETING_RAY_DIST_SHORT = 2.0;
30
31 protected const float RANGE_EXTENDER_NORMAL = 0.65;
32 protected const float RANGE_EXTENDER_SPRINT = 1.35;
33
34 protected const string DEFAULT_HIT_ZONE = "Torso";
35
38
43
44#ifdef DIAG_DEVELOPER
47#endif
48
52
55
58 protected int m_WeaponMode;
59 protected float m_WeaponRange;
60
62 protected bool m_ForceUntargetable;
63 protected bool m_SprintAttack;
64 protected bool m_WasHit;
65
66 protected vector m_RayStart;
67 protected vector m_RayEnd;
69
71
73 protected int m_HitZoneIdx;
74 protected int m_FinisherType;
75 protected string m_HitZoneName;
77
78#ifdef DIAG_DEVELOPER
79 protected int m_PreviousHitZoneIdx;
80 protected string m_PreviousHitZoneName;
82#endif
83
85
86 // ------------------------------------------------------------
87 // CONSTRUCTOR
88 // ------------------------------------------------------------
89
94
96 {
98
100
101 m_HitZoneName = "";
102 m_HitZoneIdx = -1;
103 m_FinisherType = -1;
105
106 m_SprintAttack = false;
107 m_WasHit = false;
108
110 m_TargetType = EMeleeTargetType.ALIGNABLE;
112#ifdef DIAG_DEVELOPER
114#endif
115
117
118 m_TargetableObjects = new array<typename>; //checks against CONFIG hierarchy
122
124 m_NonAlignableObjects.Insert(Building);
130
132 m_BlacklistedDamageZones.Insert("Brain");
133 }
134
136
137 // ------------------------------------------------------------
138 // PUBLIC
139 // ------------------------------------------------------------
140
142 {
143 return m_HitType;
144 }
145
147 {
149 }
150
152 {
153 return EntityAI.Cast(m_TargetObject);
154 }
155
160
163 {
164 return m_HitZoneIdx;
165 }
166
168 {
169 return m_HitPositionWS;
170 }
171
176
178 {
179 return m_FinisherType;
180 }
181
186
188 {
189 return m_WeaponMode;
190 }
191
207
219
221 {
223
224#ifndef SERVER
226 {
227 //Error("DayZPlayerImplementMeleeCombat - ScriptInputUserData already posted");
228 return;
229 }
230
233
235 if (GetGame().IsMultiplayer())
236 {
239 ctx.Write(m_TargetObject);
240 ctx.Write(m_HitPositionWS);
241 ctx.Write(m_HitZoneIdx);
242 ctx.Write(m_FinisherType);
243 ctx.Send();
244 }
245#endif
246 }
247
249 {
250 if (m_Weapon)
251 {
252 ItemBase item = ItemBase.Cast(m_Weapon.ProcessMeleeItemDamage(GetWeaponMode()));
253
254 if (item && item.GetHierarchyRootPlayer())
255 PlayerBase.Cast(item.GetHierarchyRootPlayer()).SetCheckMeleeItem(item);
256 else if (m_Weapon && m_Weapon.GetHierarchyRootPlayer())
257 PlayerBase.Cast(m_Weapon.GetHierarchyRootPlayer()).SetCheckMeleeItem(ItemBase.Cast(m_Weapon));
258 }
259 }
260
261 // ------------------------------------------------------------
262 // protected
263 // ------------------------------------------------------------
264
266 {
267 if (weapon)
268 {
270 if (weapon.IsInherited(Weapon))
271 {
272 switch (m_HitType)
273 {
274 case EMeleeHitType.WPN_HIT:
275 return 0;
276 case EMeleeHitType.WPN_HIT_BUTTSTOCK:
277 return 1;
278 case EMeleeHitType.WPN_STAB:
279 return 2;
280 }
281 }
282 else
283 {
285 switch (m_HitType)
286 {
287 case EMeleeHitType.LIGHT:
288 return weapon.GetMeleeMode();
289 case EMeleeHitType.HEAVY:
290 return weapon.GetMeleeHeavyMode();
291 case EMeleeHitType.SPRINT:
292 return weapon.GetMeleeSprintMode();
293 }
294 }
295 }
296
298 switch (m_HitType)
299 {
300 case EMeleeHitType.HEAVY:
301 return 1;
302 case EMeleeHitType.SPRINT:
303 return 2;
304 }
305
306 return 0;
307 }
308
310 {
311 if (weapon)
312 return weapon.GetMeleeCombatData().GetModeRange(weaponMode);
313 else
314 return m_DZPlayer.GetMeleeCombatData().GetModeRange(weaponMode);
315 }
316
317 protected float GetRange()
318 {
320 }
321
322 protected float GetAngle()
323 {
324 if (m_SprintAttack)
326 else
328 }
329
330 protected void TargetSelection()
331 {
332 // Prepare common variables
334 vector pos = m_DZPlayer.GetPosition();
335 vector rayStart = m_DZPlayer.GetBonePositionWS(m_DZPlayer.GetBoneIndexByName("Head"));
336
338 m_DZPlayer.GetCurrentCameraTransform(cameraPos, cameraDir, cameraRot);
339 vector dir = MiscGameplayFunctions.GetHeadingVector(player);
340 dir[1] = cameraDir[1];
341
342 // Calculate max distances
343 float dist = GetRange();
344 float angle = GetAngle();
345 float dist2 = Math.SqrFloat(dist);
346
347 // There's generally 2 TargetSelection calls per animation
348 // First to obtain target to move towards during animation
349 // Second one is to see if that target is still in range before applying damage to it
350 // m_WasHit means the hit event occured, so this is the second call
351
352 if (m_WasHit && GetFinisherType() == -1)
353 {
354 // See if the component is still in range
356 {
358 // This result should still be cached, so no need to fill it in again
359 return;
360 }
361 }
362
363 // Find a new target
365
368 int hitZone;
369
370 // First pass - Prefer what the player is looking at (only aligneable ones, we will try for nonaligneable later)
372 {
374 {
376 return;
377 }
378
380 {
382
384 return;
385 }
386 }
387
388 // Second pass - Try to obtain something aligneable closeby the player watching direction
390
391 if (targetData)
392 {
393 SetTarget(targetData.Obj, targetData.HitPos, targetData.HitComponent);
394 return;
395 }
396
397 // Third pass - We found no aligneable target, check if the target that we are directly looking at is nonalignable (big)
399 {
401
403 return;
404 }
405 }
406
414 {
415 if (m_WasHit)
416 return -1;
417
418 if (target)
419 {
420 vector dir = target.GetPosition() - m_DZPlayer.GetPosition();
421
424
425 float moveFraction = m_DZPlayer.CollisionMoveTest(dir, vector.Zero, 1.0, target, hitEntity, hitPos, hitNormal);
426 if (moveFraction < 1.0)
427 return -1;
428 }
429
431 if (target && target.CanBeBackstabbed() && weapon && (weapon.IsMeleeFinisher() || m_HitType == EMeleeHitType.WPN_STAB) && !weapon.IsRuined())
432 {
433 bool playGenericFinisherAnimation = false;
436 {
439 return -1;
440
441 int mindState = targetZombie.GetMindStateSynced();
443 if (mindState >= DayZInfectedConstants.MINDSTATE_DISTURBED)
444 return -1;
445 }
446
449 if (targetZombie)
451 else if (targetPlayer)
453 else
455
457 if (weapon.IsWeapon())
458 return EMeleeHitType.WPN_STAB_FINISHER;
460 return EMeleeHitType.FINISHER_GENERIC;
461 else //specific hit depending on the component hit (gotten from the target)
463 }
464
465 return -1;
466 }
467
469 {
471 {
473 EMeleeHitType.FINISHER_LIVERSTAB,
474 EMeleeHitType.FINISHER_NECKSTAB
475 };
476
478 }
479
480 if (!weapon || !weapon.GetValidFinishers() || weapon.GetValidFinishers().Count() == 0)
481 return EMeleeHitType.FINISHER_LIVERSTAB;
482
484 int idx = Math.Round(Math.Lerp(0, weapon.GetValidFinishers().Count() - 1, player.GetRandomGeneratorSyncManager().GetRandom01(RandomGeneratorSyncUsage.RGSGeneric)));
485 return weapon.GetValidFinishers()[idx];
486 }
487
488 protected void InternalResetTarget()
489 {
492 m_HitZoneIdx = -1;
493 m_HitZoneName = "";
494 SetFinisherType(-1);
495 }
496
497 protected void SetTarget(Object obj, vector hitPos, int hitZone)
498 {
499 if (obj)
500 {
501 m_TargetObject = obj;
504 m_HitZoneName = m_TargetObject.GetDamageZoneNameByComponentIndex(m_HitZoneIdx);
505 }
506 }
507
508 protected bool CanObjectBeTargeted(Object obj, bool checkNonAligneAble = false)
509 {
510 return obj && obj.IsAlive() && (obj.IsAnyInherited(m_TargetableObjects) || (checkNonAligneAble && obj.IsAnyInherited(m_NonAlignableObjects)));
511 }
512
514 {
516 // Not sure if desired, as it can give some results that feel a little odd
517 // But it will depend entirely on the player and situation..
518 // I guess the crosshair is hidden while melee anyways though
519 // || ( m_DZPlayer.IsInThirdPerson() && HitZoneSelectionRaycast(hitPos, hitZone, target, true);
520 }
521
523 {
525
526 vector pos;
527 vector dir;
529 if (useCamera)
530 {
531 // What the player camera is looking at (crosshair)
533 player.GetCurrentCameraTransform(pos, dir, cameraRotation);
534 playerDir = dir;
535 }
536 else
537 {
538 // What the player himself is looking at
539 playerDir = MiscGameplayFunctions.GetHeadingVector(player);
540 dir = GetGame().GetCurrentCameraDirection();
541 MiscGameplayFunctions.GetHeadBonePos(player, pos);
542 }
543
545 if (vector.Dot(dir, playerDir) < 0.5)
546 return false;
547
548 m_RayStart = pos;
549 m_RayEnd = m_RayStart + GetRange() * dir;
550
551 // raycast
554
556 {
557 target = hitObjects[0];
558 m_ForceUntargetable = false;
559
562 if (playerTarget && playerTarget.IsInVehicle())
563 {
564 if (vector.DistanceSq(pos, hitPos) > Math.SqrFloat(GetRange() * 0.5))
565 {
566 m_ForceUntargetable = true;
567 target = null;
569 hitZone = -1;
570 }
571 }
572
573 return true;
574 }
575
576 return false;
577 }
578
580 protected void HitZoneSelection()
581 {
584
585 // ray properties
586 vector pos;
587 vector cameraDirection = GetGame().GetCurrentCameraDirection();
588
589 MiscGameplayFunctions.GetHeadBonePos(player, pos);
590 m_RayStart = pos;
593
594 // raycast
597 float hitFraction;
600
602 {
603 m_HitZoneIdx = -1;
604 //Print("HitZoneSelection failed");
605 }
606 else if (hitObjects.Count() > 0)
607 {
608 cursorTarget = hitObjects.Get(0);
609
611 vector playerPos = m_DZPlayer.GetPosition();
614 playerPos[1] = 0;
615 hitPos[1] = 0;
616
619 {
621 if (m_TargetObject == null)
623 }
624
626 {
627 m_HitZoneName = cursorTarget.GetDamageZoneNameByComponentIndex(m_HitZoneIdx);
628 //Print("hit object: " + m_TargetObject + " | component idx: " + m_HitZoneIdx + " | hitzone name: " + m_HitZoneName);
629 }
630 else
631 {
633 m_HitZoneName = DEFAULT_HIT_ZONE; //Default to torso if no zone is targeted
634 }
635 }
636 else
637 {
638 m_HitZoneIdx = -1;
639 //Print("HitZoneSelection failed");
640 }
641 }
642
644 protected bool IsObstructed(Object object)
645 {
646 // check direct visibility of object (obstruction check)
649 float hitFraction;
653
654 if (object)
655 {
656 MiscGameplayFunctions.GetHeadBonePos(player, start);
657 end = start + MiscGameplayFunctions.GetHeadingVector(player) * vector.Distance(player.GetPosition(), object.GetPosition());
658
659 if (end == start)
660 return true;
661
663 }
664
665 return false;
666 }
667
669 {
670 vector targetDirection = target.GetDirection();
673 {
674 targetDirection = Vector(targetZombie.GetOrientationSynced(), 0, 0);
675 targetDirection = targetDirection.AnglesToVector();
676 }
677 vector toSourceDirection = (source.GetPosition() - target.GetPosition());
678
679 targetDirection[1] = 0;
680 toSourceDirection[1] = 0;
681
682 targetDirection.Normalize();
683 toSourceDirection.Normalize();
684
687
688 int hitDir = Math.Acos(cosFi) * Math.RAD2DEG;
689
690 if (cross[1] < 0)
691 hitDir = -hitDir;
692
693 return hitDir <= (-180 + angle) || hitDir >= (180 - angle);
694 }
695
696#ifdef DIAG_DEVELOPER
697 // ------------------------------------------------------------
698 // DEBUG
699 // ------------------------------------------------------------
700 protected ref array<Shape> dbgConeShapes = new array<Shape>();
701 protected ref array<Shape> dbgTargets = new array<Shape>();
702 protected ref array<Shape> hitPosShapes = new array<Shape>();
703
705 {
707
708 if (!DiagMenu.GetBool(DiagMenuIDs.MELEE_DEBUG))
709 return;
710
711 if (DiagMenu.GetBool(DiagMenuIDs.MELEE_CONTINUOUS) && (!GetGame().IsMultiplayer() || !GetGame().IsServer()))
713
714 if (DiagMenu.GetBool(DiagMenuIDs.MELEE_SHOW_TARGETS))
716
717 if (DiagMenu.GetBool(DiagMenuIDs.MELEE_DRAW_TARGETS))
719
720 if (DiagMenu.GetBool(DiagMenuIDs.MELEE_DRAW_RANGE))
721 {
724 }
725
726 if (DiagMenu.GetBool(DiagMenuIDs.MELEE_DRAW_BLOCK_RANGE_AI))
728
729 if (DiagMenu.GetBool(DiagMenuIDs.MELEE_DRAW_BLOCK_RANGE_PVP))
731 }
732
734 {
736 }
737
739 {
741 }
742
744 protected void ShowDebugMeleeTarget()
745 {
746 int windowPosX = 0;
747 int windowPosY = 500;
748
749 DbgUI.Begin("Melee Target", windowPosX, windowPosY);
750 HumanCommandMelee2 hmc2 = m_DZPlayer.GetCommand_Melee2();
751 if (hmc2)
752 DbgUI.Text("Current combo: " + hmc2.GetComboCount());
753
755 {
756 DbgUI.Text("Previous Character: " + m_PreviousTargetObject.GetDisplayName());
757 DbgUI.Text("Previous HitZone: " + m_PreviousHitZoneName + "(" + m_PreviousHitZoneIdx + ")");
758 DbgUI.Text("Previous HitPosWS:" + m_PreviousHitPositionWS);
759 DbgUI.Text("Previous Distance:" + vector.Distance(m_PreviousHitPositionWS, m_DZPlayer.GetPosition()));
760 }
761
762 if (m_TargetObject)
763 {
764 DbgUI.Text("Character: " + m_TargetObject.GetDisplayName());
765 DbgUI.Text("HitZone: " + m_HitZoneName + "(" + m_HitZoneIdx + ")");
766 DbgUI.Text("HitPosWS:" + m_HitPositionWS);
767 DbgUI.Text("Distance:" + vector.Distance(m_HitPositionWS, m_DZPlayer.GetPosition()));
768 }
769 DbgUI.End();
770 }
771
773 protected void DrawDebugTargets()
774 {
777 }
778
780 {
781 for (int i = 0; i < allTargets.Count(); ++i)
782 {
783 if (m_TargetObject && allTargets.Count())
784 {
785 Object obj = allTargets[i];
786 vector w_pos = obj.GetPosition();
787 // sphere pos tweaks
789 w_pos_sphr[1] = w_pos_sphr[1] + 1.8;
790 // line pos tweaks
792 w_pos_lend[1] = w_pos_lend[1] + 1.8;
793
794 if (obj == m_TargetObject)
795 {
798 }
799 else
800 {
801 dbgTargets.Insert(Debug.DrawSphere(w_pos_sphr, 0.05, colorTarget, ShapeFlags.NOOUTLINE));
803 }
804 }
805 }
806 }
807
808 protected void DrawDebugMeleeHitPosition()
809 {
812
813 if (m_TargetObject)
815 }
816
817 protected void DrawDebugMeleeCone()
818 {
819 // cone settings
820 float dist = GetRange();
821 vector start = m_DZPlayer.GetPosition();
822
823 vector normDir = MiscGameplayFunctions.GetHeadingVector(PlayerBase.Cast(m_DZPlayer));
824 normDir[1] = 0;
825 normDir.Normalize();
826 float playerAngle = -Math.Atan2(normDir[0], normDir[2]);
827
829 }
830
831 protected void DrawDebugBlockCone(float angle, int color)
832 {
833 // cone settings
834 float dist = 3;
835 vector start = m_DZPlayer.GetPosition();
836
837 vector dir = GetGame().GetCurrentCameraDirection();
838 dir[1] = 0;
839 dir.Normalize();
840 float playerAngle = -Math.Atan2(dir[0], dir[2]);
841
843 }
844
845 protected void CleanAllDebugShapes()
846 {
847 CleanupDebugShapes(dbgTargets);
848 CleanupDebugShapes(dbgConeShapes);
849 CleanupDebugShapes(hitPosShapes);
850 }
851
852 protected void CleanupDebugShapes(array<Shape> shapes)
853 {
854 for (int it = 0; it < shapes.Count(); ++it)
856
857 shapes.Clear();
858 }
859#endif
860}
const int INPUT_UDT_MELEE_TARGET
Definition _constants.c:6
void Reset()
Definition Inventory.c:1018
override Widget Init()
Definition DayZGame.c:120
DayZInfectedConstants
Definition DayZInfected.c:2
PhxInteractionLayers
Definition DayZPhysics.c:2
float GetWeaponRange(InventoryItem weapon, int weaponMode)
bool m_SprintAttack
If most recent attack was a sprint attack.
void HitZoneSelection()
DEPRECATED.
vector m_RayEndShort
DEPRECATED: "HitZoneSelection".
int GetHitZoneIdx()
component idx
void SetTarget(Object obj, vector hitPos, int hitZone)
const float TARGETING_MIN_HEIGHT
Second Pass: How deep the cone goes in meters from player position.
const float TARGETING_RAY_DIST_SHORT
DEPRECATED: "HitZoneSelection".
bool IsEntityBehindEntityInAngle(EntityAI source, EntityAI target, float angle)
int m_WeaponMode
WeaponMode used during most recent Update.
bool m_WasHit
If most recent attack was.
ref array< string > m_BlacklistedDamageZones
List of blacklisted damage zone names (cannot use indices due to the possible changes when p3d compon...
bool HitZoneSelectionRaycast(out vector hitPos, out int hitZone, out Object target, bool useCamera)
const float RANGE_EXTENDER_SPRINT
General range extension while in sprint.
void InternalResetTarget()
void SetHitPos(vector pHitPos)
const float TARGETING_MAX_HEIGHT
Second Pass: How high the cone goes in meters from player position.
const float TARGETING_RAY_DIST
DEPRECATED: "HitZoneSelection".
EntityAI GetTargetEntity()
ref MeleeTargeting m_MeleeTargeting
Target selecting "component".
bool m_ForceUntargetable
Misc - cache.
ref array< Object > m_AllTargetObjects
All potential targets found during most recent TargetSelection.
void ~DayZPlayerImplementMeleeCombat()
DayZPlayerImplement m_DZPlayer
Parent.
ref array< typename > m_NonAlignableObjects
Typenames of objects that can be targeted, but are not a priority (3rd Pass)
vector m_RayStart
Start position of most recent HitZoneSelectionRaycast.
void DayZPlayerImplementMeleeCombat(DayZPlayerImplement player)
Object m_TargetObject
Targets - types.
EMeleeHitType GetHitType()
void SetHitZoneIdx(int pHitZone)
int SelectWeaponMode(InventoryItem weapon)
vector m_HitPositionWS
Most recent target position.
bool HitZoneSelectionRaycastHelper(out vector hitPos, out int hitZone, out Object target)
int m_DebugForcedFinisherType
float m_WeaponRange
WeaponRange used during most recent Update.
void SetTargetObject(Object pTarget)
const float RANGE_EXTENDER_NORMAL
General range extension.
const float TARGETING_ANGLE_SPRINT
Second Pass: Half angle of cone during sprint.
EMeleeHitType m_HitType
Hit type of the most recent attack.
const float TARGETING_RAY_RADIUS_EX
Second Pass: Max distance from ray projected from player looking direction.
ref array< typename > m_TargetableObjects
Typenames of all directly/preferred targetable objects (1st Pass + 2nd Pass)
const string DEFAULT_HIT_ZONE
DEPRECATED: "HitZoneSelection".
EMeleeTargetType m_TargetType
DEPRECATED: Was added but never used..?
int m_HitZoneIdx
Hit result - cache.
enum EMeleeHitType TARGETING_ANGLE_NORMAL
Target selection settings.
bool CanObjectBeTargeted(Object obj, bool checkNonAligneAble=false)
string m_HitZoneName
Most recent target HitZone name.
void SetFinisherType(int pFinisherType)
int DetermineSpecificFinisherType(ItemBase weapon)
int TrySelectFinisherType(InventoryItem weapon, EntityAI target)
General condition for finisher attacks.
bool IsObstructed(Object object)
DEPRECATED - New function in MeleeTargeting.
InventoryItem m_Weapon
Weapons - cache.
vector m_RayEnd
End position of most recent HitZoneSelectionRaycast.
const float TARGETING_RAY_RADIUS
DEPRECATED: "HitZoneSelection".
DiagMenuIDs
Definition EDiagMenuIDs.c:2
EMeleeTargetType
ref array< typename > TargetableObjects void MeleeTargetSettings(vector coneOrigin, float coneLength, float coneHalfAngle, float coneMinHeight, float coneMaxHeight, vector rayStart, vector dir, float maxDist, EntityAI pToIgnore, array< typename > targetableObjects)
class PresenceNotifierNoiseEvents windowPosX
dbgUI settings
const int windowPosY
Super root of all classes in Enforce script.
Definition EnScript.c:11
static proto bool RaycastRV(vector begPos, vector endPos, out vector contactPos, out vector contactDir, out int contactComponent, set< Object > results=NULL, Object with=NULL, Object ignore=NULL, bool sorted=false, bool ground_only=false, int iType=ObjIntersectView, float radius=0.0, CollisionFlags flags=CollisionFlags.NEARESTCONTACT)
Raycasts world by given parameters.
static proto bool RayCastBullet(vector begPos, vector endPos, PhxInteractionLayers layerMask, Object ignoreObj, out Object hitObject, out vector hitPosition, out vector hitNormal, out float hitFraction)
Definition DbgUI.c:60
Definition Debug.c:14
static Shape DrawSphere(vector pos, float size=1, int color=0x1fff7f7f, ShapeFlags flags=ShapeFlags.TRANSP|ShapeFlags.NOOUTLINE)
Definition Debug.c:434
static array< Shape > DrawCone(vector pos, float lenght, float halfAngle, float offsetAngle, int color=0xFFFFFFFF, int flags=0)
Definition Debug.c:458
static void RemoveShape(out Shape shape)
Definition Debug.c:107
static Shape DrawLine(vector from, vector to, int color=0xFFFFFFFF, int flags=0)
Definition Debug.c:489
Definition EnMath.c:7
proto static native bool CanStoreInputUserData()
script counterpart to engine's class Weapon
static proto native float DistanceSq(vector v1, vector v2)
Returns the square distance between tips of two 3D vectors.
static float Dot(vector v1, vector v2)
Returns Dot product of vector v1 and vector v2.
Definition EnConvert.c:271
static const vector Zero
Definition EnConvert.c:110
proto float Normalize()
Normalizes vector. Returns length.
static proto native float Distance(vector v1, vector v2)
Returns the distance between tips of two 3D vectors.
proto native CGame GetGame()
const int COLOR_BLUE
Definition constants.c:66
const int COLOR_RED_A
Definition constants.c:69
const int COLOR_RED
Definition constants.c:64
const int COLOR_GREEN
Definition constants.c:65
const int COLOR_YELLOW_A
Definition constants.c:72
const int COLOR_YELLOW
Definition constants.c:67
ShapeFlags
Definition EnDebug.c:126
static proto native void End()
static proto native void Begin(string windowTitle, float x=0, float y=0)
static proto native void Text(string label)
static proto bool GetBool(int id, bool reverse=false)
Get value as bool from the given script id.
const float AI_MAX_BLOCKABLE_ANGLE
Definition constants.c:915
const float PVP_MAX_BLOCKABLE_ANGLE
Definition constants.c:922
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
proto native vector Vector(float x, float y, float z)
Vector constructor from components.
static proto float Lerp(float a, float b, float time)
Linearly interpolates between 'a' and 'b' given 'time'.
static proto float SqrFloat(float f)
Returns squared value.
static const float PI_HALF
Definition EnMath.c:14
static proto float Acos(float c)
Returns angle in radians from cosinus.
static proto float Round(float f)
Returns mathematical round of value.
static proto float Atan2(float y, float x)
Returns angle in radians from tangent.
static const float RAD2DEG
Definition EnMath.c:16
static const float DEG2RAD
Definition EnMath.c:17
proto native volatile void Update()