VisimBox 1.0 VisimBox 3d simulation and visualisation ToolBox

- Main Page
- Packages
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Properties
VisiMath.Vector4 Struct Reference

Vector4 with float components. More...

List of all members.

## Public Member Functions
| Vector4 (float val)
| Basic constructor, constructs Vector4 with specified value for all fields.
| Vector4 (float x, float y, float z, float w)
| Constructs Vector4 from specified coordinates.
| Vector4 (Vector4 vec)
| Copy constructor.
| Vector4 (ref Vector4 vec)
| Fast copy constructor.
| Vector4 (ref Vector3 vec)
| Creates Vector4 from Vector3 (W = 1)
| Vector4 (ref Vector3 vec, float w)
| Creates Vector4 from Vector3.
| Vector4 (float[] field)
| Constructs Vector4 from float array.
| Vector4 (System.Xml.XmlReader reader)
| XML reader constructor.
void | Assing (float val)
| constructs Vector4 with specified value for all fields
void | Assign (float x, float y, float z, float w)
| Sets vector to specified values.
void | Assign (ref Vector4 vec)
| Sets vector as copy of source vector.
void | Assign (float[] field)
| Sets vector to values from float field.
void | MakeInvalid ()
| Makes Vector invalid by setting X component to float.NotANumber.
void | Invert ()
| Inverts vector.
void | Add (ref Vector4 vec)
| Adds specified vector to this vector - using ref for faster computing.
void | Add (Vector4 vec)
| Adds specified vector to this vector - using ref for faster computing.
void | Add (float x, float y, float z, float w)
| Adds values to this vector.
void | Substract (float x, float y, float z, float w)
| Substracts values from the vector.
void | Substract (ref Vector4 vec)
| Substracts specified vector from this vector - using ref for faster computing.
void | Substract (Vector4 vec)
| Substracts specified vector from this vector - using ref for faster computing.
void | Mul (float newscale)
| Multiplies vector by scalar value.
void | Divide (float div)
| Divides vector by the scalar value.
void | Normalize ()
| Normalizes vector. If length of the vector is zero, doesn't do anything.
void | NormalizeFast ()
| Fast normalization (less precission, usable for some operations.
void | Transform (ref Matrix3 mat)
| Transforms vector by rotational matrix.
void | Transform (ref Matrix4 mat)
| Transforms vector by homogenous matrix 4x4.
void | Clamp (ref Vector4 min, ref Vector4 max)
| Clamps values of the vector.
void | ClampMin (ref Vector4 min)
| Clamps values of the vector to minimal possible value.
void | ClampMax (ref Vector4 max)
| Clamps values of the vector to maximal possible value.
void | Interpolate (ref Vector4 target, float inter)
| Lineary interpolates vector to target vector.
bool | IsValid ()
| Checks validity of the vector.
bool | IsNormalized ()
| Returns true if vector is normalized.
float | Distance (ref Vector4 vec2)
| Returns distance to other vector.
float | DistanceFast (ref Vector4 vec2)
| Returns distance to other vector, fast but unacurrate version (good enough for distance checking)
float | DistanceSquared (ref Vector4 vec2)
| Returns squared distance to other vector, fast, for distance comparison.
float | Dot (ref Vector4 vec2)
| Dot product with another vector.
Vector4 | NormalizedCopy ()
| Returns normalized copy of this vector.
float | Angle (Vector4 v2)
| Computes angle between vectors.
float | AngleNorm (ref Vector4 v2)
| Computes angle between vectors, expects both vectors to be normalized!
override string | ToString ()
override int | GetHashCode ()
override bool | Equals (object obj)
bool | Equals (Vector4 other)
System.Xml.Schema.XmlSchema | GetSchema ()
| Reqired by IXMLserializable.
void | ReadXml (System.Xml.XmlReader reader)
| Deserializes object from XML.
void | WriteXml (System.Xml.XmlWriter writer)
| Serializes object to XML.
void | WriteXml (System.Xml.XmlWriter writer, string rootname)
| Serializes object to XML.
## Static Public Member Functions
static Vector4 | operator+ (Vector4 left, Vector4 right)
static Vector4 | operator- (Vector4 left, Vector4 right)
static Vector4 | operator- (Vector4 vec)
static Vector4 | operator* (Vector4 vec, float scale)
static Vector4 | operator* (float scale, Vector4 vec)
static Vector4 | operator/ (Vector4 vec, float scale)
static bool | operator== (Vector4 left, Vector4 right)
static bool | operator!= (Vector4 left, Vector4 right)
static bool | operator< (Vector4 left, Vector4 right)
| Compares magnitude of the vectors.
static bool | operator> (Vector4 left, Vector4 right)
| Compares magnitude of the vectors.
static bool | operator<= (Vector4 left, Vector4 right)
| Compares magnitude of the vectors.
static bool | operator>= (Vector4 left, Vector4 right)
| Compares magnitude of the vectors.
static float | Dot (ref Vector4 v1, ref Vector4 v2)
| Dot product of two vectors.
static Vector4 | Normalize (ref Vector4 v)
| Returns normalized copy of the vector.
static void | Add (ref Vector4 v1, ref Vector4 v2, out Vector4 res)
| Adds two vectors and sets res with result.
static Vector4 | Add (ref Vector4 v1, ref Vector4 v2)
| Adds two vectors and returns result.
static void | Substract (ref Vector4 v1, ref Vector4 v2, out Vector4 res)
| Substracts two vectors and sets res with result.
static Vector4 | Substract (ref Vector4 v1, ref Vector4 v2)
| Substracts two vectors and returns result.
static void | Mul (ref Vector4 v1, float newscale, out Vector4 res)
| Multiplies vector by scalar value and sets result to res.
static Vector4 | Mul (ref Vector4 v1, float newscale)
| Multiplies vector by scalar value and returns result.
static Vector4 | Divide (ref Vector4 v1, float div)
| Divides vector by scalar value and returns result.
static void | Divide (ref Vector4 v1, float div, out Vector4 res)
| Divides vector by scalar value and returns result.
static void | Clamp (ref Vector4 v1, ref Vector4 min, ref Vector4 max, out Vector4 res)
| Clamps value of the vector to minimum and maximum.
static void | ClampMin (ref Vector4 v1, ref Vector4 min, out Vector4 res)
| Clamps value of the vector to minimum.
static void | ClampMax (ref Vector4 v1, ref Vector4 max, out Vector4 res)
| Clamps value of the vector to maximum.
static Vector4 | Clamp (ref Vector4 v1, ref Vector4 min, ref Vector4 max)
| Clamps value of the vector to minimum and maximum.
static Vector4 | ClampMin (Vector4 v1, ref Vector4 min)
| Clamps value of the vector to minimum.
static Vector4 | ClampMax (Vector4 v1, ref Vector4 max)
| Clamps value of the vector to maximum.
static void | Interpolate (ref Vector4 source, ref Vector4 target, float inter, out Vector4 result)
| Lineary interpolates vector to target vector.
static Vector4 | Interpolate (ref Vector4 source, ref Vector4 target, float inter)
| Lineary interpolates vector to target vector.
## Public Attributes
float | X
| X value of the vector.
float | Y
| Y value of the vector.
float | Z
| Z value of the vector.
float | W
| W value of the vector.
## Static Public Attributes
static readonly Vector4 | UnitX = new Vector4(1, 0, 0, 0)
| Defines a unit-length Vector4 that points towards the X-axis.
static readonly Vector4 | UnitY = new Vector4(0, 1, 0, 0)
| Defines a unit-length Vector4 that points towards the Y-axis.
static readonly Vector4 | UnitZ = new Vector4(0, 0, 1, 0)
| / Defines a unit-length Vector4 that points towards the Z-axis.
static readonly Vector4 | UnitW = new Vector4(0, 0, 0, 1)
| / Defines a unit-length Vector4 that points towards the W-axis.
static readonly Vector4 | Zero = new Vector4(0, 0, 0, 0)
| Defines a zero-length Vector4.
static readonly Vector4 | One = new Vector4(1, 1, 1, 1)
| Defines an instance with all components set to 1.
static readonly Vector4 | Invalid = new Vector4(float.NaN)
| Invalid vector.
static readonly int | SizeInBytes = Marshal.SizeOf(new Vector4())
| Defines the size of the Vector4 struct in bytes.
## Properties
float[] | Array`[get, set]`
| Property for the vector as an float array.
Vector3 | XYZ`[get, set]`
| Vector3 component of vector4.
float | this[int index]`[get, set]`
| An index accessor Maps index [0] -> X, [1] -> Y and [2] -> Z.
float | Length`[get, set]`
| Vector length.
float | LengthFast`[get]`
| Fast but imprecisse vector length.
float | LengthSquared`[get]`
| Squared lenght for fast distance comparison.

## Detailed Description

Vector4 with float components.

## Constructor & Destructor Documentation

VisiMath.Vector4.Vector4 | ( | float | val | ) |

Basic constructor, constructs Vector4 with specified value for all fields.

VisiMath.Vector4.Vector4 | ( | float | x,
|  | float | y,
|  | float | z,
|  | float | w
| ) |  |

Constructs Vector4 from specified coordinates.

Parameters:

  x | X coordinate
  y | Y coordinate
  z | Z coordinate

VisiMath.Vector4.Vector4 | ( | Vector4 | vec | ) |

Copy constructor.

Parameters:

  vec | Source value

VisiMath.Vector4.Vector4 | ( | ref Vector4 | vec | ) |

Fast copy constructor.

Parameters:

  vec | Source value

VisiMath.Vector4.Vector4 | ( | ref Vector3 | vec | ) |

Creates Vector4 from Vector3 (W = 1)

Parameters:

  vec | Source value

VisiMath.Vector4.Vector4 | ( | ref Vector3 | vec,
|  | float | w
| ) |  |

Creates Vector4 from Vector3.

Parameters:

  vec | Source value

VisiMath.Vector4.Vector4 | ( | float[] | field | ) |

Constructs Vector4 from float array.

Exceptions:

  System.ArgumentException | Thrown if argument doesn't have at least 4 components

Parameters:

  field | float array with values, must have at least 4 elements

VisiMath.Vector4.Vector4 | ( | System.Xml.XmlReader | reader | ) |

XML reader constructor.

Parameters:

  reader | XML reader

## Member Function Documentation

void VisiMath.Vector4.Add | ( | ref Vector4 | vec | ) |

Adds specified vector to this vector - using ref for faster computing.

Parameters:

  vec | operand

void VisiMath.Vector4.Add | ( | Vector4 | vec | ) |

Adds specified vector to this vector - using ref for faster computing.

Parameters:

  vec | operand

Use ref overloaded version where possible, it's faster

void VisiMath.Vector4.Add | ( | float | x,
|  | float | y,
|  | float | z,
|  | float | w
| ) |  |

Adds values to this vector.

static void VisiMath.Vector4.Add | ( | ref Vector4 | v1,
|  | ref Vector4 | v2,
|  | out Vector4 | res
| ) |  | `[static]`

Adds two vectors and sets res with result.

Parameters:

  v1 | first operand
  v2 | second operand
  res | vector to save the result

static Vector4 VisiMath.Vector4.Add | ( | ref Vector4 | v1,
|  | ref Vector4 | v2
| ) |  | `[static]`

Adds two vectors and returns result.

Parameters:

  v1 | first operand
  v2 | second operand

Returns:
  v1+v2

float VisiMath.Vector4.Angle | ( | Vector4 | v2 | ) |

Computes angle between vectors.

Parameters:

  v2 | second operand

Returns:
  Angle between this and v2 in radians

float VisiMath.Vector4.AngleNorm | ( | ref Vector4 | v2 | ) |

Computes angle between vectors, expects both vectors to be normalized!

Parameters:

  v2 | second operand

Returns:
  Angle between this and v2 (both must be normalized vectors) in radians

void VisiMath.Vector4.Assign | ( | float[] | field | ) |

Sets vector to values from float field.

Exceptions:

  System.ArgumentException | Thrown if argument doesn't have at least 4 components

Parameters:

  field | Source values, must have at least 4 elements

void VisiMath.Vector4.Assign | ( | float | x,
|  | float | y,
|  | float | z,
|  | float | w
| ) |  |

Sets vector to specified values.

Parameters:

  x | X value
  y | Y value
  z | Z value

void VisiMath.Vector4.Assign | ( | ref Vector4 | vec | ) |

Sets vector as copy of source vector.

Parameters:

  vec | source vector

void VisiMath.Vector4.Assing | ( | float | val | ) |

constructs Vector4 with specified value for all fields

Parameters:

  val | value for all fields

void VisiMath.Vector4.Clamp | ( | ref Vector4 | min,
|  | ref Vector4 | max
| ) |  |

Clamps values of the vector.

Parameters:

  min | Minimal possible value
  max | Maximal possible value

static void VisiMath.Vector4.Clamp | ( | ref Vector4 | v1,
|  | ref Vector4 | min,
|  | ref Vector4 | max,
|  | out Vector4 | res
| ) |  | `[static]`

Clamps value of the vector to minimum and maximum.

Parameters:

  v1 | Vector to be clamped
  min | Minimal allowed values
  max | Maximal allowed values
  res | Ouput vector

static Vector4 VisiMath.Vector4.Clamp | ( | ref Vector4 | v1,
|  | ref Vector4 | min,
|  | ref Vector4 | max
| ) |  | `[static]`

Clamps value of the vector to minimum and maximum.

Parameters:

  v1 | Vector to be clamped
  min | Minimal allowed values
  max | Maximal allowed values

Returns:
  Clamped vector

void VisiMath.Vector4.ClampMax | ( | ref Vector4 | max | ) |

Clamps values of the vector to maximal possible value.

Parameters:

  max |

static void VisiMath.Vector4.ClampMax | ( | ref Vector4 | v1,
|  | ref Vector4 | max,
|  | out Vector4 | res
| ) |  | `[static]`

Clamps value of the vector to maximum.

Parameters:

  v1 | Vector to be clamped
  max | Maximal allowed values
  res | Ouput vector

static Vector4 VisiMath.Vector4.ClampMax | ( | Vector4 | v1,
|  | ref Vector4 | max
| ) |  | `[static]`

Clamps value of the vector to maximum.

Parameters:

  v1 | Vector to be clamped
  max | Maximal allowed values

Returns:
  Clamped vector

static Vector4 VisiMath.Vector4.ClampMin | ( | Vector4 | v1,
|  | ref Vector4 | min
| ) |  | `[static]`

Clamps value of the vector to minimum.

Parameters:

  v1 | Vector to be clamped
  min | Minimal allowed values

Returns:
  Clamped vector

void VisiMath.Vector4.ClampMin | ( | ref Vector4 | min | ) |

Clamps values of the vector to minimal possible value.

Parameters:

  min |

static void VisiMath.Vector4.ClampMin | ( | ref Vector4 | v1,
|  | ref Vector4 | min,
|  | out Vector4 | res
| ) |  | `[static]`

Clamps value of the vector to minimum.

Parameters:

  v1 | Vector to be clamped
  min | Minimal allowed values
  res | Ouput vector

float VisiMath.Vector4.Distance | ( | ref Vector4 | vec2 | ) |

Returns distance to other vector.

Parameters:

  vec2 | Vector to measure the distance

Returns:
  Distance between this and vec2

float VisiMath.Vector4.DistanceFast | ( | ref Vector4 | vec2 | ) |

Returns distance to other vector, fast but unacurrate version (good enough for distance checking)

Parameters:

  vec2 | Vector to measure the distance

Returns:
  Distance between this and vec2

float VisiMath.Vector4.DistanceSquared | ( | ref Vector4 | vec2 | ) |

Returns squared distance to other vector, fast, for distance comparison.

Parameters:

  vec2 | Vector to measure the distance

Returns:
  Distance between this and vec2

static void VisiMath.Vector4.Divide | ( | ref Vector4 | v1,
|  | float | div,
|  | out Vector4 | res
| ) |  | `[static]`

Divides vector by scalar value and returns result.

Parameters:

  v1 | Vector
  div | scalar
  res | Vector to save the result to

static Vector4 VisiMath.Vector4.Divide | ( | ref Vector4 | v1,
|  | float | div
| ) |  | `[static]`

Divides vector by scalar value and returns result.

Parameters:

  v1 | Vector
  div | scalar

Returns:
  v1/div

void VisiMath.Vector4.Divide | ( | float | div | ) |

Divides vector by the scalar value.

Parameters:

  div | scalar value

static float VisiMath.Vector4.Dot | ( | ref Vector4 | v1,
|  | ref Vector4 | v2
| ) |  | `[static]`

Dot product of two vectors.

Parameters:

  v1 | first operand
  v2 | second operand

Returns:
  Dot product of the vectors

float VisiMath.Vector4.Dot | ( | ref Vector4 | vec2 | ) |

Dot product with another vector.

Parameters:

  vec2 | Second vector

Returns:
  Dot product

override bool VisiMath.Vector4.Equals | ( | object | obj | ) |

bool VisiMath.Vector4.Equals | ( | Vector4 | other | ) |

override int VisiMath.Vector4.GetHashCode | ( |  | ) |

System.Xml.Schema.XmlSchema VisiMath.Vector4.GetSchema | ( |  | ) |

Reqired by IXMLserializable.

Returns:
  Null

void VisiMath.Vector4.Interpolate | ( | ref Vector4 | target,
|  | float | inter
| ) |  |

Lineary interpolates vector to target vector.

Parameters:

  target | Target vector
  inter | Interpolation value, assumes (0-1)

static Vector4 VisiMath.Vector4.Interpolate | ( | ref Vector4 | source,
|  | ref Vector4 | target,
|  | float | inter
| ) |  | `[static]`

Lineary interpolates vector to target vector.

Parameters:

  source | Source vector
  target | Target vector
  inter | Interpolation value, assumes (0-1)

Returns:

static void VisiMath.Vector4.Interpolate | ( | ref Vector4 | source,
|  | ref Vector4 | target,
|  | float | inter,
|  | out Vector4 | result
| ) |  | `[static]`

Lineary interpolates vector to target vector.

Parameters:

  source | Source vector
  target | Target vector
  inter | Interpolation value, assumes (0-1)
  result | Vector to save result to

void VisiMath.Vector4.Invert | ( |  | ) |

Inverts vector.

bool VisiMath.Vector4.IsNormalized | ( |  | ) |

Returns true if vector is normalized.

Returns:

bool VisiMath.Vector4.IsValid | ( |  | ) |

Checks validity of the vector.

Returns:
  True if vector.X is not notanumber

void VisiMath.Vector4.MakeInvalid | ( |  | ) |

Makes Vector invalid by setting X component to float.NotANumber.

void VisiMath.Vector4.Mul | ( | float | newscale | ) |

Multiplies vector by scalar value.

Parameters:

  newscale | Scalar value

static void VisiMath.Vector4.Mul | ( | ref Vector4 | v1,
|  | float | newscale,
|  | out Vector4 | res
| ) |  | `[static]`

Multiplies vector by scalar value and sets result to res.

Parameters:

  v1 | vector
  newscale | scalar
  res | Vector to save result to

static Vector4 VisiMath.Vector4.Mul | ( | ref Vector4 | v1,
|  | float | newscale
| ) |  | `[static]`

Multiplies vector by scalar value and returns result.

Parameters:

  v1 | vector
  newscale | scalar

Returns:
  V1*newscale

void VisiMath.Vector4.Normalize | ( |  | ) |

Normalizes vector. If length of the vector is zero, doesn't do anything.

static Vector4 VisiMath.Vector4.Normalize | ( | ref Vector4 | v | ) | `[static]`

Returns normalized copy of the vector.

Parameters:

  v | operand

Returns:
  Normalized copy of v

Vector4 VisiMath.Vector4.NormalizedCopy | ( |  | ) |

Returns normalized copy of this vector.

Returns:
  Normalized copy

void VisiMath.Vector4.NormalizeFast | ( |  | ) |

Fast normalization (less precission, usable for some operations.

static bool VisiMath.Vector4.operator!= | ( | Vector4 | left,
|  | Vector4 | right
| ) |  | `[static]`

static Vector4 VisiMath.Vector4.operator* | ( | Vector4 | vec,
|  | float | scale
| ) |  | `[static]`

static Vector4 VisiMath.Vector4.operator* | ( | float | scale,
|  | Vector4 | vec
| ) |  | `[static]`

static Vector4 VisiMath.Vector4.operator+ | ( | Vector4 | left,
|  | Vector4 | right
| ) |  | `[static]`

static Vector4 VisiMath.Vector4.operator- | ( | Vector4 | left,
|  | Vector4 | right
| ) |  | `[static]`

static Vector4 VisiMath.Vector4.operator- | ( | Vector4 | vec | ) | `[static]`

static Vector4 VisiMath.Vector4.operator/ | ( | Vector4 | vec,
|  | float | scale
| ) |  | `[static]`

static bool VisiMath.Vector4.operator< | ( | Vector4 | left,
|  | Vector4 | right
| ) |  | `[static]`

Compares magnitude of the vectors.

Parameters:

  left | left operand
  right | right operand

Returns:
  True if left operand's lenght is smaller than right

static bool VisiMath.Vector4.operator<= | ( | Vector4 | left,
|  | Vector4 | right
| ) |  | `[static]`

Compares magnitude of the vectors.

Parameters:

  left | left operand
  right | right operand

Returns:
  True if left operand's lenght is equal or smaller than right

static bool VisiMath.Vector4.operator== | ( | Vector4 | left,
|  | Vector4 | right
| ) |  | `[static]`

static bool VisiMath.Vector4.operator> | ( | Vector4 | left,
|  | Vector4 | right
| ) |  | `[static]`

Compares magnitude of the vectors.

Parameters:

  left | left operand
  right | right operand

Returns:
  True if left operand's lenght is bigger than right

static bool VisiMath.Vector4.operator>= | ( | Vector4 | left,
|  | Vector4 | right
| ) |  | `[static]`

Compares magnitude of the vectors.

Parameters:

  left | left operand
  right | right operand

Returns:
  True if left operand's lenght is equal or bigger than right

void VisiMath.Vector4.ReadXml | ( | System.Xml.XmlReader | reader | ) |

Deserializes object from XML.

Parameters:

  reader | XML reader

void VisiMath.Vector4.Substract | ( | ref Vector4 | vec | ) |

Substracts specified vector from this vector - using ref for faster computing.

Parameters:

  vec | operand

static void VisiMath.Vector4.Substract | ( | ref Vector4 | v1,
|  | ref Vector4 | v2,
|  | out Vector4 | res
| ) |  | `[static]`

Substracts two vectors and sets res with result.

Parameters:

  v1 | first operand
  v2 | second operand
  res | vector to save the result

void VisiMath.Vector4.Substract | ( | float | x,
|  | float | y,
|  | float | z,
|  | float | w
| ) |  |

Substracts values from the vector.

void VisiMath.Vector4.Substract | ( | Vector4 | vec | ) |

Substracts specified vector from this vector - using ref for faster computing.

Parameters:

  vec | operand

Use ref overloaded version where possible, it's faster

static Vector4 VisiMath.Vector4.Substract | ( | ref Vector4 | v1,
|  | ref Vector4 | v2
| ) |  | `[static]`

Substracts two vectors and returns result.

Parameters:

  v1 | first operand
  v2 | second operand
  res | v1-v2

Returns:

override string VisiMath.Vector4.ToString | ( |  | ) |

void VisiMath.Vector4.Transform | ( | ref Matrix4 | mat | ) |

Transforms vector by homogenous matrix 4x4.

Parameters:

  mat | Matrix

void VisiMath.Vector4.Transform | ( | ref Matrix3 | mat | ) |

Transforms vector by rotational matrix.

Parameters:

  mat | Rotational matrix

void VisiMath.Vector4.WriteXml | ( | System.Xml.XmlWriter | writer,
|  | string | rootname
| ) |  |

Serializes object to XML.

Parameters:

  writer | XML writer to save values
  rootname | Node to save value to

void VisiMath.Vector4.WriteXml | ( | System.Xml.XmlWriter | writer | ) |

Serializes object to XML.

Parameters:

  writer | XML writer to save values

## Member Data Documentation

readonly Vector4 VisiMath.Vector4.Invalid = new Vector4(float.NaN)`[static]`

Invalid vector.

readonly Vector4 VisiMath.Vector4.One = new Vector4(1, 1, 1, 1)`[static]`

Defines an instance with all components set to 1.

readonly int VisiMath.Vector4.SizeInBytes = Marshal.SizeOf(new Vector4())`[static]`

Defines the size of the Vector4 struct in bytes.

readonly Vector4 VisiMath.Vector4.UnitW = new Vector4(0, 0, 0, 1)`[static]`

/ Defines a unit-length Vector4 that points towards the W-axis.

readonly Vector4 VisiMath.Vector4.UnitX = new Vector4(1, 0, 0, 0)`[static]`

Defines a unit-length Vector4 that points towards the X-axis.

readonly Vector4 VisiMath.Vector4.UnitY = new Vector4(0, 1, 0, 0)`[static]`

Defines a unit-length Vector4 that points towards the Y-axis.

readonly Vector4 VisiMath.Vector4.UnitZ = new Vector4(0, 0, 1, 0)`[static]`

/ Defines a unit-length Vector4 that points towards the Z-axis.

float VisiMath.Vector4.W

W value of the vector.

float VisiMath.Vector4.X

X value of the vector.

float VisiMath.Vector4.Y

Y value of the vector.

float VisiMath.Vector4.Z

Z value of the vector.

readonly Vector4 VisiMath.Vector4.Zero = new Vector4(0, 0, 0, 0)`[static]`

Defines a zero-length Vector4.

## Property Documentation

float [] VisiMath.Vector4.Array`[get, set]`

Property for the vector as an float array.

Exceptions:

  System.ArgumentException | Thrown if argument doesnt have at least 4 components

float VisiMath.Vector4.Length`[get, set]`

Vector length.

Exceptions:

  System.ArgumentOutOfRangeException | Thrown if new desired length is below zero
  System.ArgumentException | Thrown if vector is zero vector.

float VisiMath.Vector4.LengthFast`[get]`

Fast but imprecisse vector length.

float VisiMath.Vector4.LengthSquared`[get]`

Squared lenght for fast distance comparison.

float VisiMath.Vector4.this[int index]`[get, set]`

An index accessor Maps index [0] -> X, [1] -> Y and [2] -> Z.

Parameters:

  index | The array index referring to a component within the vector (i.e. x, y, z)

Exceptions:

  System.ArgumentException | Thrown if the array argument isn't between 0 and 3

Vector3 VisiMath.Vector4.XYZ`[get, set]`

Vector3 component of vector4.

The documentation for this struct was generated from the following file:

- Vector4.cs

All Classes Namespaces Files Functions Variables Enumerations Properties Events