Box2D: b2Vec2 Struct Reference

Box2D

b2Vec2 Struct Reference

A 2D column vector. More...

List of all members.

Public Member Functions

 b2Vec2 ()
 Default constructor does nothing (for performance).
 b2Vec2 (float32 x, float32 y)
 Construct using coordinates.
void SetZero ()
 Set this vector to all zeros.
void Set (float32 x_, float32 y_)
 Set this vector to some specified coordinates.
b2Vec2 operator- () const
 Negate this vector.
void operator+= (const b2Vec2 &v)
 Add a vector to this vector.
void operator-= (const b2Vec2 &v)
 Subtract a vector from this vector.
void operator *= (float32 a)
 Multiply this vector by a scalar.
float32 Length () const
 Get the length of this vector (the norm).
float32 LengthSquared () const
 Get the length squared.
float32 Normalize ()
 Convert this vector into a unit vector. Returns the length.
bool IsValid () const
 Does this vector contain finite coordinates?

Detailed Description

A 2D column vector.

Member Function Documentation

float32 b2Vec2::LengthSquared (  )  const [inline]

Get the length squared.

For performance, use this instead of b2Vec2::Length (if possible).


The documentation for this struct was generated from the following file:
  • b2Math.h

Generated on Sun Apr 13 15:21:27 2008 for Box2D by  doxygen 1.5.4