Arma Reforger Script API
Loading...
Searching...
No Matches
SCR_DebugShapeHelperComponent Interface Reference
Inheritance diagram for SCR_DebugShapeHelperComponent:

Public Member Functions

override void OnDelete (IEntity owner)
 Called when Entity is being to be destroyed (deleted) or component to be deleted (see Game.DeleteScriptComponent).
 
override void _WB_OnInit (IEntity owner, inout vector mat[4], IEntitySource src)
 Saves instance so that debug shapes can be viewed in Workbench.
 
override bool _WB_OnKeyChanged (IEntity owner, BaseContainer src, string key, BaseContainerList ownerContainers, IEntity parent)
 Any property value has been changed. You can use editor API here and do some additional edit actions which will be part of the same "key changed" action.
 

Static Public Member Functions

static void CreateFloorCeilingTraceShapes (World world, vector startPos, TraceParam traceParam, vector floorPos, vector ceilingPos, bool enoughSpace, string text="", string tag="")
 Creates debug shapes for TryGetValidFloorPosition, adds spheres, boxes, or cylinders based on trace type, and colors them based on success.
 
static void AddSphere (vector center, float radius, int color, ShapeFlags shapeFlags=DEFAULT_SHAPE_FLAGS, string tag="")
 Adds a debug sphere at specified position with given radius and color.
 
static void AddCylinderBetween (vector bottom, vector top, float radius, int color, ShapeFlags shapeFlags=DEFAULT_SHAPE_FLAGS, string tag="")
 Adds a debug cylinder between two points with given radius and color.
 
static void AddCylinder (vector center, float radius, float length, int color, ShapeFlags shapeFlags=DEFAULT_SHAPE_FLAGS, string tag="")
 Adds a debug cylinder at specified position with given length, radius, and color.
 
static void AddBox (vector mins, vector maxs, int color, ShapeFlags shapeFlags=DEFAULT_TRIS_FLAGS, string tag="")
 Adds debug box with specified min, max coordinates and color.
 
static void AddText (World world, vector origin, string text, ShapeFlags shapeFlags=DEFAULT_TEXT_FLAGS, string tag="")
 Adds debug text at specified origin with given text.
 
static void AddShape (notnull Managed shape, string tag="")
 Adds shape to tagged shapes array, removes oldest shape if limit exceeded.
 
static int MakeTransparent (int color)
 Creates an ARGB color with 8% transparency from input color.
 
static int GetColorBasedOnSuccess (bool success)
 Returns color based on success, green if true, red if false, with transparency.
 
static float GetDebugRadiusFromTraceParam (TraceParam traceParam)
 Calculates debug radius from trace parameter, returns sphere radius if present, otherwise maximum dimension difference in box trace.
 
static void RemoveShape (notnull Managed shape, string tag="")
 Removes shape with given tag.
 
static void RemoveTag (string tag)
 Removes specified tag from m_mTagedShape list.
 
static void Clear ()
 Clears all tagged shapes from the list.
 

Public Attributes

int m_iShapeLimit
 

Protected Member Functions

override void OnPostInit (IEntity owner)
 

Static Protected Attributes

static SCR_DebugShapeHelperComponent s_Instance
 
static int s_iShapeLimit = 10000
 
static bool s_bKeepDrawList
 
static ref map< string, ref array< ref Managed > > s_mTaggedShapes = new map<string, ref array<ref Managed>>()
 
static const int DEFAULT_COLOUR = MakeTransparent(Color.YELLOW)
 
static const ShapeFlags DEFAULT_SHAPE_FLAGS = ShapeFlags.TRANSP | ShapeFlags.DOUBLESIDE | ShapeFlags.NOOUTLINE
 
static const ShapeFlags DEFAULT_SHAPE_FLAGS_NOZWRITE = ShapeFlags.TRANSP | ShapeFlags.DOUBLESIDE | ShapeFlags.NOOUTLINE | ShapeFlags.NOZWRITE
 
static const ShapeFlags DEFAULT_TRIS_FLAGS = ShapeFlags.TRANSP | ShapeFlags.DOUBLESIDE | ShapeFlags.NOZWRITE
 
static const ShapeFlags DEFAULT_TEXT_FLAGS = DebugTextFlags.CENTER | DebugTextFlags.FACE_CAMERA
 
static const string DEBUG_TAG = "SCR_DebugShapeHelperComponent"
 

Member Function Documentation

◆ _WB_OnInit()

override void SCR_DebugShapeHelperComponent._WB_OnInit ( IEntity owner,
inout vector mat[4],
IEntitySource src )

Saves instance so that debug shapes can be viewed in Workbench.

Parameters
[in]ownerThe owner represents the entity that initializes the script.
[in,out]matMat is a 4x4 matrix representing the world space transformation for the entity.
[in]srcSource entity providing initialization data for the component.

◆ _WB_OnKeyChanged()

override bool SCR_DebugShapeHelperComponent._WB_OnKeyChanged ( IEntity owner,
BaseContainer src,
string key,
BaseContainerList ownerContainers,
IEntity parent )

Any property value has been changed. You can use editor API here and do some additional edit actions which will be part of the same "key changed" action.

◆ AddBox()

static void SCR_DebugShapeHelperComponent.AddBox ( vector mins,
vector maxs,
int color,
ShapeFlags shapeFlags = DEFAULT_TRIS_FLAGS,
string tag = "" )
static

Adds debug box with specified min, max coordinates and color.

Parameters
[in]minsMinimum coordinates for the box in 3D space.
[in]maxsMaxs represents the maximum coordinates for the bounding box in 3D space.
[in]colorColor is an integer representing the RGB value for the box's color in debug mode.

◆ AddCylinder()

static void SCR_DebugShapeHelperComponent.AddCylinder ( vector center,
float radius,
float length,
int color,
ShapeFlags shapeFlags = DEFAULT_SHAPE_FLAGS,
string tag = "" )
static

Adds a debug cylinder at specified position with given length, radius, and color.

Parameters
[in]positionRepresents 3D position in space for creating debug cylinder.
[in]lengthLength represents the height or size of the cylinder in the 3D space for the method.
[in]radiusRepresents cylinder radius in 3D space.
[in]colorColor is an integer representing the RGBA value for the cylinder's visual appearance.

◆ AddCylinderBetween()

static void SCR_DebugShapeHelperComponent.AddCylinderBetween ( vector bottom,
vector top,
float radius,
int color,
ShapeFlags shapeFlags = DEFAULT_SHAPE_FLAGS,
string tag = "" )
static

Adds a debug cylinder between two points with given radius and color.

Parameters
[in]bottomBottom is the lower point of cylinder in 3D space.
[in]topTop is the upper point of cylinder in 3D space.
[in]radiusRadius represents the cylinder's diameter in the method.
[in]colorColor parameter represents the visual appearance of the cylinder in the scene, specified by an integer value from 0 to 2

◆ AddShape()

static void SCR_DebugShapeHelperComponent.AddShape ( notnull Managed shape,
string tag = "" )
static

Adds shape to tagged shapes array, removes oldest shape if limit exceeded.

Parameters
[in]shapeAdds shape to tagged shapes array, removes oldest shape if limit exceeded.
[in]tagTag is used as an identifier for grouping shapes in the method.

◆ AddSphere()

static void SCR_DebugShapeHelperComponent.AddSphere ( vector center,
float radius,
int color,
ShapeFlags shapeFlags = DEFAULT_SHAPE_FLAGS,
string tag = "" )
static

Adds a debug sphere at specified position with given radius and color.

Parameters
[in]positionRepresents 3D position in space for creating debug sphere.
[in]radiusRadius represents the size of the sphere in the 3D space.
[in]colorColor is an integer representing the visual appearance of the debug sphere in the scene.

◆ AddText()

static void SCR_DebugShapeHelperComponent.AddText ( World world,
vector origin,
string text,
ShapeFlags shapeFlags = DEFAULT_TEXT_FLAGS,
string tag = "" )
static

Adds debug text at specified origin with given text.

Parameters
[in]originOrigin is the position in 3D space where debug text is added.
[in]textAdds debug text at specified origin with given text.

◆ Clear()

static void SCR_DebugShapeHelperComponent.Clear ( )
static

Clears all tagged shapes from the list.

◆ CreateFloorCeilingTraceShapes()

static void SCR_DebugShapeHelperComponent.CreateFloorCeilingTraceShapes ( World world,
vector startPos,
TraceParam traceParam,
vector floorPos,
vector ceilingPos,
bool enoughSpace,
string text = "",
string tag = "" )
static

Creates debug shapes for TryGetValidFloorPosition, adds spheres, boxes, or cylinders based on trace type, and colors them based on success.

Parameters
[in]startPosStart position represents the initial point for creating floor and ceiling trace shapes in 3D space.
[in]traceParamTraceParam is used to determine what shape and dimensions where traced.
[out]floorPosPosition of floor.
[out]ceilingPosPosition of ceiling.
[in]enoughSpaceSelects color based on success.
[in]textIf non-empty, creates text.
[in]tagUsed to group debug shapes togeter. Is prefixed by "SCR_DebugShapeHelper_"

◆ GetColorBasedOnSuccess()

static int SCR_DebugShapeHelperComponent.GetColorBasedOnSuccess ( bool success)
static

Returns color based on success, green if true, red if false, with transparency.

Parameters
[in]successSuccess represents whether an operation was successful or not in the method.
Returns
color based on success, green for true, red for false.

◆ GetDebugRadiusFromTraceParam()

static float SCR_DebugShapeHelperComponent.GetDebugRadiusFromTraceParam ( TraceParam traceParam)
static

Calculates debug radius from trace parameter, returns sphere radius if present, otherwise maximum dimension difference in box trace.

Parameters
[in]traceParamTraceParam represents the parameters for tracing a collision shape in 3D space.
Returns
the radius or maximum dimension of the trace parameter, depending on its type.

◆ MakeTransparent()

static int SCR_DebugShapeHelperComponent.MakeTransparent ( int color)
static

Creates an ARGB color with 8% transparency from input color.

Parameters
[in]colorTransparent color component adjustment.
Returns
a color with alpha value set to 20% transparency.

◆ OnDelete()

override void SCR_DebugShapeHelperComponent.OnDelete ( IEntity owner)

Called when Entity is being to be destroyed (deleted) or component to be deleted (see Game.DeleteScriptComponent).

param[in] owner Entity which owns the component

◆ OnPostInit()

override void SCR_DebugShapeHelperComponent.OnPostInit ( IEntity owner)
protected
Parameters
[in]ownerThe owner represents the entity being initialized in the method, which is used to set event mask and clear debug elements.

◆ RemoveShape()

static void SCR_DebugShapeHelperComponent.RemoveShape ( notnull Managed shape,
string tag = "" )
static

Removes shape with given tag.

Parameters
[in]shapeRemoves shape with given tag from m_mTaggedShape array.
[in]tagTag is used to identify shapes for removal from the list.

◆ RemoveTag()

static void SCR_DebugShapeHelperComponent.RemoveTag ( string tag)
static

Removes specified tag from m_mTagedShape list.

Parameters
[in]tagRemoves tag from list of tagged shapes.

Member Data Documentation

◆ DEBUG_TAG

const string SCR_DebugShapeHelperComponent.DEBUG_TAG = "SCR_DebugShapeHelperComponent"
staticprotected

◆ DEFAULT_COLOUR

const int SCR_DebugShapeHelperComponent.DEFAULT_COLOUR = MakeTransparent(Color.YELLOW)
staticprotected

◆ DEFAULT_SHAPE_FLAGS

const ShapeFlags SCR_DebugShapeHelperComponent.DEFAULT_SHAPE_FLAGS = ShapeFlags.TRANSP | ShapeFlags.DOUBLESIDE | ShapeFlags.NOOUTLINE
staticprotected

◆ DEFAULT_SHAPE_FLAGS_NOZWRITE

const ShapeFlags SCR_DebugShapeHelperComponent.DEFAULT_SHAPE_FLAGS_NOZWRITE = ShapeFlags.TRANSP | ShapeFlags.DOUBLESIDE | ShapeFlags.NOOUTLINE | ShapeFlags.NOZWRITE
staticprotected

◆ DEFAULT_TEXT_FLAGS

const ShapeFlags SCR_DebugShapeHelperComponent.DEFAULT_TEXT_FLAGS = DebugTextFlags.CENTER | DebugTextFlags.FACE_CAMERA
staticprotected

◆ DEFAULT_TRIS_FLAGS

const ShapeFlags SCR_DebugShapeHelperComponent.DEFAULT_TRIS_FLAGS = ShapeFlags.TRANSP | ShapeFlags.DOUBLESIDE | ShapeFlags.NOZWRITE
staticprotected

◆ m_iShapeLimit

int SCR_DebugShapeHelperComponent.m_iShapeLimit

◆ s_bKeepDrawList

bool SCR_DebugShapeHelperComponent.s_bKeepDrawList
staticprotected

◆ s_Instance

SCR_DebugShapeHelperComponent SCR_DebugShapeHelperComponent.s_Instance
staticprotected

◆ s_iShapeLimit

int SCR_DebugShapeHelperComponent.s_iShapeLimit = 10000
staticprotected

◆ s_mTaggedShapes

ref map<string, ref array<ref Managed> > SCR_DebugShapeHelperComponent.s_mTaggedShapes = new map<string, ref array<ref Managed>>()
staticprotected

The documentation for this interface was generated from the following file: