Table of Contents

Class Vector3Helper

Namespace
HelixToolkit.Maths
Assembly
HelixToolkit.Maths.dll

Represents a three dimensional mathematical vector.

public static class Vector3Helper
Inheritance
Vector3Helper
Inherited Members

Fields

BackwardLH

A unit Vector3 designating backward in a left-handed coordinate system (0, 0, -1).

public static readonly Vector3 BackwardLH

Field Value

Vector3

BackwardRH

A unit Vector3 designating backward in a right-handed coordinate system (0, 0, 1).

public static readonly Vector3 BackwardRH

Field Value

Vector3

Down

A unit Vector3 designating down (0, -1, 0).

public static readonly Vector3 Down

Field Value

Vector3

ForwardLH

A unit Vector3 designating forward in a left-handed coordinate system (0, 0, 1).

public static readonly Vector3 ForwardLH

Field Value

Vector3

ForwardRH

A unit Vector3 designating forward in a right-handed coordinate system (0, 0, -1).

public static readonly Vector3 ForwardRH

Field Value

Vector3

Left

A unit Vector3 designating left (-1, 0, 0).

public static readonly Vector3 Left

Field Value

Vector3

One

A Vector3 with all of its components set to one.

public static readonly Vector3 One

Field Value

Vector3

Right

A unit Vector3 designating right (1, 0, 0).

public static readonly Vector3 Right

Field Value

Vector3

SizeInBytes

The size of the Vector3 type, in bytes.

public static readonly int SizeInBytes

Field Value

int

UnitX

The X unit Vector3 (1, 0, 0).

public static readonly Vector3 UnitX

Field Value

Vector3

UnitY

The Y unit Vector3 (0, 1, 0).

public static readonly Vector3 UnitY

Field Value

Vector3

UnitZ

The Z unit Vector3 (0, 0, 1).

public static readonly Vector3 UnitZ

Field Value

Vector3

Up

A unit Vector3 designating up (0, 1, 0).

public static readonly Vector3 Up

Field Value

Vector3

Zero

A Vector3 with all of its components set to zero.

public static readonly Vector3 Zero

Field Value

Vector3

Methods

AngleBetween(Vector3, Vector3)

Calculates the angle (in radians) between two vectors.

public static float AngleBetween(this Vector3 vector1, Vector3 vector2)

Parameters

vector1 Vector3

The first vector.

vector2 Vector3

The second vector.

Returns

float

The angle (in radians) between the vectors.

Remarks

Note that the returned angle is never bigger than the constant PI.

AnyInfinity(Vector3)

public static bool AnyInfinity(this Vector3 vector)

Parameters

vector Vector3

Returns

bool

AnyUndefined(Vector3)

Determines whether any components of the vector are undefined (NaN).

public static bool AnyUndefined(this Vector3 vector)

Parameters

vector Vector3

The vector.

Returns

bool

true if the vector has at least one undefined component; otherwise, false.

Barycentric(Vector3, Vector3, Vector3, float, float)

Returns a Vector3 containing the 3D Cartesian coordinates of a point specified in Barycentric coordinates relative to a 3D triangle.

public static Vector3 Barycentric(Vector3 value1, Vector3 value2, Vector3 value3, float amount1, float amount2)

Parameters

value1 Vector3

A Vector3 containing the 3D Cartesian coordinates of vertex 1 of the triangle.

value2 Vector3

A Vector3 containing the 3D Cartesian coordinates of vertex 2 of the triangle.

value3 Vector3

A Vector3 containing the 3D Cartesian coordinates of vertex 3 of the triangle.

amount1 float

Barycentric coordinate b2, which expresses the weighting factor toward vertex 2 (specified in value2).

amount2 float

Barycentric coordinate b3, which expresses the weighting factor toward vertex 3 (specified in value3).

Returns

Vector3

A new Vector3 containing the 3D Cartesian coordinates of the specified point.

Barycentric(ref Vector3, ref Vector3, ref Vector3, float, float, out Vector3)

Returns a Vector3 containing the 3D Cartesian coordinates of a point specified in Barycentric coordinates relative to a 3D triangle.

public static void Barycentric(ref Vector3 value1, ref Vector3 value2, ref Vector3 value3, float amount1, float amount2, out Vector3 result)

Parameters

value1 Vector3

A Vector3 containing the 3D Cartesian coordinates of vertex 1 of the triangle.

value2 Vector3

A Vector3 containing the 3D Cartesian coordinates of vertex 2 of the triangle.

value3 Vector3

A Vector3 containing the 3D Cartesian coordinates of vertex 3 of the triangle.

amount1 float

Barycentric coordinate b2, which expresses the weighting factor toward vertex 2 (specified in value2).

amount2 float

Barycentric coordinate b3, which expresses the weighting factor toward vertex 3 (specified in value3).

result Vector3

When the method completes, contains the 3D Cartesian coordinates of the specified point.

CatmullRom(Vector3, Vector3, Vector3, Vector3, float)

Performs a Catmull-Rom interpolation using the specified positions.

public static Vector3 CatmullRom(Vector3 value1, Vector3 value2, Vector3 value3, Vector3 value4, float amount)

Parameters

value1 Vector3

The first position in the interpolation.

value2 Vector3

The second position in the interpolation.

value3 Vector3

The third position in the interpolation.

value4 Vector3

The fourth position in the interpolation.

amount float

Weighting factor.

Returns

Vector3

A vector that is the result of the Catmull-Rom interpolation.

CatmullRom(ref Vector3, ref Vector3, ref Vector3, ref Vector3, float, out Vector3)

Performs a Catmull-Rom interpolation using the specified positions.

public static void CatmullRom(ref Vector3 value1, ref Vector3 value2, ref Vector3 value3, ref Vector3 value4, float amount, out Vector3 result)

Parameters

value1 Vector3

The first position in the interpolation.

value2 Vector3

The second position in the interpolation.

value3 Vector3

The third position in the interpolation.

value4 Vector3

The fourth position in the interpolation.

amount float

Weighting factor.

result Vector3

When the method completes, contains the result of the Catmull-Rom interpolation.

Clamp(Vector3, Vector3, Vector3)

public static Vector3 Clamp(this Vector3 value, Vector3 min, Vector3 max)

Parameters

value Vector3
min Vector3
max Vector3

Returns

Vector3

Clamp(ref Vector3, ref Vector3, ref Vector3, out Vector3)

public static void Clamp(ref Vector3 value, ref Vector3 min, ref Vector3 max, out Vector3 result)

Parameters

value Vector3
min Vector3
max Vector3
result Vector3

FindAnyPerpendicular(Vector3)

public static Vector3 FindAnyPerpendicular(this Vector3 value)

Parameters

value Vector3

Returns

Vector3

Get(Vector3, int)

Gets or sets the component at the specified index.

public static float Get(this Vector3 v, int index)

Parameters

v Vector3
index int

The index of the component to access. Use 0 for the X component, 1 for the Y component, and 2 for the Z component.

Returns

float

The value of the X, Y, or Z component, depending on the index.

Exceptions

ArgumentOutOfRangeException

Thrown when the index is out of the range [0, 2].

GetCentroid(IList<Vector3>)

public static Vector3 GetCentroid(this IList<Vector3> vertices)

Parameters

vertices IList<Vector3>

Returns

Vector3

GetCentroid(IList<Vector3>, int, int)

public static Vector3 GetCentroid(this IList<Vector3> vertices, int start, int count)

Parameters

vertices IList<Vector3>
start int
count int

Returns

Vector3

Hermite(Vector3, Vector3, Vector3, Vector3, float)

Performs a Hermite spline interpolation.

public static Vector3 Hermite(Vector3 value1, Vector3 tangent1, Vector3 value2, Vector3 tangent2, float amount)

Parameters

value1 Vector3

First source position vector.

tangent1 Vector3

First source tangent vector.

value2 Vector3

Second source position vector.

tangent2 Vector3

Second source tangent vector.

amount float

Weighting factor.

Returns

Vector3

The result of the Hermite spline interpolation.

Hermite(ref Vector3, ref Vector3, ref Vector3, ref Vector3, float, out Vector3)

Performs a Hermite spline interpolation.

public static void Hermite(ref Vector3 value1, ref Vector3 tangent1, ref Vector3 value2, ref Vector3 tangent2, float amount, out Vector3 result)

Parameters

value1 Vector3

First source position vector.

tangent1 Vector3

First source tangent vector.

value2 Vector3

Second source position vector.

tangent2 Vector3

Second source tangent vector.

amount float

Weighting factor.

result Vector3

When the method completes, contains the result of the Hermite spline interpolation.

IsNormalized(Vector3)

Gets a value indicting whether this instance is normalized.

public static bool IsNormalized(this Vector3 v)

Parameters

v Vector3

Returns

bool

IsZero(Vector3)

Gets a value indicting whether this vector is zero

public static bool IsZero(this Vector3 v)

Parameters

v Vector3

Returns

bool

Max(Vector3, Vector3)

public static Vector3 Max(this Vector3 v1, Vector3 v2)

Parameters

v1 Vector3
v2 Vector3

Returns

Vector3

Max(Vector3, ref Vector3)

public static Vector3 Max(this Vector3 v1, ref Vector3 v2)

Parameters

v1 Vector3
v2 Vector3

Returns

Vector3

Min(Vector3, Vector3)

public static Vector3 Min(this Vector3 v1, Vector3 v2)

Parameters

v1 Vector3
v2 Vector3

Returns

Vector3

Min(Vector3, ref Vector3)

public static Vector3 Min(this Vector3 v1, ref Vector3 v2)

Parameters

v1 Vector3
v2 Vector3

Returns

Vector3

MinMax(IList<Vector3>, int, int, out Vector3, out Vector3)

public static void MinMax(this IList<Vector3> vectors, int start, int count, out Vector3 min, out Vector3 max)

Parameters

vectors IList<Vector3>
start int
count int
min Vector3
max Vector3

MinMax(IList<Vector3>, out Vector3, out Vector3)

public static void MinMax(this IList<Vector3> vectors, out Vector3 min, out Vector3 max)

Parameters

vectors IList<Vector3>
min Vector3
max Vector3

NearEqual(Vector3, Vector3, Vector3)

Tests whether one 3D vector is near another 3D vector.

public static bool NearEqual(Vector3 left, Vector3 right, Vector3 epsilon)

Parameters

left Vector3

The left vector.

right Vector3

The right vector.

epsilon Vector3

The epsilon.

Returns

bool

true if left and right are near another 3D, false otherwise

NearEqual(ref Vector3, ref Vector3, ref Vector3)

Tests whether one 3D vector is near another 3D vector.

public static bool NearEqual(ref Vector3 left, ref Vector3 right, ref Vector3 epsilon)

Parameters

left Vector3

The left vector.

right Vector3

The right vector.

epsilon Vector3

The epsilon.

Returns

bool

true if left and right are near another 3D, false otherwise

Orthogonalize(Vector3[], params Vector3[])

Orthogonalizes a list of vectors.

public static void Orthogonalize(Vector3[] destination, params Vector3[] source)

Parameters

destination Vector3[]

The list of orthogonalized vectors.

source Vector3[]

The list of vectors to orthogonalize.

Remarks

Orthogonalization is the process of making all vectors orthogonal to each other. This means that any given vector in the list will be orthogonal to any other given vector in the list.

Because this method uses the modified Gram-Schmidt process, the resulting vectors tend to be numerically unstable. The numeric stability decreases according to the vectors position in the list so that the first vector is the most stable and the last vector is the least stable.

Exceptions

ArgumentNullException

Thrown when source or destination is null.

ArgumentOutOfRangeException

Thrown when destination is shorter in length than source.

Orthonormalize(Vector3[], params Vector3[])

Orthonormalizes a list of vectors.

public static void Orthonormalize(Vector3[] destination, params Vector3[] source)

Parameters

destination Vector3[]

The list of orthonormalized vectors.

source Vector3[]

The list of vectors to orthonormalize.

Remarks

Orthonormalization is the process of making all vectors orthogonal to each other and making all vectors of unit length. This means that any given vector will be orthogonal to any other given vector in the list.

Because this method uses the modified Gram-Schmidt process, the resulting vectors tend to be numerically unstable. The numeric stability decreases according to the vectors position in the list so that the first vector is the most stable and the last vector is the least stable.

Exceptions

ArgumentNullException

Thrown when source or destination is null.

ArgumentOutOfRangeException

Thrown when destination is shorter in length than source.

PointToPlanePosition(Vector3, Plane)

Point to plane position. Front/Back/Intersecting.

public static PlaneIntersectionType PointToPlanePosition(this Vector3 point, Plane plane)

Parameters

point Vector3

The point.

plane Plane

The plane.

Returns

PlaneIntersectionType

PointToPlanePosition(Vector3, ref Plane)

Point to plane position. Front/Back/Intersecting.

public static PlaneIntersectionType PointToPlanePosition(this Vector3 point, ref Plane plane)

Parameters

point Vector3

The point.

plane Plane

The plane.

Returns

PlaneIntersectionType

Project(Vector3, float, float, float, float, float, float, Matrix4x4)

Projects a 3D vector from object space into screen space.

public static Vector3 Project(Vector3 vector, float x, float y, float width, float height, float minZ, float maxZ, Matrix4x4 worldViewProjection)

Parameters

vector Vector3

The vector to project.

x float

The X position of the viewport.

y float

The Y position of the viewport.

width float

The width of the viewport.

height float

The height of the viewport.

minZ float

The minimum depth of the viewport.

maxZ float

The maximum depth of the viewport.

worldViewProjection Matrix4x4

The combined world-view-projection matrix.

Returns

Vector3

The vector in screen space.

Project(ref Vector3, float, float, float, float, float, float, ref Matrix4x4, out Vector3)

Projects a 3D vector from object space into screen space.

public static void Project(ref Vector3 vector, float x, float y, float width, float height, float minZ, float maxZ, ref Matrix4x4 worldViewProjection, out Vector3 result)

Parameters

vector Vector3

The vector to project.

x float

The X position of the viewport.

y float

The Y position of the viewport.

width float

The width of the viewport.

height float

The height of the viewport.

minZ float

The minimum depth of the viewport.

maxZ float

The maximum depth of the viewport.

worldViewProjection Matrix4x4

The combined world-view-projection matrix.

result Vector3

When the method completes, contains the vector in screen space.

RotateAround(in Vector3, in Vector3, in Vector3, float)

Rotates the source around the target by the rotation angle around the supplied axis.

public static Vector3 RotateAround(this in Vector3 source, in Vector3 target, in Vector3 axis, float angle)

Parameters

source Vector3

The position to rotate.

target Vector3

The point to rotate around.

axis Vector3

The axis of rotation.

angle float

The angle to rotate by in radians.

Returns

Vector3

The rotated vector.

Set(ref Vector3, int, float)

public static void Set(ref Vector3 v, int index, float value)

Parameters

v Vector3
index int
value float

SignedAngleBetween(Vector3, Vector3, Vector3)

Calculates the signed angle (in radians) between two vectors.

public static float SignedAngleBetween(this Vector3 vector1, Vector3 vector2, Vector3 axis)

Parameters

vector1 Vector3

The first vector.

vector2 Vector3

The second vector.

axis Vector3

The vector around which the other vectors are rotated.

Returns

float

The signed angle (in radians) between two vectors.

Remarks

The sign of the angle is positive in a counter-clockwise direction and negative in a clockwise direction when viewed from the side specified by the axis.

SmoothStep(Vector3, Vector3, float)

Performs a cubic interpolation between two vectors.

public static Vector3 SmoothStep(Vector3 start, Vector3 end, float amount)

Parameters

start Vector3

Start vector.

end Vector3

End vector.

amount float

Value between 0 and 1 indicating the weight of end.

Returns

Vector3

The cubic interpolation of the two vectors.

SmoothStep(ref Vector3, ref Vector3, float, out Vector3)

Performs a cubic interpolation between two vectors.

public static void SmoothStep(ref Vector3 start, ref Vector3 end, float amount, out Vector3 result)

Parameters

start Vector3

Start vector.

end Vector3

End vector.

amount float

Value between 0 and 1 indicating the weight of end.

result Vector3

When the method completes, contains the cubic interpolation of the two vectors.

ToArray(Vector3)

Creates an array containing the elements of the vector.

public static float[] ToArray(this Vector3 v)

Parameters

v Vector3

Returns

float[]

A three-element array containing the components of the vector.

Transform(Vector3, Matrix3x3)

Transforms a 3D vector by the given Matrix3x3.

public static Vector3 Transform(Vector3 vector, Matrix3x3 transform)

Parameters

vector Vector3

The source vector.

transform Matrix3x3

The transformation Matrix3x3.

Returns

Vector3

The transformed Vector3.

Transform(Vector3, ref Matrix3x3)

Transforms a 3D vector by the given Matrix3x3.

public static Vector3 Transform(Vector3 vector, ref Matrix3x3 transform)

Parameters

vector Vector3

The source vector.

transform Matrix3x3

The transformation Matrix3x3.

Returns

Vector3

The transformed Vector3.

Transform(ref Vector3, ref Matrix3x3, out Vector3)

Transforms a 3D vector by the given Matrix3x3.

public static void Transform(ref Vector3 vector, ref Matrix3x3 transform, out Vector3 result)

Parameters

vector Vector3

The source vector.

transform Matrix3x3

The transformation Matrix3x3.

result Vector3

When the method completes, contains the transformed Vector3.

Transform(ref Vector3, ref Matrix4x4, out Vector4)

Transforms a 3D vector by the given Matrix4x4.

public static void Transform(ref Vector3 vector, ref Matrix4x4 transform, out Vector4 result)

Parameters

vector Vector3

The source vector.

transform Matrix4x4

The transformation Matrix4x4.

result Vector4

When the method completes, contains the transformed Vector4.

Transform(Vector3[], ref Matrix4x4, Vector4[])

Transforms an array of 3D vectors by the given Matrix4x4.

public static void Transform(Vector3[] source, ref Matrix4x4 transform, Vector4[] destination)

Parameters

source Vector3[]

The array of vectors to transform.

transform Matrix4x4

The transformation Matrix4x4.

destination Vector4[]

The array for which the transformed vectors are stored.

Exceptions

ArgumentNullException

Thrown when source or destination is null.

ArgumentOutOfRangeException

Thrown when destination is shorter in length than source.

Transform(Vector3[], ref Quaternion, Vector3[])

Transforms an array of vectors by the given Quaternion rotation.

public static void Transform(Vector3[] source, ref Quaternion rotation, Vector3[] destination)

Parameters

source Vector3[]

The array of vectors to transform.

rotation Quaternion

The Quaternion rotation to apply.

destination Vector3[]

The array for which the transformed vectors are stored. This array may be the same array as source.

Exceptions

ArgumentNullException

Thrown when source or destination is null.

ArgumentOutOfRangeException

Thrown when destination is shorter in length than source.

TransformCoordinate(IList<Vector3>, ref Matrix4x4, IList<Vector3>)

Performs a coordinate transformation on an array of vectors using the given Matrix4x4.

public static void TransformCoordinate(this IList<Vector3> source, ref Matrix4x4 transform, IList<Vector3> destination)

Parameters

source IList<Vector3>

The array of coordinate vectors to transform.

transform Matrix4x4

The transformation Matrix4x4.

destination IList<Vector3>

The array for which the transformed vectors are stored. This array may be the same array as source.

Remarks

A coordinate transform performs the transformation with the assumption that the w component is one. The four dimensional vector obtained from the transformation operation has each component in the vector divided by the w component. This forces the w component to be one and therefore makes the vector homogeneous. The homogeneous vector is often preferred when working with coordinates as the w component can safely be ignored.

Exceptions

ArgumentNullException

Thrown when source or destination is null.

ArgumentOutOfRangeException

Thrown when destination is shorter in length than source.

TransformCoordinate(Vector3, Matrix4x4)

Performs a coordinate transformation using the given Matrix4x4.

public static Vector3 TransformCoordinate(this Vector3 coordinate, Matrix4x4 transform)

Parameters

coordinate Vector3

The coordinate vector to transform.

transform Matrix4x4

The transformation Matrix4x4.

Returns

Vector3

The transformed coordinates.

Remarks

A coordinate transform performs the transformation with the assumption that the w component is one. The four dimensional vector obtained from the transformation operation has each component in the vector divided by the w component. This forces the w component to be one and therefore makes the vector homogeneous. The homogeneous vector is often preferred when working with coordinates as the w component can safely be ignored.

TransformCoordinate(Vector3, ref Matrix4x4)

Performs a coordinate transformation using the given Matrix4x4.

public static Vector3 TransformCoordinate(this Vector3 coordinate, ref Matrix4x4 transform)

Parameters

coordinate Vector3

The coordinate vector to transform.

transform Matrix4x4

The transformation Matrix4x4.

Returns

Vector3

The transformed coordinates.

Remarks

A coordinate transform performs the transformation with the assumption that the w component is one. The four dimensional vector obtained from the transformation operation has each component in the vector divided by the w component. This forces the w component to be one and therefore makes the vector homogeneous. The homogeneous vector is often preferred when working with coordinates as the w component can safely be ignored.

TransformCoordinate(ref Vector3, ref Matrix4x4, out Vector3)

Performs a coordinate transformation using the given Matrix4x4.

public static void TransformCoordinate(ref Vector3 coordinate, ref Matrix4x4 transform, out Vector3 result)

Parameters

coordinate Vector3

The coordinate vector to transform.

transform Matrix4x4

The transformation Matrix4x4.

result Vector3

When the method completes, contains the transformed coordinates.

Remarks

A coordinate transform performs the transformation with the assumption that the w component is one. The four dimensional vector obtained from the transformation operation has each component in the vector divided by the w component. This forces the w component to be one and therefore makes the vector homogeneous. The homogeneous vector is often preferred when working with coordinates as the w component can safely be ignored.

TransformNormal(IList<Vector3>, ref Matrix4x4, IList<Vector3>)

Performs a normal transformation on an array of vectors using the given Matrix4x4.

public static void TransformNormal(this IList<Vector3> source, ref Matrix4x4 transform, IList<Vector3> destination)

Parameters

source IList<Vector3>

The array of normal vectors to transform.

transform Matrix4x4

The transformation Matrix4x4.

destination IList<Vector3>

The array for which the transformed vectors are stored. This array may be the same array as source.

Remarks

A normal transform performs the transformation with the assumption that the w component is zero. This causes the fourth row and fourth column of the matrix to be unused. The end result is a vector that is not translated, but all other transformation properties apply. This is often preferred for normal vectors as normals purely represent direction rather than location because normal vectors should not be translated.

Exceptions

ArgumentNullException

Thrown when source or destination is null.

ArgumentOutOfRangeException

Thrown when destination is shorter in length than source.

TransformNormal(Vector3, ref Matrix4x4)

Performs a normal transformation using the given Matrix4x4.

public static Vector3 TransformNormal(this Vector3 normal, ref Matrix4x4 transform)

Parameters

normal Vector3

The normal vector to transform.

transform Matrix4x4

The transformation Matrix4x4.

Returns

Vector3

Remarks

A normal transform performs the transformation with the assumption that the w component is zero. This causes the fourth row and fourth column of the matrix to be unused. The end result is a vector that is not translated, but all other transformation properties apply. This is often preferred for normal vectors as normals purely represent direction rather than location because normal vectors should not be translated.

TransformNormal(ref Vector3, ref Matrix4x4, out Vector3)

Performs a normal transformation using the given Matrix4x4.

public static void TransformNormal(ref Vector3 normal, ref Matrix4x4 transform, out Vector3 result)

Parameters

normal Vector3

The normal vector to transform.

transform Matrix4x4

The transformation Matrix4x4.

result Vector3

When the method completes, contains the transformed normal.

Remarks

A normal transform performs the transformation with the assumption that the w component is zero. This causes the fourth row and fourth column of the matrix to be unused. The end result is a vector that is not translated, but all other transformation properties apply. This is often preferred for normal vectors as normals purely represent direction rather than location because normal vectors should not be translated.

Unproject(Vector3, float, float, float, float, float, float, Matrix4x4)

Projects a 3D vector from screen space into object space.

public static Vector3 Unproject(Vector3 vector, float x, float y, float width, float height, float minZ, float maxZ, Matrix4x4 worldViewProjection)

Parameters

vector Vector3

The vector to project.

x float

The X position of the viewport.

y float

The Y position of the viewport.

width float

The width of the viewport.

height float

The height of the viewport.

minZ float

The minimum depth of the viewport.

maxZ float

The maximum depth of the viewport.

worldViewProjection Matrix4x4

The combined world-view-projection matrix.

Returns

Vector3

The vector in object space.

Unproject(ref Vector3, float, float, float, float, float, float, ref Matrix4x4, out Vector3)

Projects a 3D vector from screen space into object space.

public static void Unproject(ref Vector3 vector, float x, float y, float width, float height, float minZ, float maxZ, ref Matrix4x4 worldViewProjection, out Vector3 result)

Parameters

vector Vector3

The vector to project.

x float

The X position of the viewport.

y float

The Y position of the viewport.

width float

The width of the viewport.

height float

The height of the viewport.

minZ float

The minimum depth of the viewport.

maxZ float

The maximum depth of the viewport.

worldViewProjection Matrix4x4

The combined world-view-projection matrix.

result Vector3

When the method completes, contains the vector in object space.