Jeffrey T. Palmer > Box2D-0.07 > Box2D::b2Math

Download:
Box2D-0.07.tar.gz

Annotate this POD

View/Report Bugs
Source  

NAME ^

Box2D::b2Math - Vector and matrix functions.

SYNOPSIS ^

  my $dot_product = Box2D::b2Math::b2DotV2V2( $a, $b );
  my cross_product = Box2D::b2Math::b2CrossV2V2( $a, $b );
  my $distance = Box2D::b2Math::b2Distance( $a, $b );

DESCRIPTION ^

Box2D includes a simple small vector and matrix module. This has been designed to suit the internal needs of Box2D and the API. Some the members are exposed, so you may use them freely in your application.

METHODS ^

b2IsValid( $x )

Parameters:

Returns a bool

b2InvSqrt( $x )

Compute the inverse square-root of a scalar. Approximate yet fast.

Parameters:

Returns a float32

b2Abs( $x )

Parameters:

Returns a float32

b2DotV2V2( $a, $b )

Compute the dot product of two vectors.

Parameters:

Returns a float32

b2CrossV2V2( $a, $b )

Compute the cross product of two vectors.

Parameters:

Returns a float32

b2CrossV2S( $v, $s )

Compute the cross product of a vector and a scalar.

Parameters:

Returns a Box2D::b2Vec2

b2CrossSV2( $s, $v )

Compute the cross product of a scalar and a vector.

Parameters:

Returns a Box2D::b2Vec2

b2MulM22V2( $M, $v )

Multiply a matrix and a vector.

Parameters:

Returns a Box2D::b2Vec2

b2MulTM22V2( $M, $v )

Multiply a matrix transpose and a vector.

Parameters:

Returns a Box2D::b2Vec2

b2AddV2V2( $a, $b )

Add two vectors.

Parameters:

Returns a Box2D::b2Vec2

b2SubV2V2( $a, $b )

Subtract one vector from another.

Parameters:

Returns a Box2D::b2Vec2

b2MulSV2( $s, $v )

Multiply a scalar and a vector.

Parameters:

Returns a Box2D::b2Vec2

b2EqlV2V2( $a, $b )

Are these vectors equal?

Parameters:

Returns a bool

b2Distance( $a, $b )

Compute the distance between two vectors.

Parameters:

Returns a float32

b2DistanceSquared( $a, $b )

Compute the square of the distance between two vectors.

Parameters:

Returns a float32

SEE ALSO ^

BUGS ^

See "BUGS" in Box2D

AUTHORS ^

See "AUTHORS" in Box2D

COPYRIGHT & LICENSE ^

See "COPYRIGHT & LICENSE" in Box2D

syntax highlighting: