◆ AnglesToVector()
proto external vector vector.AnglesToVector |
( |
| ) |
|
Converts spherical coordinates (yaw, pitch, roll in degrees) to unit length vector.
- Returns
normalized
direction vector
>> <0.707107,0,0.707107>
>> <0.12941,0.866025,0.482963>
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
proto external vector AnglesToVector()
Converts spherical coordinates (yaw, pitch, roll in degrees) to unit length vector.
◆ Direction()
Returns direction vector from point p1 to point p2.
- Parameters
-
p1 | vector point from |
p2 | vector point to |
- Returns
vector
direction vector
◆ Distance()
Returns the distance between tips of two 3D vectors.
- Parameters
-
v1 | vector 3D Vector 1 |
v2 | vector 3D Vector 2 |
- Returns
float
Distance
>> dist = 5.19615
static proto float Distance(vector v1, vector v2)
Returns the distance between tips of two 3D vectors.
◆ DistanceSq()
Returns the squere distance between tips of two 3D vectors.
- Parameters
-
v1 | vector 3D Vector 1 |
v2 | vector 3D Vector 2 |
- Returns
float
Squere distance
>> dist = 25
static proto float DistanceSq(vector v1, vector v2)
Returns the squere distance between tips of two 3D vectors.
◆ DistanceSqXZ()
◆ DistanceXZ()
◆ Dot()
Returns Dot product of vector v1 and vector v2.
- Parameters
-
v1 | vector input vector |
v2 | vector input vector |
- Returns
float
dot product
◆ DotXZ()
◆ FromYaw()
Returns vector of yaw (in XZ plane)
- Parameters
-
yaw | float Value of yaw (in degrees) |
- Returns
vector
Yaw converted in vector (in XZ plane)
>> <1,0,0>
>> <0.707107,0,0.707107>
static proto vector FromYaw(float yaw)
Returns vector of yaw (in XZ plane)
◆ InvMultiply3()
Invert-transforms vector.
- Parameters
-
- Returns
- Transformed vector
vector mat[3] = {
"1.5 2.5 0",
"0.1 1.3 0",
"0 0 1" };
>> <4,1.4,1>
proto external vector InvMultiply3(vector mat[3])
Invert-transforms vector.
◆ InvMultiply4()
Invert-transforms position.
- Parameters
-
- Returns
- transformed position
vector mat[4] = {
"1 0 0 0",
"0 1 0 0",
"0 0 1 1",
"3 1 2 1" };
>> <-2,0,-1>
proto external vector InvMultiply4(vector mat[4])
Invert-transforms position.
◆ Length()
proto external float vector.Length |
( |
| ) |
|
Returns length of vector (magnitude)
- Returns
float
Length of vector
>> length = 1.41421
proto external float Length()
Returns length of vector (magnitude)
◆ LengthSq()
proto external float vector.LengthSq |
( |
| ) |
|
Returns squared length (magnitudeSqr)
- Returns
float
Length of vector
>> length = 2
proto external float LengthSq()
Returns squared length (magnitudeSqr)
◆ Lerp()
Lerp between two vectors.
proto native vector Vector(float x, float y, float z)
Vector constructor from components.
static proto vector Lerp(vector v1, vector v2, float t)
Lerp between two vectors.
◆ MapAngles()
proto external vector vector.MapAngles |
( |
float |
fFromRange = 360 , |
|
|
float |
fToLow = -180 , |
|
|
float |
fToHigh = 180 |
|
) |
| |
Re-map angles from one range to another.
- Returns
float
re-maped angles vector angles =
"-45 190 160";
>> <-0.785398,-2.96706,2.79253>
static const float PI
Definition: Math.c:17
proto external vector MapAngles(float fFromRange=360, float fToLow=-180, float fToHigh=180)
Re-map angles from one range to another.
◆ Multiply3()
Transforms vector.
- Parameters
-
- Returns
- transformed vector
vector mat[3] = {
"2 0 0",
"0 3 0",
"0 0 1" };
>> <2,3,1>
proto external vector Multiply3(vector mat[3])
Transforms vector.
◆ Multiply4()
Transforms position.
- Parameters
-
- Returns
- transformed position
vector mat[4] = {
"1 0 0 0",
"0 1 0 0",
"0 0 1 1",
"3 1 2 1" };
>> <4,2,3>
proto external vector Multiply4(vector mat[4])
Transforms position.
◆ Normalize()
proto external void vector.Normalize |
( |
| ) |
|
Normalizes vector.
>> vec = <0.707107,0,0.707107>
proto external void Normalize()
Normalizes vector.
◆ Normalized()
proto external vector vector.Normalized |
( |
| ) |
|
return normalized vector (keeps the orginal vector untouched)
◆ NormalizeSize()
proto external float vector.NormalizeSize |
( |
| ) |
|
Normalizes vector.
Returns its length.
- Warning
- Slower than calling Normalize() because additional calculations are necessary. Use Normalize() if the vector length is not needed.
- Returns
float
Length of origin vector
>> vec = <0.707107,0,0.707107>
>> length = 1.41421
proto external float NormalizeSize()
Normalizes vector.
◆ Perpend()
proto external vector vector.Perpend |
( |
| ) |
|
Returns perpendicular vector.
Perpendicular vector is computed as cross product between input vector and up vector (0, 1, 0).
- Returns
vector
perpendicular vector
>> <0,0,1>
proto external vector Perpend()
Returns perpendicular vector.
◆ QuatFromAngles()
proto external void vector.QuatFromAngles |
( |
out float |
quat[4] | ) |
|
Create quaternion from angles (yaw pitch roll in degrees)
float q[4];
>> {-0.316402,0.484465,-0.241626,0.778973}
proto external void QuatFromAngles(out float quat[4])
Create quaternion from angles (yaw pitch roll in degrees)
◆ ToString()
proto external string vector.ToString |
( |
bool |
beautify = true | ) |
|
◆ ToYaw()
proto external float vector.ToYaw |
( |
| ) |
|
Returns yaw of vector (use XZ plane).
- Returns
- Yaw of vector in degrees
>> 90
>> 45
proto external float ToYaw()
Returns yaw of vector (use XZ plane).
◆ VectorToAngles()
proto external vector vector.VectorToAngles |
( |
| ) |
|
Converts vector to spherical coordinates with radius = 1.
- Returns
vector
spherical coordinates (yaw, pitch, roll in degrees)
>> <45,-0,0>
>> <45,35.2644,0>
proto external vector VectorToAngles()
Converts vector to spherical coordinates with radius = 1.
◆ Forward
const vector vector.Forward = "0 0 1" |
|
static |
◆ One
const vector vector.One = "1 1 1" |
|
static |
◆ Right
const vector vector.Right = "1 0 0" |
|
static |
◆ Up
const vector vector.Up = "0 1 0" |
|
static |
◆ Zero
const vector vector.Zero = "0 0 0" |
|
static |
The documentation for this interface was generated from the following file:
- Core/generated/Types/vector.c