SVec4F
A 4-element structure.
Constructors
Method New(x:Float, y:Float, z:Float, w:Float)
Creates a new SVec4F from the supplied arguments.
Operators
Method Operator+:SVec4F(b:SVec4F)
Adds b to this vector, returning a new vector.
Method Operator-:SVec4F(b:SVec4F)
Subtracts b from this vector, returning a new vector.
Method Operator*:SVec4F(b:SVec4F)
Multiplies the vector by b, returning a new vector.
Method Operator/:SVec4F(b:SVec4F)
Devides the vector by b, returning a new vector.
Method Operator-:SVec4F()
Returns a negated version of this vector.
Method Operator*:SVec4F(s:Float)
Multiplies the vector by s, returning a new vector.
Method Operator/:SVec4F(s:Float)
Divides the vector by s, returning a new vector.
Method Operator[]:Float(index:Int)
Retrieves the x, y, z or w component using [0], [1], [2] or [3] respectively.
Method Operator<>:Int(b:SVec4F)
Returns True if b is different.
Method Operator=:Int(b:SVec4F)
Returns True if the vector and b are aproximately equal.
Methods
Method Clamp:SVec4F(minv:SVec4F, maxv:SVec4F)
Returns a vector clamped between the vectors minv and maxv.
Method Cross:SVec4F(b:SVec4F)
Returns the Cross Product of the two vectors.
A cross product of zero indicates that the two vectors are parallel.
Method Min:SVec4F(b:SVec4F)
Returns a vector that is made from the smallest components of the two vectors.
Method Max:SVec4F(b:SVec4F)
Returns a vector that is made from the largest components of the two vectors.
Method Interpolate:SVec4F(b:SVec4F, t:Float)
Linearly interpolates between two vectors.
Interpolates between this vector and b by the interpolant t. This is commonly used to find a point some fraction of the way along a line between two endpoints (e.g. to move an object gradually between those points).
Method Normal:SVec4F()
Returns a vector with a magnitude of 1.
When normalized, a vector keeps the same direction but its length is 1.0.
Method Dot:Float(b:SVec4F)
Returns the dot product of two vectors.
For normalized vectors Dot returns 1 if they point in exactly the same direction, -1 if they point in completely opposite directions, and a number in between for other cases (e.g. Dot returns zero if vectors are perpendicular).
Method Length:Float()
Returns the length of the vector.
Method LengthSquared:Float()
Returns the squared length of the vector.
Calculating the squared length instead of the length is much faster. Often if you are comparing lengths of two vectors you can just compare their squared lengths.
Method DistanceTo:Float(b:SVec4F)
Returns the distance between the vector and b.
Method DistanceToSquared:Float(b:SVec4F)
Returns the squared distance between the vector and b.
Method Reflect:SVec4F(n:SVec4F)
Returns a vector reflected from the given plane, specified by its normal vector.
Method ToString:String() Override
Returns a String representation of the vector.