Bearbeiten

Freigeben über


VectorExtensions Class

Definition

Extension methods for Unity's Vector struct

public ref class VectorExtensions abstract sealed
public static class VectorExtensions
type VectorExtensions = class
Public Module VectorExtensions
Inheritance
VectorExtensions

Methods

Average(ICollection<Vector2>)

Given a collection of 2D vectors, calculate the averages for each vector component.

Average(ICollection<Vector3>)

Given a collection of 3D vectors, calculate the averages for each vector component.

Average(IEnumerable<Vector2>)

Given a collection of 2D vectors, calculate the averages for each vector component.

Average(IEnumerable<Vector3>)

Given a collection of 3D vectors, calculate the averages for each vector component.

CloseEnough(Vector3, Vector3, Single)

Determines if the distance between two vectors is within a given tolerance.

CylindricalMapping(Vector3, Single)

Get the relative mapping based on a source Vec3 and a radius for cylinder mapping.

Div(Vector2, Vector2)

Divide 2D vector components by the given divisor components.

Div(Vector3, Vector3)

Divide 3D vector components by the given divisor components.

InverseTransformPoint(Vector3, Vector3, Quaternion, Vector3)

Apply an inverse transformation to a given point using the specified translation, rotation and scale.

IsValidVector(Vector3)

Validates that each 3D vector components is a number and is not infinite.

Median(ICollection<Vector2>)

Given a collection of 2D vectors, calculate the medians for each vector component.

Median(ICollection<Vector3>)

Given a collection of 3D vectors, calculate the medians for each vector component.

Median(IEnumerable<Vector2>)

Given a collection of 2D vectors, calculate the medians for each vector component.

Median(IEnumerable<Vector3>)

Given a collection of 3D vectors, calculate the medians for each vector component.

Mul(Vector2, Vector2)

Multiple 2D vector components together to returned a new scaled vector.

Mul(Vector3, Vector3)

Multiple 3D vector components together to returned a new scaled vector.

RadialMapping(Vector3, Single, Single, Int32, Int32, Int32, Int32)

Get the relative mapping based on a source Vec3 and a radius for radial mapping.

RotateAround(Vector3, Vector3, Quaternion)

Rotate a given point around a pivot at a particular rotation.

RotateAround(Vector3, Vector3, Vector3)

Rotate a given point around a pivot at a particular rotation.

ScatterMapping(Vector3, Single)

Randomized mapping based on a source Vec3 and a radius for randomization distance.

SphericalMapping(Vector3, Single)

Get the relative mapping based on a source Vec3 and a radius for spherical mapping.

TransformPoint(Vector3, Vector3, Quaternion, Vector3)

Apply a transformation to a given point using the specified translation, rotation and scale.

Applies to