Arma Reforger Script API
Loading...
Searching...
No Matches
SCR_ShapeNextPointHelper Interface Reference

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

Public Member Functions

array< vector > GetAnchorPoints ()
 
array< int > GetAnchorPointIndices ()
 
array< vector > GetTesselatedPoints ()
 
vector GetCurrentPosition ()
 
vector GetCurrentDirection ()
 
float GetShapeLength ()
 
float GetDoneShapeLength ()
 
float GetRemainingShapeLength ()
 
bool GetNextPoint (float distance, out vector result, int anchorLimit=-1, bool straightLine=true, bool doNotMove=false, bool xzMode=false)
 Get the next point from the current position, but without going over the provided anchor index.
 
float GetStraightDistanceToNextAnchor ()
 
bool SetOnAnchor (int anchorIndex)
 Sets to the provided anchor's position.
 
bool IsValid ()
 
void Reset ()
 Reset to the beginning.
 

Static Public 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 Member Functions

float CalculateCurrentSegmentIndex ()
 
float CalculateDoneLength ()
 
float GetShapeDistanceToNextAnchor ()
 
void SCR_ShapeNextPointHelper ()
 protected constructor - use CreateFrom* methods
 

Protected Attributes

ref array< vector > m_aAnchorPoints
 format [anchor0, anchor1, anchor2]
 
ref array< vector > m_aTesselatedPoints
 format [anchor0, pointA0, pointB0, anchor1, pointA1, pointB1, anchor2]
 
ref array< int > m_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

Constructor & Destructor Documentation

◆ SCR_ShapeNextPointHelper()

void SCR_ShapeNextPointHelper.SCR_ShapeNextPointHelper ( )
protected

protected constructor - use CreateFrom* methods

Member Function Documentation

◆ CalculateCurrentSegmentIndex()

float SCR_ShapeNextPointHelper.CalculateCurrentSegmentIndex ( )
protected

◆ CalculateDoneLength()

float SCR_ShapeNextPointHelper.CalculateDoneLength ( )
protected

◆ CreateFromPoints()

static SCR_ShapeNextPointHelper SCR_ShapeNextPointHelper.CreateFromPoints ( notnull array< vector > anchorPoints,
notnull array< vector > tesselatedPoints )
static
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)

◆ CreateFromShape()

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

◆ GetAnchorPointIndices()

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

◆ GetAnchorPoints()

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

◆ GetCurrentDirection()

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

◆ GetCurrentPosition()

vector SCR_ShapeNextPointHelper.GetCurrentPosition ( )
Returns

◆ GetDoneShapeLength()

float SCR_ShapeNextPointHelper.GetDoneShapeLength ( )
Returns

◆ GetNextPoint()

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

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

◆ GetRemainingShapeLength()

float SCR_ShapeNextPointHelper.GetRemainingShapeLength ( )
Returns

◆ GetShapeDistanceToNextAnchor()

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

◆ GetShapeLength()

float SCR_ShapeNextPointHelper.GetShapeLength ( )
Returns

◆ GetStraightDistanceToNextAnchor()

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

◆ GetTesselatedPoints()

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

◆ IsValid()

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

◆ Reset()

void SCR_ShapeNextPointHelper.Reset ( )

Reset to the beginning.

◆ SetOnAnchor()

bool SCR_ShapeNextPointHelper.SetOnAnchor ( int anchorIndex)

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

Member Data Documentation

◆ m_aAnchorPointIndices

ref array<int> SCR_ShapeNextPointHelper.m_aAnchorPointIndices
protected

anchor indices in tesselated points

◆ m_aAnchorPoints

ref array<vector> SCR_ShapeNextPointHelper.m_aAnchorPoints
protected

format [anchor0, anchor1, anchor2]

◆ m_aSections

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

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

◆ m_aSegments

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

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

◆ m_aTesselatedPoints

ref array<vector> SCR_ShapeNextPointHelper.m_aTesselatedPoints
protected

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

◆ m_fDoneLength

float SCR_ShapeNextPointHelper.m_fDoneLength
protected

◆ m_fTotalLength

float SCR_ShapeNextPointHelper.m_fTotalLength
protected

◆ m_iAnchorPointsCount

int SCR_ShapeNextPointHelper.m_iAnchorPointsCount
protected

count of m_aAnchorPoints

◆ m_iCurrentSectionIndex

int SCR_ShapeNextPointHelper.m_iCurrentSectionIndex
protected

◆ m_iCurrentSectionPointIndex

int SCR_ShapeNextPointHelper.m_iCurrentSectionPointIndex
protected

◆ m_iCurrentSegmentIndex

int SCR_ShapeNextPointHelper.m_iCurrentSegmentIndex
protected

◆ m_iSegmentsCount

int SCR_ShapeNextPointHelper.m_iSegmentsCount
protected

count of m_aSegments

◆ m_vCurrentDirection

vector SCR_ShapeNextPointHelper.m_vCurrentDirection
protected

◆ m_vCurrentPosition

vector SCR_ShapeNextPointHelper.m_vCurrentPosition
protected

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