Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_ShapeNextPointHelper Class Reference

Protected Member Functions

array< vectorGetAnchorPoints ()
array< intGetAnchorPointIndices ()
array< vectorGetTesselatedPoints ()
vector GetCurrentPosition ()
vector GetCurrentDirection ()
float GetShapeLength ()
float GetDoneShapeLength ()
float GetRemainingShapeLength ()
float CalculateCurrentSegmentIndex ()
float CalculateDoneLength ()
bool GetNextPoint (float distance, out vector result, int anchorLimit=-1, bool straightLine=true, bool doNotMove=false, bool xzMode=false)
float GetShapeDistanceToNextAnchor ()
float GetStraightDistanceToNextAnchor ()
bool SetOnAnchor (int anchorIndex)
bool IsValid ()
void Reset ()
 Reset to the beginning.
void SCR_ShapeNextPointHelper ()
 protected constructor - use CreateFrom* methods

Static Protected Member Functions

static SCR_ShapeNextPointHelper CreateFromPoints (notnull array< vector > anchorPoints, notnull array< vector > tesselatedPoints)
static SCR_ShapeNextPointHelper CreateFromShape (notnull ShapeEntity shapeEntity, bool reverse=false)

Protected Attributes

ref array< vectorm_aAnchorPoints
 format [anchor0, anchor1, anchor2]
ref array< vectorm_aTesselatedPoints
 format [anchor0, pointA0, pointB0, anchor1, pointA1, pointB1, anchor2]
ref array< intm_aAnchorPointIndices
 anchor indices in tesselated points
ref array< ref array< vector > > m_aSegments
 format [[segment0startPos, segment0endPos], [segment1startPos, segment1endPos]]
ref array< ref array< vector > > m_aSections
 format [[anchor0, tessPoint, tessPoint, anchor1], [anchor1, tessPoint, tessPoint, anchor2]]
int m_iSegmentsCount
 count of m_aSegments
int m_iAnchorPointsCount
 count of m_aAnchorPoints
int m_iCurrentSectionIndex
int m_iCurrentSectionPointIndex
int m_iCurrentSegmentIndex
vector m_vCurrentPosition
vector m_vCurrentDirection
float m_fDoneLength
float m_fTotalLength

Detailed Description

This helper provides the next point in shape's relative position

  • anchor points = points that define the shape (the ones draggable in Workbench)
  • tesselated points = all points of the shape (equals to anchor points for PolylineShapeEntity)
  • section = anchor to anchor - 1 tesselated points; [anchorA, tessPoint, tessPoint], [anchorB, tessPoint, tessPoint], etc
  • segment = straight line between two tesselated points
  • section point index = pointJ <= position < pointK = pointJ

Definition at line 11 of file SCR_ShapeNextPointHelper.c.

Constructor & Destructor Documentation

◆ SCR_ShapeNextPointHelper()

void SCR_ShapeNextPointHelper::SCR_ShapeNextPointHelper ( )
protected

protected constructor - use CreateFrom* methods

Member Function Documentation

◆ CalculateCurrentSegmentIndex()

float SCR_ShapeNextPointHelper::CalculateCurrentSegmentIndex ( )
inlineprotected

Definition at line 90 of file SCR_ShapeNextPointHelper.c.

◆ CalculateDoneLength()

float SCR_ShapeNextPointHelper::CalculateDoneLength ( )
inlineprotected

Definition at line 103 of file SCR_ShapeNextPointHelper.c.

◆ CreateFromPoints()

SCR_ShapeNextPointHelper SCR_ShapeNextPointHelper::CreateFromPoints ( notnull array< vector > anchorPoints,
notnull array< vector > tesselatedPoints )
inlinestaticprotected
Parameters
[in]anchorPointsshape's anchor points
[in]tesselatedPointsshape's tesselated points
Returns
a new instance or null on error (not enough points, anchor points not present in tesselated points, etc)

Definition at line 361 of file SCR_ShapeNextPointHelper.c.

◆ CreateFromShape()

SCR_ShapeNextPointHelper SCR_ShapeNextPointHelper::CreateFromShape ( notnull ShapeEntity shapeEntity,
bool reverse = false )
inlinestaticprotected
Parameters
[in]shapeEntity
[in]reverseinvert shape direction (from end to start instead of from start to end)
Returns

Definition at line 462 of file SCR_ShapeNextPointHelper.c.

◆ GetAnchorPointIndices()

array< int > SCR_ShapeNextPointHelper::GetAnchorPointIndices ( )
inlineprotected
Returns
anchor point tesselated indices

Definition at line 41 of file SCR_ShapeNextPointHelper.c.

◆ GetAnchorPoints()

array< vector > SCR_ShapeNextPointHelper::GetAnchorPoints ( )
inlineprotected
Returns
anchor points in shape's relative coordinates

Definition at line 34 of file SCR_ShapeNextPointHelper.c.

◆ GetCurrentDirection()

vector SCR_ShapeNextPointHelper::GetCurrentDirection ( )
inlineprotected
Returns
the normalised direction of the current position

Definition at line 62 of file SCR_ShapeNextPointHelper.c.

◆ GetCurrentPosition()

vector SCR_ShapeNextPointHelper::GetCurrentPosition ( )
inlineprotected
Returns
relative position

Definition at line 55 of file SCR_ShapeNextPointHelper.c.

◆ GetDoneShapeLength()

float SCR_ShapeNextPointHelper::GetDoneShapeLength ( )
inlineprotected
Returns

Definition at line 76 of file SCR_ShapeNextPointHelper.c.

◆ GetNextPoint()

bool SCR_ShapeNextPointHelper::GetNextPoint ( float distance,
out vector result,
int anchorLimit = -1,
bool straightLine = true,
bool doNotMove = false,
bool xzMode = false )
inlineprotected

Get the next point from the current position, but without going over the provided anchor index

Parameters
[in]distance
[out]resultthe requested point
[in]anchorLimit0-based anchor index before which the point must be found; -1 for no limit
[in]straightLine[NOT IMPLEMENTED, straight line only] if true, find in straight line distance; if false, finds in shape length (following the shape)
[in]doNotMoveif true, get the next point without internally moving (next Get will start from the previous position)
[in]xzModelook for a 2D distance from the existing point
Returns
true on success, false on failure

Definition at line 129 of file SCR_ShapeNextPointHelper.c.

◆ GetRemainingShapeLength()

float SCR_ShapeNextPointHelper::GetRemainingShapeLength ( )
inlineprotected
Returns

Definition at line 83 of file SCR_ShapeNextPointHelper.c.

◆ GetShapeDistanceToNextAnchor()

float SCR_ShapeNextPointHelper::GetShapeDistanceToNextAnchor ( )
inlineprotected
Returns
shape distance (following curve) from the current point to the next anchor

Definition at line 251 of file SCR_ShapeNextPointHelper.c.

◆ GetShapeLength()

float SCR_ShapeNextPointHelper::GetShapeLength ( )
inlineprotected
Returns

Definition at line 69 of file SCR_ShapeNextPointHelper.c.

◆ GetStraightDistanceToNextAnchor()

float SCR_ShapeNextPointHelper::GetStraightDistanceToNextAnchor ( )
inlineprotected
Returns
straight distance (not following curve) from the current point to the next anchor

Definition at line 271 of file SCR_ShapeNextPointHelper.c.

◆ GetTesselatedPoints()

array< vector > SCR_ShapeNextPointHelper::GetTesselatedPoints ( )
inlineprotected
Returns
tesselated points in shape's relative coordinates

Definition at line 48 of file SCR_ShapeNextPointHelper.c.

◆ IsValid()

bool SCR_ShapeNextPointHelper::IsValid ( )
inlineprotected
Returns
true if the provided shape is valid (more than one point and with some length), false otherwise

Definition at line 341 of file SCR_ShapeNextPointHelper.c.

◆ Reset()

void SCR_ShapeNextPointHelper::Reset ( )
inlineprotected

Reset to the beginning.

Definition at line 348 of file SCR_ShapeNextPointHelper.c.

◆ SetOnAnchor()

bool SCR_ShapeNextPointHelper::SetOnAnchor ( int anchorIndex)
inlineprotected

Sets to the provided anchor's position

Parameters
[in]anchorIndexthe index of the anchor - while useless, it is possible to set it to the last point
Returns
true on success, false on failure

Definition at line 283 of file SCR_ShapeNextPointHelper.c.

Member Data Documentation

◆ m_aAnchorPointIndices

ref array<int> SCR_ShapeNextPointHelper::m_aAnchorPointIndices
protected

anchor indices in tesselated points

Definition at line 15 of file SCR_ShapeNextPointHelper.c.

◆ m_aAnchorPoints

ref array<vector> SCR_ShapeNextPointHelper::m_aAnchorPoints
protected

format [anchor0, anchor1, anchor2]

Definition at line 13 of file SCR_ShapeNextPointHelper.c.

◆ m_aSections

ref array<ref array<vector> > SCR_ShapeNextPointHelper::m_aSections
protected

format [[anchor0, tessPoint, tessPoint, anchor1], [anchor1, tessPoint, tessPoint, anchor2]]

Definition at line 17 of file SCR_ShapeNextPointHelper.c.

◆ m_aSegments

ref array<ref array<vector> > SCR_ShapeNextPointHelper::m_aSegments
protected

format [[segment0startPos, segment0endPos], [segment1startPos, segment1endPos]]

Definition at line 16 of file SCR_ShapeNextPointHelper.c.

◆ m_aTesselatedPoints

ref array<vector> SCR_ShapeNextPointHelper::m_aTesselatedPoints
protected

format [anchor0, pointA0, pointB0, anchor1, pointA1, pointB1, anchor2]

Definition at line 14 of file SCR_ShapeNextPointHelper.c.

◆ m_fDoneLength

float SCR_ShapeNextPointHelper::m_fDoneLength
protected

Definition at line 29 of file SCR_ShapeNextPointHelper.c.

◆ m_fTotalLength

float SCR_ShapeNextPointHelper::m_fTotalLength
protected

Definition at line 30 of file SCR_ShapeNextPointHelper.c.

◆ m_iAnchorPointsCount

int SCR_ShapeNextPointHelper::m_iAnchorPointsCount
protected

count of m_aAnchorPoints

Definition at line 20 of file SCR_ShapeNextPointHelper.c.

◆ m_iCurrentSectionIndex

int SCR_ShapeNextPointHelper::m_iCurrentSectionIndex
protected

Definition at line 23 of file SCR_ShapeNextPointHelper.c.

◆ m_iCurrentSectionPointIndex

int SCR_ShapeNextPointHelper::m_iCurrentSectionPointIndex
protected

Definition at line 24 of file SCR_ShapeNextPointHelper.c.

◆ m_iCurrentSegmentIndex

int SCR_ShapeNextPointHelper::m_iCurrentSegmentIndex
protected

Definition at line 25 of file SCR_ShapeNextPointHelper.c.

◆ m_iSegmentsCount

int SCR_ShapeNextPointHelper::m_iSegmentsCount
protected

count of m_aSegments

Definition at line 19 of file SCR_ShapeNextPointHelper.c.

◆ m_vCurrentDirection

vector SCR_ShapeNextPointHelper::m_vCurrentDirection
protected

Definition at line 27 of file SCR_ShapeNextPointHelper.c.

◆ m_vCurrentPosition

vector SCR_ShapeNextPointHelper::m_vCurrentPosition
protected

Definition at line 26 of file SCR_ShapeNextPointHelper.c.


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