![]() |
Nano Brain for Unity v0.1
|
3-dimensional vectors
This uses the right-handed coordinate system.
Public Member Functions | |
| Vector3Float (float horizontal, float vertical, float depth) | |
| Create a new 3-dimensional vector. | |
| Vector3Float (Vector3Int v) | |
| override string | ToString () |
| override readonly bool | Equals (object obj) |
| override readonly int | GetHashCode () |
Static Public Member Functions | |
| static Vector3Float | FromSpherical (Spherical s) |
| static float | MagnitudeOf (Vector3Float v) |
| The vector length. | |
| static float | SqrMagnitudeOf (Vector3Float v) |
| The squared vector length. | |
| static Vector3Float | Normalize (Vector3Float v) |
| Convert the vector to a length of 1. | |
| static Vector3Float | operator- (Vector3Float v1) |
| Negate te vector such that it points in the opposite direction. | |
| static Vector3Float | operator- (Vector3Float v1, Vector3Float v2) |
| Subtract two vectors. | |
| static Vector3Float | operator+ (Vector3Float v1, Vector3Float v2) |
| Add two vectors. | |
| static Vector3Float | Scale (Vector3Float v1, Vector3Float v2) |
| Scale the vector using another vector. | |
| static Vector3Float | operator* (Vector3Float v1, float d) |
| static Vector3Float | operator* (float d, Vector3Float v1) |
| static Vector3Float | operator/ (Vector3Float v1, float d) |
| static bool | operator== (Vector3Float v1, Vector3Float v2) |
| static bool | operator!= (Vector3Float v1, Vector3Float v2) |
| static float | Distance (Vector3Float v1, Vector3Float v2) |
| The distance between two vectors. | |
| static float | Dot (Vector3Float v1, Vector3Float v2) |
| The dot product of two vectors. | |
| static Vector3Float | Cross (Vector3Float v1, Vector3Float v2) |
| The cross product of two vectors. | |
| static Vector3Float | Project (Vector3Float v, Vector3Float n) |
| Project the vector on another vector. | |
| static Vector3Float | ProjectOnPlane (Vector3Float v, Vector3Float n) |
| Project the vector on a plane defined by a normal orthogonal to the plane. | |
| static AngleFloat | UnsignedAngle (Vector3Float v1, Vector3Float v2) |
| The angle between two vectors. | |
| static AngleFloat | SignedAngle (Vector3Float v1, Vector3Float v2, Vector3Float axis) |
| The signed angle between two vectors. | |
| static Vector3Float | Lerp (Vector3Float v1, Vector3Float v2, float f) |
| Lerp (linear interpolation) between two vectors. | |
Public Attributes | |
| float | horizontal |
| The right axis of the vector. | |
| float | vertical |
| The upward axis of the vector. | |
| float | depth |
| The forward axis of the vector. | |
Static Public Attributes | |
| static readonly Vector3Float | zero = new Vector3Float(0, 0, 0) |
| A vector with zero for all axis. | |
| static readonly Vector3Float | one = new Vector3Float(1, 1, 1) |
| A vector with one for all axis. | |
| static readonly Vector3Float | left = new Vector3Float(-1, 0, 0) |
| A Vector3Float with values (-1, 0, 0) | |
| static readonly Vector3Float | right = new Vector3Float(1, 0, 0) |
| A vector with values (1, 0, 0) | |
| static readonly Vector3Float | down = new Vector3Float(0, -1, 0) |
| A vector with values (0, -1, 0) | |
| static readonly Vector3Float | up = new Vector3Float(0, 1, 0) |
| A vector with values (0, 1, 0) | |
| static readonly Vector3Float | back = new Vector3Float(0, -1, 0) |
| A vector with values (0, 0, -1) | |
| static readonly Vector3Float | forward = new Vector3Float(0, 1, 0) |
| A vector with values (0, 0, 1) | |
Properties | |
| readonly float | magnitude [get] |
| The vector length. | |
| readonly float | sqrMagnitude [get] |
| The squared vector length. | |
| readonly Vector3Float | normalized [get] |
| Convert the vector to a length of 1. | |
| LinearAlgebra.Vector3Float.Vector3Float | ( | float | horizontal, |
| float | vertical, | ||
| float | depth | ||
| ) |
Create a new 3-dimensional vector.
| horizontal | x axis value |
| vertical | y axis value |
| depth | z axis value |
|
static |
The vector length.
| v | The vector for which you need the length |
|
static |
The squared vector length.
| v | The vector for which you need the squared length |
The squared length is computationally simpler than the real length. Think of Pythagoras A^2 + B^2 = C^2. This leaves out the calculation of the squared root of C.
|
static |
Convert the vector to a length of 1.
| v | The vector to convert |
|
static |
Negate te vector such that it points in the opposite direction.
| v1 |
|
static |
Subtract two vectors.
| v1 | |
| v2 |
|
static |
Add two vectors.
| v1 | |
| v2 |
|
static |
Scale the vector using another vector.
| v1 | The vector to scale |
| v2 | A vector with the scaling factors |
|
static |
The distance between two vectors.
| v1 | The first vector |
| v2 | The second vector |
|
static |
The dot product of two vectors.
| v1 | The first vector |
| v2 | The second vector |
|
static |
The cross product of two vectors.
| v1 | The first vector |
| v2 | The second vector |
|
static |
Project the vector on another vector.
| v | The vector to project |
| n | The normal vecto to project on |
|
static |
Project the vector on a plane defined by a normal orthogonal to the plane.
| v | The vector to project |
| n | The normal of the plane to project on |
|
static |
The angle between two vectors.
| v1 | The first vector |
| v2 | The second vector |
|
static |
The signed angle between two vectors.
| v1 | The starting vector |
| v2 | The ending vector |
| axis | The axis to rotate around |
|
static |
Lerp (linear interpolation) between two vectors.
| v1 | The starting vector |
| v2 | The ending vector |
| f | The interpolation distance |
|
get |
The vector length.
|
get |
The squared vector length.
|
get |
Convert the vector to a length of 1.