C# Class VectorHelpers, tf_client

A class for working with Vectors
Inheritance: System.Object
Show file Open project: wids-eria/tf_client Class Usage Examples

Public Properties

Property Type Description
cardinalAxes Vector3[]
serializationDelimter char

Public Methods

Method Description
AxisTripodFromForwardUp ( Vector3 forward, Vector3 up ) : AxisTripod,

Create an axis tripod from a supplied forward- and up-axis

AxisTripodFromQuaternion ( Quaternion quat ) : AxisTripod,

Create an axis tripod from a Quaternion

AxisTripodFromUp ( Vector3 up ) : AxisTripod,

Create an axis tripod from a supplied up-vector

DeserializeVector2String ( string s ) : Vector2

Deserialize a Vector2 string

DeserializeVector3String ( string s ) : Vector3

Deserialize a Vector3 string

DeserializeVector4String ( string s ) : Vector4

Deserialize a Vector4 string

FindNearestCardinalAxis ( Vector3 testVector ) : Vector3

Find the cardinal axis that is nearest to testVector

GetIntersectionOnPlane ( Ray ray, Plane p, Vector3 &intersectionPoint ) : bool

Get the intersection point of a ray and a plane

GetIntersectionOnPlane ( Vector3 origin, Vector3 direction, Plane p, Vector3 &intersectionPoint ) : bool

Get the intersection point of a line direction, passing through origin, and a plane

MaxValue ( Vector2 v ) : float

Return the largest element in a vector

MaxValue ( Vector3 v ) : float

Return the smallest element in a vector

MaxValue ( Vector4 v ) : float

Return the smallest element in a vector

MinValue ( Vector2 v ) : float

Return the smallest element in a vector

MinValue ( Vector3 v ) : float

Return the smallest element in a vector

MinValue ( Vector4 v ) : float

Return the smallest element in a vector

MirrorPointAcrossPlane ( Vector3 p, Vector3 n ) : Vector3

Mirror point p across the plane defined by the normal n

ScaleByVector ( Vector3 v, Vector3 scale ) : Vector3

Scale a vector using another scale vector

SerializeString ( Vector2 v ) : string

Serialize a Vector2 as a string

SerializeString ( Vector3 v ) : string

Serialize a Vector3 as a string

SerializeString ( Vector4 v ) : string

Serialize a Vector4 as a string

ZeroYComponent ( Vector3 p ) : Vector3

Zeros the Y component.

Method Details

AxisTripodFromForwardUp() public static method

Create an axis tripod from a supplied forward- and up-axis
public static AxisTripodFromForwardUp ( Vector3 forward, Vector3 up ) : AxisTripod,
forward Vector3 /// A ///
up Vector3 /// A ///
return AxisTripod,

AxisTripodFromQuaternion() public static method

Create an axis tripod from a Quaternion
public static AxisTripodFromQuaternion ( Quaternion quat ) : AxisTripod,
quat Quaternion /// A ///
return AxisTripod,

AxisTripodFromUp() public static method

Create an axis tripod from a supplied up-vector
public static AxisTripodFromUp ( Vector3 up ) : AxisTripod,
up Vector3 /// A ///
return AxisTripod,

DeserializeVector2String() public static method

Deserialize a Vector2 string
public static DeserializeVector2String ( string s ) : Vector2
s string /// A ///
return Vector2

DeserializeVector3String() public static method

Deserialize a Vector3 string
public static DeserializeVector3String ( string s ) : Vector3
s string /// A ///
return Vector3

DeserializeVector4String() public static method

Deserialize a Vector4 string
public static DeserializeVector4String ( string s ) : Vector4
s string /// A ///
return Vector4

FindNearestCardinalAxis() public static method

Find the cardinal axis that is nearest to testVector
public static FindNearestCardinalAxis ( Vector3 testVector ) : Vector3
testVector Vector3 /// A ///
return Vector3

GetIntersectionOnPlane() public static method

Get the intersection point of a ray and a plane
public static GetIntersectionOnPlane ( Ray ray, Plane p, Vector3 &intersectionPoint ) : bool
ray Ray /// A ///
p Plane /// A ///
intersectionPoint Vector3
return bool

GetIntersectionOnPlane() public static method

Get the intersection point of a line direction, passing through origin, and a plane
public static GetIntersectionOnPlane ( Vector3 origin, Vector3 direction, Plane p, Vector3 &intersectionPoint ) : bool
origin Vector3 /// A ///
direction Vector3 /// A ///
p Plane /// A ///
intersectionPoint Vector3
return bool

MaxValue() public static method

Return the largest element in a vector
public static MaxValue ( Vector2 v ) : float
v Vector2 /// A ///
return float

MaxValue() public static method

Return the smallest element in a vector
public static MaxValue ( Vector3 v ) : float
v Vector3 /// A ///
return float

MaxValue() public static method

Return the smallest element in a vector
public static MaxValue ( Vector4 v ) : float
v Vector4 /// A ///
return float

MinValue() public static method

Return the smallest element in a vector
public static MinValue ( Vector2 v ) : float
v Vector2 /// A ///
return float

MinValue() public static method

Return the smallest element in a vector
public static MinValue ( Vector3 v ) : float
v Vector3 /// A ///
return float

MinValue() public static method

Return the smallest element in a vector
public static MinValue ( Vector4 v ) : float
v Vector4 /// A ///
return float

MirrorPointAcrossPlane() public static method

Mirror point p across the plane defined by the normal n
public static MirrorPointAcrossPlane ( Vector3 p, Vector3 n ) : Vector3
p Vector3 /// A ///
n Vector3 /// A ///
return Vector3

ScaleByVector() public static method

Scale a vector using another scale vector
public static ScaleByVector ( Vector3 v, Vector3 scale ) : Vector3
v Vector3 /// A ///
scale Vector3 /// A ///
return Vector3

SerializeString() public static method

Serialize a Vector2 as a string
public static SerializeString ( Vector2 v ) : string
v Vector2 /// A ///
return string

SerializeString() public static method

Serialize a Vector3 as a string
public static SerializeString ( Vector3 v ) : string
v Vector3 /// A ///
return string

SerializeString() public static method

Serialize a Vector4 as a string
public static SerializeString ( Vector4 v ) : string
v Vector4 /// A ///
return string

ZeroYComponent() public static method

Zeros the Y component.
public static ZeroYComponent ( Vector3 p ) : Vector3
p Vector3 /// P. ///
return Vector3

Property Details

cardinalAxes public static property

an array containing all of the cardinal axes
public static Vector3[] cardinalAxes
return Vector3[]

serializationDelimter public static property

Delimeter for vector serialization
public static char serializationDelimter
return char