[This is preliminary documentation and is subject to change.]

Provides various 2D vector utility methods.

Namespace: org.critterai
Assembly: cai-util (in cai-util.dll) Version: 0.5.0.0 (0.5.0.0)

Syntax

         
 C#  Visual Basic  Visual C++ 
public static class Vector2Util
Public NotInheritable Class Vector2Util
public ref class Vector2Util abstract sealed

Members

         
 All Members  Properties   Methods  
 Public

 Protected
 Instance

 Static 
 Declared

 Inherited
 XNA Framework Only 

 .NET Compact Framework Only 

 MemberDescription
Dot(Vector2, Vector2)
Returns the dot product of the specified vectors. (u . v)
GetDirectionAB(Vector2, Vector2)
Derives the normalized direction vector from point A to point B. (Costly method!)
GetDistanceSq(Vector2, Vector2)
Returns the square of the distance between two points.
Normalize(Vector2)
Normalizes the specified vector such that its length is equal to one. (Costly method!)
ScaleTo(Vector2, Single)
Scales the vector to the specified length. (Costly method!)
SloppyEquals(Vector2, Vector2, Single)
Determines whether or not the specified vectors are equal within the specified tolerance.
TruncateLength(Vector2, Single)
Truncates the length of the vector to the specified value.
Zero
The zero vector. (0, 0)

Remarks

Static methods are thread safe.

Inheritance Hierarchy

System..::..Object
  org.critterai..::..Vector2Util

See Also