Download scripts/3_Game/DayZ/tools/Component/ComponentEntityDebug.c from FelonieZ/DayZ_Scripts: direct link, hf CLI and curl.
- Browser
- Download file 2.63 kB
-
https://huggingface.co/datasets/FelonieZ/DayZ_Scripts/resolve/main/scripts/3_Game/DayZ/tools/Component/ComponentEntityDebug.c
- Command line
-
hf download hf://datasets/FelonieZ/DayZ_Scripts/scripts/3_Game/DayZ/tools/Component/ComponentEntityDebug.c
-
curl -L -o ComponentEntityDebug.c https://huggingface.co/datasets/FelonieZ/DayZ_Scripts/resolve/main/scripts/3_Game/DayZ/tools/Component/ComponentEntityDebug.c
2.63 kB
| class ComponentEntityDebug extends Component | |
| { | |
| protected Shape m_DebugShapeBBox; | |
| protected Shape m_DebugShapeDirection; | |
| protected float m_DebugShapeDirectionDist; | |
| // ------------------------------------------------------------------------- | |
| override Shape DebugBBoxDraw() | |
| { | |
| return null; | |
| if ( m_DebugShapeBBox ) | |
| m_DebugShapeBBox.Destroy(); | |
| vector min_max[2]; | |
| if (!m_ThisEntityAI.GetCollisionBox(min_max)) | |
| return null; | |
| m_DebugShapeBBox = Debug.DrawBox(min_max[0], min_max[1]); | |
| GetGame().GetCallQueue(CALL_CATEGORY_GUI).CallLater(OnDrawing, 0, true); | |
| m_ThisEntityAI.SetEventMask(EntityEvent.FRAME); | |
| return null; | |
| } | |
| // ------------------------------------------------------------------------- | |
| override void DebugBBoxSetColor(int color) | |
| { | |
| if ( m_DebugShapeBBox ) | |
| { | |
| m_DebugShapeBBox.SetColor(color); | |
| } | |
| } | |
| // ------------------------------------------------------------------------- | |
| override void DebugBBoxDelete() | |
| { | |
| return; | |
| if ( m_DebugShapeBBox ) | |
| { | |
| m_DebugShapeBBox.Destroy(); | |
| m_DebugShapeBBox = null; | |
| } | |
| if ( !m_DebugShapeDirection && !m_DebugShapeBBox ) | |
| { | |
| GetGame().GetCallQueue(CALL_CATEGORY_GUI).Remove(OnDrawing); | |
| } | |
| } | |
| // ------------------------------------------------------------------------- | |
| override Shape DebugDirectionDraw(float distance = 1) | |
| { | |
| return null; | |
| if ( m_DebugShapeDirection ) | |
| { | |
| m_DebugShapeDirection.Destroy(); | |
| } | |
| vector p1 = "0 0 0"; | |
| vector p2 = m_ThisEntityAI.GetDirection() * m_DebugShapeDirectionDist; | |
| m_DebugShapeDirectionDist = distance; | |
| m_DebugShapeDirection = Debug.DrawArrow(p1, p2); | |
| GetGame().GetCallQueue(CALL_CATEGORY_GUI).CallLater(OnDrawing, 0, true); | |
| m_ThisEntityAI.SetEventMask(EntityEvent.FRAME); | |
| return null; | |
| } | |
| // ------------------------------------------------------------------------- | |
| override void DebugDirectionDelete() | |
| { | |
| return; | |
| if ( m_DebugShapeDirection ) | |
| { | |
| m_DebugShapeDirection.Destroy(); | |
| m_DebugShapeDirection = null; | |
| } | |
| if ( !m_DebugShapeDirection && !m_DebugShapeBBox ) | |
| { | |
| GetGame().GetCallQueue(CALL_CATEGORY_GUI).Remove(OnDrawing); | |
| } | |
| } | |
| void OnDrawing() | |
| { | |
| return; | |
| if ( m_DebugShapeBBox || m_DebugShapeDirection ) | |
| { | |
| vector mat[4]; | |
| m_ThisEntityAI.GetTransform(mat); | |
| if ( m_DebugShapeBBox ) | |
| { | |
| m_DebugShapeBBox.SetMatrix(mat); | |
| } | |
| if ( m_DebugShapeDirection ) | |
| { | |
| m_DebugShapeDirection.SetMatrix(mat); | |
| } | |
| } | |
| } | |
| } |