Vector3 Vector3 Struct

Definition

Represents a 3D vector using three single-precision floating-point numbers.

[System.Serializable]
public struct Vector3 : IEquatable<OpenTK.Vector3>
type Vector3 = struct
Inheritance
Vector3Vector3
Attributes
Implements

Remarks

The Vector3 structure is suitable for interoperation with unmanaged code requiring three consecutive floats.

Constructors

Vector3(Vector2) Vector3(Vector2)

Constructs a new Vector3 from the given Vector2.

Vector3(Vector3) Vector3(Vector3)

Constructs a new Vector3 from the given Vector3.

Vector3(Vector4) Vector3(Vector4)

Constructs a new Vector3 from the given Vector4.

Vector3(Single) Vector3(Single)
Vector3(Single, Single, Single) Vector3(Single, Single, Single)

Constructs a new Vector3.

Fields

One One

Defines an instance with all components set to 1.

SizeInBytes SizeInBytes

Defines the size of the Vector3 struct in bytes.

UnitX UnitX

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

UnitY UnitY

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

UnitZ UnitZ

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

X X

The X component of the Vector3.

Y Y

The Y component of the Vector3.

Z Z

The Z component of the Vector3.

Zero Zero

Defines a zero-length Vector3.

Properties

Length Length

Gets the length (magnitude) of the vector.

LengthFast LengthFast

Gets an approximation of the vector length (magnitude).

LengthSquared LengthSquared

Gets the square of the vector length (magnitude).

Xy Xy

Gets or sets an OpenTK.Vector2 with the X and Y components of this instance.

Methods

Add(Vector3) Add(Vector3)

Add the Vector passed as parameter to this instance.

Add(Vector3) Add(Vector3)

Add the Vector passed as parameter to this instance.

Add(Vector3, Vector3) Add(Vector3, Vector3)
Add(Vector3, Vector3, Vector3) Add(Vector3, Vector3, Vector3)

Add two Vectors

BaryCentric(Vector3, Vector3, Vector3, Single, Single, Vector3) BaryCentric(Vector3, Vector3, Vector3, Single, Single, Vector3)
BaryCentric(Vector3, Vector3, Vector3, Single, Single) BaryCentric(Vector3, Vector3, Vector3, Single, Single)
CalculateAngle(Vector3, Vector3) CalculateAngle(Vector3, Vector3)

Calculates the angle (in radians) between two vectors.

CalculateAngle(Vector3, Vector3, Single) CalculateAngle(Vector3, Vector3, Single)
Clamp(Vector3, Vector3, Vector3) Clamp(Vector3, Vector3, Vector3)
Clamp(Vector3, Vector3, Vector3, Vector3) Clamp(Vector3, Vector3, Vector3, Vector3)

Clamp a vector to the given minimum and maximum vectors

ComponentMax(Vector3, Vector3) ComponentMax(Vector3, Vector3)
ComponentMax(Vector3, Vector3, Vector3) ComponentMax(Vector3, Vector3, Vector3)

Calculate the component-wise maximum of two vectors

ComponentMin(Vector3, Vector3) ComponentMin(Vector3, Vector3)
ComponentMin(Vector3, Vector3, Vector3) ComponentMin(Vector3, Vector3, Vector3)

Calculate the component-wise minimum of two vectors

Cross(Vector3, Vector3, Vector3) Cross(Vector3, Vector3, Vector3)

Caclulate the cross (vector) product of two vectors

Cross(Vector3, Vector3) Cross(Vector3, Vector3)
Div(Vector3, Single) Div(Vector3, Single)
Div(Vector3, Single, Vector3) Div(Vector3, Single, Vector3)
Div(Single) Div(Single)

Divide this instance by a scalar.

Divide(Vector3, Vector3) Divide(Vector3, Vector3)
Divide(Vector3, Single) Divide(Vector3, Single)
Divide(Vector3, Vector3, Vector3) Divide(Vector3, Vector3, Vector3)
Divide(Vector3, Single, Vector3) Divide(Vector3, Single, Vector3)
Dot(Vector3, Vector3) Dot(Vector3, Vector3)

Calculate the dot (scalar) product of two vectors

Dot(Vector3, Vector3, Single) Dot(Vector3, Vector3, Single)
Equals(Vector3) Equals(Vector3)

Indicates whether the current vector is equal to another vector.

Equals(Object) Equals(Object)

Indicates whether this instance and a specified object are equal.

GetHashCode() GetHashCode()

Returns the hashcode for this instance.

Lerp(Vector3, Vector3, Single) Lerp(Vector3, Vector3, Single)
Lerp(Vector3, Vector3, Single, Vector3) Lerp(Vector3, Vector3, Single, Vector3)
Max(Vector3, Vector3) Max(Vector3, Vector3)
Min(Vector3, Vector3) Min(Vector3, Vector3)
Mult(Single) Mult(Single)

Multiply this instance by a scalar.

Mult(Vector3, Single) Mult(Vector3, Single)
Mult(Vector3, Single, Vector3) Mult(Vector3, Single, Vector3)
Multiply(Vector3, Vector3, Vector3) Multiply(Vector3, Vector3, Vector3)
Multiply(Vector3, Single, Vector3) Multiply(Vector3, Single, Vector3)
Multiply(Vector3, Vector3) Multiply(Vector3, Vector3)
Multiply(Vector3, Single) Multiply(Vector3, Single)
Normalize(Vector3, Vector3) Normalize(Vector3, Vector3)

Scale a vector to unit length

Normalize() Normalize()

Scales the Vector3 to unit length.

Normalize(Vector3) Normalize(Vector3)
NormalizeFast() NormalizeFast()

Scales the Vector3 to approximately unit length.

NormalizeFast(Vector3) NormalizeFast(Vector3)
NormalizeFast(Vector3, Vector3) NormalizeFast(Vector3, Vector3)

Scale a vector to approximately unit length

Scale(Vector3) Scale(Vector3)

Scales this instance by the given parameter.

Scale(Vector3) Scale(Vector3)

Scales this instance by the given parameter.

Scale(Single, Single, Single) Scale(Single, Single, Single)

Scales the current Vector3 by the given amounts.

Sub(Vector3) Sub(Vector3)

Subtract the Vector passed as parameter from this instance.

Sub(Vector3) Sub(Vector3)

Subtract the Vector passed as parameter from this instance.

Sub(Vector3, Vector3) Sub(Vector3, Vector3)
Sub(Vector3, Vector3, Vector3) Sub(Vector3, Vector3, Vector3)

Subtract one Vector from another

Subtract(Vector3, Vector3) Subtract(Vector3, Vector3)
Subtract(Vector3, Vector3, Vector3) Subtract(Vector3, Vector3, Vector3)
ToString() ToString()

Returns a System.String that represents the current Vector3.

Transform(Vector3, Matrix4) Transform(Vector3, Matrix4)
Transform(Vector3, Quaternion) Transform(Vector3, Quaternion)
Transform(Vector3, Matrix4, Vector3) Transform(Vector3, Matrix4, Vector3)
Transform(Vector3, Matrix4, Vector4) Transform(Vector3, Matrix4, Vector4)

Transform a Vector by the given Matrix

Transform(Vector3, Quaternion, Vector3) Transform(Vector3, Quaternion, Vector3)
TransformNormal(Vector3, Matrix4) TransformNormal(Vector3, Matrix4)
TransformNormal(Vector3, Matrix4, Vector3) TransformNormal(Vector3, Matrix4, Vector3)

Transform a Normal by the given Matrix

TransformNormalInverse(Vector3, Matrix4) TransformNormalInverse(Vector3, Matrix4)
TransformNormalInverse(Vector3, Matrix4, Vector3) TransformNormalInverse(Vector3, Matrix4, Vector3)

Transform a Normal by the (transpose of the) given Matrix

TransformPerspective(Vector3, Matrix4, Vector3) TransformPerspective(Vector3, Matrix4, Vector3)

Transform a Vector3 by the given Matrix, and project the resulting Vector4 back to a Vector3

TransformPerspective(Vector3, Matrix4) TransformPerspective(Vector3, Matrix4)
TransformPosition(Vector3, Matrix4) TransformPosition(Vector3, Matrix4)
TransformPosition(Vector3, Matrix4, Vector3) TransformPosition(Vector3, Matrix4, Vector3)

Transform a Position by the given Matrix

TransformVector(Vector3, Matrix4) TransformVector(Vector3, Matrix4)
TransformVector(Vector3, Matrix4, Vector3) TransformVector(Vector3, Matrix4, Vector3)

Transform a direction vector by the given Matrix Assumes the matrix has a bottom row of (0,0,0,1), that is the translation part is ignored.

Operators

Addition(Vector3, Vector3) Addition(Vector3, Vector3)
Division(Vector3, Single) Division(Vector3, Single)
Equality(Vector3, Vector3) Equality(Vector3, Vector3)
Inequality(Vector3, Vector3) Inequality(Vector3, Vector3)
Multiply(Vector3, Single) Multiply(Vector3, Single)
Multiply(Single, Vector3) Multiply(Single, Vector3)
Subtraction(Vector3, Vector3) Subtraction(Vector3, Vector3)
UnaryNegation(Vector3) UnaryNegation(Vector3)

Applies to