Endstar LUA API Documentation
|
A utility class for generating Vector3s! A Vector3 is three floats together. Often used for position or rotation. Try using this with Visuals.SetLocalRotation! More...
Public Member Functions | |
UnityEngine.Vector3 | Create (float x, float y, float z) |
Creates a Vector3 containing the specified X, Y, and Z components. | |
UnityEngine.Vector3 | Add (UnityEngine.Vector3 lhs, UnityEngine.Vector3 rhs) |
Given two vectors, adds them together component wise and returns the resulting vector. IE: new Vector3(lhs.x+rhs.x, lhs.y+rhs.y, lhs.z+rhs.z) | |
UnityEngine.Vector3 | Scale (UnityEngine.Vector3 vector, float scalar) |
Given a vector and a scalar float, multiplies the vector components by the float and returns the scaled vector. | |
UnityEngine.Vector3 | Lerp (UnityEngine.Vector3 a, UnityEngine.Vector3 b, float t) |
Linearly interpolates from A, to B, based on a 0..1 percentage (t) | |
UnityEngine.Vector3 | Cross (UnityEngine.Vector3 lhs, UnityEngine.Vector3 rhs) |
Returns the cross product vector of LHS and RHS. The cross product is always perpendicular to the LHS and RHS. Ordering of LHS and RHS matter, and flipping the values will yield a different cross product. | |
float | Dot (UnityEngine.Vector3 lhs, UnityEngine.Vector3 rhs) |
Returns the dot product of LHS and RHS. When LHS and RHS are normalized the dot product indicates how aligned the two vectors are, with -1 being opposite parallel, 0 being perpendicular, and 1 being aligned parallel. | |
UnityEngine.Vector3 | Normalize (UnityEngine.Vector3 vec) |
Takes a vector and normalizes so that the vector has a magnitude of 1, and neither the X, Y, or Z components will exceed one. Normalizing a vector is very useful, especially when comparing dot products to see how aligned two vectors are for gameplay purposes. | |
UnityEngine.Vector3 | Reflect (UnityEngine.Vector3 inDirection, UnityEngine.Vector3 inNormal) |
Takes a directional vector and a normal, and returns a vector that is the mirror reflection of the direction vector. | |
UnityEngine.Vector3 | Scale (UnityEngine.Vector3 a, UnityEngine.Vector3 b) |
Multiplies the components of two vectors, ie: a.x * b.x, a.y * b.y, a.z * b.z. Returns a vector with those multiplied components in their respective component. | |
UnityEngine.Vector3 | MoveTowards (UnityEngine.Vector3 current, UnityEngine.Vector3 target, float maxDistanceDelta) |
Similar to lerp, given Current and Target vectors, will move current towards target by up to maxDistanceDelta. Unlike lerp, the two vectors are not absolute origin or end points and maxDistanceDelta is not expected to be between 0 and 1. | |
UnityEngine.Vector3 | Project (UnityEngine.Vector3 vector, UnityEngine.Vector3 onNormal) |
Given a Vector and a Normal, returns a vector that represents how much of the vector is aligned with the normal, along the normal. | |
UnityEngine.Vector3 | RotateTowardsDegrees (UnityEngine.Vector3 current, UnityEngine.Vector3 target, float maxDegreesDelta, float maxMagnitudeDelta) |
Given a current and target vector, rotates current to align with target with controls for the maximum degree rotation and maximum change in vector size. Operates on Degrees, not Radians. | |
UnityEngine.Vector3 | RotateTowardsRadians (UnityEngine.Vector3 current, UnityEngine.Vector3 target, float maxRadiansDelta, float maxMagnitudeDelta) |
Given a current and target vector, rotates current to align with target with controls for the maximum radian rotation and maximum change in vector size. Operates on Radians, not Degrees. | |
float | Angle (UnityEngine.Vector3 from, UnityEngine.Vector3 to) |
Determines the unsigned angle between two vectors. This angle will never be negative, for negative angles see SignedAngle | |
float | SignedAngle (UnityEngine.Vector3 from, UnityEngine.Vector3 to, UnityEngine.Vector3 axis) |
Determines the signed angle between two vectors. | |
float | Distance (UnityEngine.Vector3 a, UnityEngine.Vector3 b) |
Given two vectors representing points, returns the distance between those two points. | |
float | Magnitude (UnityEngine.Vector3 vector) |
Returns the length of the vector. Performs costly square root operations, for length based operations that don't need precise measurements but relative measurements, SqrMagnitude | |
float | SqrMagnitude (UnityEngine.Vector3 vector) |
Returns the squared length of the vector. Useful when you want to compare relative sizes (which point is closer between A -> B and A -> C,without concern for specific distance). For getting the specific exact distance, Magnitude | |
UnityEngine.Vector3 | Min (UnityEngine.Vector3 lhs, UnityEngine.Vector3 rhs) |
Returns a Vector composed of the smallest components between LHS and RHS. | |
UnityEngine.Vector3 | Max (UnityEngine.Vector3 lhs, UnityEngine.Vector3 rhs) |
Returns a Vector composed of the largest components between LHS and RHS. | |
A utility class for generating Vector3s! A Vector3 is three floats together. Often used for position or rotation. Try using this with Visuals.SetLocalRotation!
UnityEngine.Vector3 Add | ( | UnityEngine.Vector3 | lhs, |
UnityEngine.Vector3 | rhs ) |
Given two vectors, adds them together component wise and returns the resulting vector. IE: new Vector3(lhs.x+rhs.x, lhs.y+rhs.y, lhs.z+rhs.z)
lhs | |
rhs |
float Angle | ( | UnityEngine.Vector3 | from, |
UnityEngine.Vector3 | to ) |
Determines the unsigned angle between two vectors. This angle will never be negative, for negative angles see SignedAngle
from | |
to |
UnityEngine.Vector3 Create | ( | float | x, |
float | y, | ||
float | z ) |
UnityEngine.Vector3 Cross | ( | UnityEngine.Vector3 | lhs, |
UnityEngine.Vector3 | rhs ) |
Returns the cross product vector of LHS and RHS. The cross product is always perpendicular to the LHS and RHS. Ordering of LHS and RHS matter, and flipping the values will yield a different cross product.
lhs | |
rhs |
float Distance | ( | UnityEngine.Vector3 | a, |
UnityEngine.Vector3 | b ) |
Given two vectors representing points, returns the distance between those two points.
a | |
b |
float Dot | ( | UnityEngine.Vector3 | lhs, |
UnityEngine.Vector3 | rhs ) |
Returns the dot product of LHS and RHS. When LHS and RHS are normalized the dot product indicates how aligned the two vectors are, with -1 being opposite parallel, 0 being perpendicular, and 1 being aligned parallel.
lhs | |
rhs |
UnityEngine.Vector3 Lerp | ( | UnityEngine.Vector3 | a, |
UnityEngine.Vector3 | b, | ||
float | t ) |
Linearly interpolates from A, to B, based on a 0..1 percentage (t)
a | The 0 value of t |
b | The 1 value of t |
t | How far between A and B. This value is expected to be between 0 and 1, with 0 returning A, 1 returning B, and values in between returning a value between A and B. |
float Magnitude | ( | UnityEngine.Vector3 | vector | ) |
Returns the length of the vector. Performs costly square root operations, for length based operations that don't need precise measurements but relative measurements, SqrMagnitude
vector |
UnityEngine.Vector3 Max | ( | UnityEngine.Vector3 | lhs, |
UnityEngine.Vector3 | rhs ) |
Returns a Vector composed of the largest components between LHS and RHS.
lhs | |
rhs |
UnityEngine.Vector3 Min | ( | UnityEngine.Vector3 | lhs, |
UnityEngine.Vector3 | rhs ) |
Returns a Vector composed of the smallest components between LHS and RHS.
lhs | |
rhs |
UnityEngine.Vector3 MoveTowards | ( | UnityEngine.Vector3 | current, |
UnityEngine.Vector3 | target, | ||
float | maxDistanceDelta ) |
Similar to lerp, given Current and Target vectors, will move current towards target by up to maxDistanceDelta. Unlike lerp, the two vectors are not absolute origin or end points and maxDistanceDelta is not expected to be between 0 and 1.
current | |
target | |
maxDistanceDelta |
UnityEngine.Vector3 Normalize | ( | UnityEngine.Vector3 | vec | ) |
Takes a vector and normalizes so that the vector has a magnitude of 1, and neither the X, Y, or Z components will exceed one. Normalizing a vector is very useful, especially when comparing dot products to see how aligned two vectors are for gameplay purposes.
vec |
UnityEngine.Vector3 Project | ( | UnityEngine.Vector3 | vector, |
UnityEngine.Vector3 | onNormal ) |
Given a Vector and a Normal, returns a vector that represents how much of the vector is aligned with the normal, along the normal.
vector | |
onNormal |
UnityEngine.Vector3 Reflect | ( | UnityEngine.Vector3 | inDirection, |
UnityEngine.Vector3 | inNormal ) |
Takes a directional vector and a normal, and returns a vector that is the mirror reflection of the direction vector.
inDirection | |
inNormal |
UnityEngine.Vector3 RotateTowardsDegrees | ( | UnityEngine.Vector3 | current, |
UnityEngine.Vector3 | target, | ||
float | maxDegreesDelta, | ||
float | maxMagnitudeDelta ) |
Given a current and target vector, rotates current to align with target with controls for the maximum degree rotation and maximum change in vector size. Operates on Degrees, not Radians.
current | |
target | |
maxDegreesDelta | |
maxMagnitudeDelta |
UnityEngine.Vector3 RotateTowardsRadians | ( | UnityEngine.Vector3 | current, |
UnityEngine.Vector3 | target, | ||
float | maxRadiansDelta, | ||
float | maxMagnitudeDelta ) |
Given a current and target vector, rotates current to align with target with controls for the maximum radian rotation and maximum change in vector size. Operates on Radians, not Degrees.
current | |
target | |
maxRadiansDelta | |
maxMagnitudeDelta |
UnityEngine.Vector3 Scale | ( | UnityEngine.Vector3 | a, |
UnityEngine.Vector3 | b ) |
Multiplies the components of two vectors, ie: a.x * b.x, a.y * b.y, a.z * b.z. Returns a vector with those multiplied components in their respective component.
a | |
b |
UnityEngine.Vector3 Scale | ( | UnityEngine.Vector3 | vector, |
float | scalar ) |
Given a vector and a scalar float, multiplies the vector components by the float and returns the scaled vector.
vector | |
scalar |
float SignedAngle | ( | UnityEngine.Vector3 | from, |
UnityEngine.Vector3 | to, | ||
UnityEngine.Vector3 | axis ) |
Determines the signed angle between two vectors.
from | |
to | |
axis |
float SqrMagnitude | ( | UnityEngine.Vector3 | vector | ) |
Returns the squared length of the vector. Useful when you want to compare relative sizes (which point is closer between A -> B and A -> C,without concern for specific distance). For getting the specific exact distance, Magnitude
vector |