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

Download:
Box2D-0.07.tar.gz

Annotate this POD

View/Report Bugs
Source  

NAME ^

Box2D::b2Vec2 - A 2D column vector.

SYNOPSIS ^

  my $v = Box2D::b2Vec2->new( $x, $y );

DESCRIPTION ^

A 2D column vector.

METHODS ^

new()

Default constructor does nothing.

Returns a Box2D::b2Vec2

new( $x, $y )

Construct using coordinates.

Parameters:

IsValid()

Does this vector contain finite coordinates?

Returns a bool

Length()

Get the length of this vector (the norm).

Returns a float32

LengthSquared()

Get the length squared. For performance, use this instead of b2Vec2::Length (if possible).

Returns a float32

Normalize()

Convert this vector into a unit vector. Returns the length.

Returns a float32

Set( $x, $y )

Set this vector to some specified coordinates.

Parameters:

SetZero()

Set this vector to all zeros.

x()

x( $x )

Parameters:

Returns a float32

y()

y( $y )

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: