C# Class UnityContrib.UnityEngine.Vector3Ex

Provides a set of helper methods for working with the T:UnityEngine.Vector3 struct.
Show file Open project: UnityContrib/framework

Public Methods

Method Description
Around ( this position, float distance ) : Vector3

Returns a random position around the specified center position. The Y component of the random position will always be the same as the center position.

CalculateSlopeDeg ( this normal ) : float

Returns the slope of the specified normal in degrees. Based on Y being the up component.

CalculateSlopeDeg ( this normal, Vector3 up ) : float

Returns the slope of the specified normal in degrees. Based on Y being the up component.

CalculateSlopeRad ( this normal ) : float

Returns the slope of the specified normal in radians.

CalculateSlopeRad ( this normal, Vector3 up ) : float

Returns the slope of the specified normal in radians.

Within ( this position, float x, float y, float z ) : Vector3

Returns a random position inside a box.

Method Details

Around() public static method

Returns a random position around the specified center position. The Y component of the random position will always be the same as the center position.
public static Around ( this position, float distance ) : Vector3
position this /// The center position to generate a random position around. ///
distance float /// The distance from the center position to the generated random position. ///
return UnityEngine.Vector3

CalculateSlopeDeg() public static method

Returns the slope of the specified normal in degrees. Based on Y being the up component.
public static CalculateSlopeDeg ( this normal ) : float
normal this /// The normal who's slope to calculate. ///
return float

CalculateSlopeDeg() public static method

Returns the slope of the specified normal in degrees. Based on Y being the up component.
public static CalculateSlopeDeg ( this normal, Vector3 up ) : float
normal this /// The normal who's slope to calculate. ///
up UnityEngine.Vector3 /// The up direction. ///
return float

CalculateSlopeRad() public static method

Returns the slope of the specified normal in radians.
public static CalculateSlopeRad ( this normal ) : float
normal this /// The normal who's slope to calculate. ///
return float

CalculateSlopeRad() public static method

Returns the slope of the specified normal in radians.
public static CalculateSlopeRad ( this normal, Vector3 up ) : float
normal this /// The normal who's slope to calculate. ///
up UnityEngine.Vector3 /// The up direction. ///
return float

Within() public static method

Returns a random position inside a box.
public static Within ( this position, float x, float y, float z ) : Vector3
position this /// The center of the box. ///
x float /// The width of the box. ///
y float /// The height of the box. ///
z float /// The depth of the box. ///
return UnityEngine.Vector3