org.jbox2d.common
Class Transform

java.lang.Object
  extended by org.jbox2d.common.Transform
All Implemented Interfaces:
Serializable

public class Transform
extends Object
implements Serializable

A transform contains translation and rotation. It is used to represent the position and orientation of rigid frames.

See Also:
Serialized Form

Field Summary
 Vec2 position
          The translation caused by the transform
 Mat22 R
          A matrix representing a rotation
 
Constructor Summary
Transform()
          The default constructor.
Transform(Transform xf)
          Initialize as a copy of another transform.
Transform(Vec2 _position, Mat22 _R)
          Initialize using a position vector and a rotation matrix.
 
Method Summary
 float getAngle()
          Calculate the angle that the rotation matrix represents.
static Vec2 mul(Transform T, Vec2 v)
           
static void mulToOut(Transform T, Vec2 v, Vec2 out)
           
static Vec2 mulTrans(Transform T, Vec2 v)
           
static void mulTransToOut(Transform T, Vec2 v, Vec2 out)
           
 Transform set(Transform xf)
          Set this to equal another transform.
 void set(Vec2 p, float angle)
          Set this based on the position and angle.
 void setIdentity()
          Set this to the identity transform.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

position

public final Vec2 position
The translation caused by the transform


R

public final Mat22 R
A matrix representing a rotation

Constructor Detail

Transform

public Transform()
The default constructor.


Transform

public Transform(Transform xf)
Initialize as a copy of another transform.


Transform

public Transform(Vec2 _position,
                 Mat22 _R)
Initialize using a position vector and a rotation matrix.

Method Detail

set

public final Transform set(Transform xf)
Set this to equal another transform.


set

public final void set(Vec2 p,
                      float angle)
Set this based on the position and angle.

Parameters:
p -
angle -

getAngle

public final float getAngle()
Calculate the angle that the rotation matrix represents.


setIdentity

public final void setIdentity()
Set this to the identity transform.


mul

public static final Vec2 mul(Transform T,
                             Vec2 v)

mulToOut

public static final void mulToOut(Transform T,
                                  Vec2 v,
                                  Vec2 out)

mulTrans

public static final Vec2 mulTrans(Transform T,
                                  Vec2 v)

mulTransToOut

public static final void mulTransToOut(Transform T,
                                       Vec2 v,
                                       Vec2 out)

toString

public final String toString()
Overrides:
toString in class Object


Copyright © 2012. All Rights Reserved.