# Class Transform

java.lang.Object
com.codename1.gaming.physics.box2d.common.Transform

public class Transform extends Object
A transform contains translation and rotation. It is used to represent the position and orientation of rigid frames.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `final Vec2`
  `p`
  The translation caused by the transform
  `final Rot`
  `q`
  A matrix representing a rotation

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Transform()`
  The default constructor.
  `Transform(Transform xf)`
  Initialize as a copy of another transform.
  `Transform(Vec2 _position, Rot _R)`
  Initialize using a position vector and a rotation matrix.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static final Transform`
  `mul(Transform A, Transform B)`
  `static final Vec2`
  `mul(Transform T, Vec2 v)`
  `static final void`
  `mulToOut(Transform A, Transform B, Transform out)`
  `static final void`
  `mulToOut(Transform T, Vec2 v, Vec2 out)`
  `static final void`
  `mulToOutUnsafe(Transform A, Transform B, Transform out)`
  `static final void`
  `mulToOutUnsafe(Transform T, Vec2 v, Vec2 out)`
  `static final Transform`
  `mulTrans(Transform A, Transform B)`
  `static final Vec2`
  `mulTrans(Transform T, Vec2 v)`
  `static final void`
  `mulTransToOut(Transform A, Transform B, Transform out)`
  `static final void`
  `mulTransToOut(Transform T, Vec2 v, Vec2 out)`
  `static final void`
  `mulTransToOutUnsafe(Transform A, Transform B, Transform out)`
  `static final void`
  `mulTransToOutUnsafe(Transform T, Vec2 v, Vec2 out)`
  `final Transform`
  `set(Transform xf)`
  Set this to equal another transform.
  `final void`
  `set(Vec2 p, float angle)`
  Set this based on the position and angle.
  `final void`
  `setIdentity()`
  Set this to the identity transform.
  `final String`
  `toString()`
  Returns a string representation of the object.

  ### Methods inherited from class Object

  `clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Field Details

  - ### p

    public final Vec2 p
    The translation caused by the transform

  - ### q

    public final Rot q
    A matrix representing a rotation

- ## Constructor Details

  - ### Transform

    public Transform()
    The default constructor.

  - ### Transform

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

  - ### Transform

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

- ## Method Details

  - ### 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` -

  - ### 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)

  - ### mulToOutUnsafe

    public static final void mulToOutUnsafe(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)

  - ### mulTransToOutUnsafe

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

  - ### mul

    public static final Transform mul(Transform A, Transform B)

  - ### mulToOut

    public static final void mulToOut(Transform A, Transform B, Transform out)

  - ### mulToOutUnsafe

    public static final void mulToOutUnsafe(Transform A, Transform B, Transform out)

  - ### mulTrans

    public static final Transform mulTrans(Transform A, Transform B)

  - ### mulTransToOut

    public static final void mulTransToOut(Transform A, Transform B, Transform out)

  - ### mulTransToOutUnsafe

    public static final void mulTransToOutUnsafe(Transform A, Transform B, Transform out)

  - ### toString

    public final String toString()
    Description copied from class: `Object`
    Returns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method. The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of: getClass().getName() + '@' + Integer.toHexString(hashCode())
    Overrides:
      `toString` in class `Object`