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

Static Protected Member Functions

static bool CartesianToPolar (float x, float y, out float angle, out float radius)
static bool PolarToCartesian (float angle, float radius, out float x, out float y)
static float DegreeToTrigoRadian (float value)
static bool GetLinesIntersectionXZ (float x0, float y0, float angleRad0, float x1, float y1, float angleRad1, out float x, out float y)
static vector GenerateRandomPoint (array< float > polygon, vector bbMin, vector bbMax)
static vector GenerateRandomPointInRadius (float minRadius, float maxRadius, vector center, bool uniform=true)

Detailed Description

SCR_Math2D Class

Contains various scripted 2D math functions

Definition at line 4 of file SCR_Math2D.c.

Member Function Documentation

◆ CartesianToPolar()

bool SCR_Math2D::CartesianToPolar ( float x,
float y,
out float angle,
out float radius )
inlinestaticprotected

Translates cartesian coordinates (x,y) into polar (angle and radius)

Parameters
[in]x
[in]y
[out]anglein radian
[out]radius
Returns
true

Definition at line 206 of file SCR_Math2D.c.

◆ DegreeToTrigoRadian()

float SCR_Math2D::DegreeToTrigoRadian ( float value)
inlinestaticprotected

Get a counter-clockwise radian angle value from clockwise angles

Parameters
[in]valueangle in clockwise degrees
Returns
[0..Math.PI2[ counter-clockwise value

Definition at line 251 of file SCR_Math2D.c.

◆ GenerateRandomPoint()

vector SCR_Math2D::GenerateRandomPoint ( array< float > polygon,
vector bbMin,
vector bbMax )
inlinestaticprotected

Generates random point in given polygon

Parameters
[in]polygonConsecutive floats give polygon in 2D (2 floats = Vector2)
[in]bbMinBounding box minimum corner
[in]bbMaxBounding box maximum corner
Returns
Vector3 point in polygon

Definition at line 379 of file SCR_Math2D.c.

◆ GenerateRandomPointInRadius()

vector SCR_Math2D::GenerateRandomPointInRadius ( float minRadius,
float maxRadius,
vector center,
bool uniform = true )
inlinestaticprotected

Generates a random point around center in range min/max radius

Parameters
[in]minRadiusAll generated points will be at least this far from center
[in]maxRadiusAll generated points will be at most this far from center
[in]centerPosition around which to generate. Vector2 XZ
[in]uniformIf false, has a small bias towards the center which may be desirable in some situations
Returns
Vector2 XZ set, Y = 0

Definition at line 392 of file SCR_Math2D.c.

◆ GetLinesIntersectionXZ()

bool SCR_Math2D::GetLinesIntersectionXZ ( float x0,
float y0,
float angleRad0,
float x1,
float y1,
float angleRad1,
out float x,
out float y )
inlinestaticprotected
Parameters
[in]x0
[in]y0
[in]angleRad0counter-clockwise radians, range does not matter (no need for [0..Math.PI2[)
[in]x1
[in]y1
[in]angleRad1counter-clockwise radians, range does not matter (no need for [0..Math.PI2[)
[out]x
[out]y
Returns
true on intersection, false otherwise

Definition at line 342 of file SCR_Math2D.c.

◆ PolarToCartesian()

bool SCR_Math2D::PolarToCartesian ( float angle,
float radius,
out float x,
out float y )
inlinestaticprotected

Translates polar coordinates (angle and radius) into cartesian (x,y)

Parameters
[in]anglein radians
[in]radius
[out]x
[out]y
Returns
true

Definition at line 220 of file SCR_Math2D.c.


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