Arma Reforger Script API
|
Contains various scripted 3D math functions. More...
Static Public Member Functions | |
static vector | GetFixedAxisVector (vector toFlip) |
Flips X and Y axis of the vector. | |
static void | RotateTowards (out float result[4], float from[4], float to[4], float maxDegreesDelta) |
Rotates the input from rotation to the input to rotation by a maximum of maxDegreesDelta. | |
static vector | MoveTowards (vector start, vector target, float maxDistanceDelta) |
Moves a point start in a straight line towards a target point. | |
static vector | FixEulerVector (vector angles, float units=Math.PI) |
Ensures the angles are in range <-units; +units> | |
static vector | FixEulerVector180 (vector angles) |
Ensures the angles are in range <-180; +180> | |
static void | Extrapolate (IEntity entity, Physics physics, vector netPosition, vector netVelocityLinear, float netTeleportDistance, float netRotation[4], vector netVelocityAngular, float netTeleportAng, float timeSinceLastTick, float timeSlice, float netTickInterval) |
static vector | IntersectPlane (vector rayPos, vector rayVector, vector planePos, vector planeNormal) |
Get intersection between a line and a plane. | |
static bool | MatrixEqual (vector matrixA[4], vector matrixB[4]) |
Check if two matrices are equal. | |
static bool | IsMatrixEmpty (vector matrix[4]) |
Check if matrix is empty. | |
static bool | IsMatrixIdentity (vector matrix[4]) |
Check if matrix is identity matrix (right, up, forward, zero vectors) | |
static vector | Min (vector vA, vector vB) |
Return the smallest from each vector value. | |
static vector | Max (vector vA, vector vB) |
Return the largest from each vector value. | |
static float | GetDistanceFromSpline (notnull array< vector > points, vector point) |
Gets the shortest 3D distance between a point and a spline. | |
static float | GetDistanceFromSplineXZ (notnull array< vector > points, vector point) |
Gets the shortest 2D distance between a point and a spline. | |
static bool | IsPointWithinSplineDistance (notnull array< vector > points, vector point, float distance) |
Check if point is within provided 3D distance from the shape - faster than getting distance then comparing. | |
static bool | IsPointWithinSplineDistanceXZ (notnull array< vector > points, vector point, float distance) |
Check if point is within provided 2D distance from the shape - faster than getting distance then comparing. | |
static void | QuatAngleAxis (float angle, vector axis, out float quat[4]) |
Get a rotation that rotates angle (rad) around the provided axis. | |
static vector | QuatMultiply (float quat[4], vector vec) |
Rotates provided vector by given quaternion. | |
static void | RotateAround (vector transform[4], vector pivot, vector axis, float angle, out vector result[4]) |
Rotates a transformation around the provided pivot point by angle (rad) around the axis. | |
static void | LookAt (vector source, vector destination, vector up, out vector rotMat[4]) |
Returns a rotation matrix that makes object positioned at source position face the point at destination. | |
static vector | ClampMagnitude (vector v, float magnitude) |
Returns the provided vector clamped to desired magnitude. | |
Contains various scripted 3D math functions.
|
static |
Returns the provided vector clamped to desired magnitude.
[in] | v | Input vector |
[in] | magnitude | The magnitude to clamp at |
|
static |
[in] | entity | is the entity you want to be affected by extrapolation. |
[in] | physics | is the physics that the extrapolation should calculate with. |
[in] | netPosition | is the last received position. |
[in] | netVelocityLinear | is the last received velocity. |
[in] | netTeleportDistance | is the max distance between position and netPosition, anything over this causes the entity to teleport. |
[in] | netRotation | is the last received rotation. |
[in] | netVelocityAngular | is the last received angular velocity. |
[in] | netTeleportAng | is the max angle between current rotation and replicated rotation, anything over this causes the entity to teleport. |
[in] | timeSinceLastTick | is the time since last synchronization of extrapolation relevant data was received, it should already be incremented by timeSlice by you! |
[in] | timeSlice | is the time since last frame / simulation step. |
[in] | netTickInterval | must NOT be zero |
|
static |
Ensures the angles are in range <-units; +units>
[in] | angles | |
[in] | units |
|
static |
Ensures the angles are in range <-180; +180>
[in] | angles |
|
static |
Gets the shortest 3D distance between a point and a spline.
[in] | points | array of all points forming the spline, minimum 1 point |
[in] | point | point that is being checked |
|
static |
Gets the shortest 2D distance between a point and a spline.
[in] | points | array of all points forming the spline, minimum 1 point |
[in] | point | point that is being checked |
|
static |
Flips X and Y axis of the vector.
[in] | toFlip |
|
static |
Get intersection between a line and a plane.
[in] | rayPos | Ray intersection position |
[in] | rayVector | Ray intersection direction vector |
[in] | planePos | Plane position |
[in] | planeNormal | Plane normal vector |
|
static |
Check if matrix is empty.
[in] | matrix |
|
static |
Check if matrix is identity matrix (right, up, forward, zero vectors)
[in] | matrix |
|
static |
Check if point is within provided 3D distance from the shape - faster than getting distance then comparing.
[in] | points | the spline's points |
[in] | point | the position to check |
[in] | distance | the checked distance (should be positive) |
|
static |
Check if point is within provided 2D distance from the shape - faster than getting distance then comparing.
[in] | points | the spline's points |
[in] | point | the position to check |
[in] | distance | the checked distance (should be positive) |
|
static |
Returns a rotation matrix that makes object positioned at source position face the point at destination.
[in] | source | Source point the rotation looks 'from' |
[in] | destination | Target point the rotation looks 'at' |
[in] | up | Reference axis, start with 'vector.Up' if unsure |
[out] | rotMat | Output rotational matrix |
|
static |
Check if two matrices are equal.
[in] | matrixA | |
[in] | matrixB |
|
static |
Return the largest from each vector value.
[in] | vector | A |
[in] | vector | B |
|
static |
Return the smallest from each vector value.
[in] | vector | A |
[in] | vector | B |
|
static |
Moves a point start in a straight line towards a target point.
[in] | start | |
[in] | target | |
[in] | maxDistanceDelta |
|
static |
Get a rotation that rotates angle (rad) around the provided axis.
[in] | angle | Rotation angle in radians |
[in] | axis | The axis around which the rotation turns |
[out] | quat | Output quaternion |
|
static |
Rotates provided vector by given quaternion.
[in] | quat | Quaternion rotation to apply |
[in] | vec | Vector to rotate |
|
static |
Rotates a transformation around the provided pivot point by angle (rad) around the axis.
[in] | transform | Input transformation to rotate |
[in] | pivot | The point around which the transform rotates |
[in] | axis | The axis in which the rotation is applied |
[in] | angle | The applied angle in radians |
[out] | result | Rotated transformation |
|
static |
Rotates the input from rotation to the input to rotation by a maximum of maxDegreesDelta.
[out] | result | |
[in] | from | |
[in] | to | |
[in] | maxDegreesDelta |