Box2D::b2Math - Vector and matrix functions.
my $dot_product = Box2D::b2Math::b2DotV2V2( $a, $b ); my cross_product = Box2D::b2Math::b2CrossV2V2( $a, $b ); my $distance = Box2D::b2Math::b2Distance( $a, $b );
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.
Box2D
Parameters:
float32 $x
float32
$x
Returns a bool
bool
Compute the inverse square-root of a scalar. Approximate yet fast.
Returns a float32
Compute the dot product of two vectors.
Box2D::b2Vec2 $a
Box2D::b2Vec2
$a
Box2D::b2Vec2 $b
$b
Compute the cross product of two vectors.
Compute the cross product of a vector and a scalar.
Box2D::b2Vec2 $v
$v
float32 $s
$s
Returns a Box2D::b2Vec2
Compute the cross product of a scalar and a vector.
Multiply a matrix and a vector.
Box2D::b2Mat22 $M
Box2D::b2Mat22
$M
Multiply a matrix transpose and a vector.
Add two vectors.
Subtract one vector from another.
Multiply a scalar and a vector.
Are these vectors equal?
Compute the distance between two vectors.
Compute the square of the distance between two vectors.
See "BUGS" in Box2D
See "AUTHORS" in Box2D
See "COPYRIGHT & LICENSE" in Box2D
To install Box2D, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Box2D
CPAN shell
perl -MCPAN -e shell install Box2D
For more information on module installation, please visit the detailed CPAN module installation guide.