PulpCore

pulpcore.math
Class Transform

java.lang.Object
  extended by pulpcore.math.Transform

public class Transform
extends Object

The Transform class represents a 2D affine transform. Most apps will not need to use this class - transformations happen automatically using sprite properties.


Field Summary
static int TYPE_IDENTITY
           
static int TYPE_ROTATE
           
static int TYPE_SCALE
           
static int TYPE_TRANSLATE
           
 
Constructor Summary
Transform()
           
Transform(Transform transform)
           
 
Method Summary
 void clear()
          Clears this transform, i.e., sets this transform to the identity matrix.
 void concatenate(Transform transform)
           
 boolean equals(Object object)
           
 Rect getBounds(int fw, int fh)
          Gets the fixed-point bounds.
 boolean getBounds(int fw, int fh, Rect bounds)
          Gets the integer bounds.
 int getDeterminant()
           
 int getScaleX()
           
 int getScaleY()
           
 int getShearX()
           
 int getShearY()
           
 int getTranslateX()
           
 int getTranslateY()
           
 int getType()
           
 int hashCode()
           
 boolean inverseTransform(Tuple2i t)
           
 int inverseTransformX(int fx, int fy)
          Returns Integer.MAX_VALUE if this transform can't be inverted.
 int inverseTransformY(int fx, int fy)
          Returns Integer.MAX_VALUE if this transform can't be inverted.
 void preConcatenate(Transform transform)
           
 void rotate(int fAngle)
           
 void rotate(int fCosAngle, int fSinAngle)
           
 void roundTranslation()
           
 void scale(int fx, int fy)
           
 void set(Transform transform)
          Sets this transform to a copy of specified transform.
 void shear(int fx, int fy)
           
 void transform(Tuple2i t)
           
 int transformX(int fx, int fy)
           
 int transformY(int fx, int fy)
           
 void translate(int fx, int fy)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_IDENTITY

public static final int TYPE_IDENTITY
See Also:
Constant Field Values

TYPE_TRANSLATE

public static final int TYPE_TRANSLATE
See Also:
Constant Field Values

TYPE_SCALE

public static final int TYPE_SCALE
See Also:
Constant Field Values

TYPE_ROTATE

public static final int TYPE_ROTATE
See Also:
Constant Field Values
Constructor Detail

Transform

public Transform()

Transform

public Transform(Transform transform)
Method Detail

equals

public boolean equals(Object object)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

transformX

public int transformX(int fx,
                      int fy)

transformY

public int transformY(int fx,
                      int fy)

transform

public void transform(Tuple2i t)

inverseTransformX

public int inverseTransformX(int fx,
                             int fy)
Returns Integer.MAX_VALUE if this transform can't be inverted.


inverseTransformY

public int inverseTransformY(int fx,
                             int fy)
Returns Integer.MAX_VALUE if this transform can't be inverted.


inverseTransform

public boolean inverseTransform(Tuple2i t)
Returns:
true on success; false if this transform can't be inverted.

getBounds

public boolean getBounds(int fw,
                         int fh,
                         Rect bounds)
Gets the integer bounds.

Returns:
true if the bounds instance was changed

getBounds

public Rect getBounds(int fw,
                      int fh)
Gets the fixed-point bounds.


getType

public int getType()

getTranslateX

public int getTranslateX()

getTranslateY

public int getTranslateY()

getScaleX

public int getScaleX()

getScaleY

public int getScaleY()

getShearX

public int getShearX()

getShearY

public int getShearY()

getDeterminant

public int getDeterminant()

clear

public void clear()
Clears this transform, i.e., sets this transform to the identity matrix.


set

public void set(Transform transform)
Sets this transform to a copy of specified transform.


concatenate

public void concatenate(Transform transform)

preConcatenate

public void preConcatenate(Transform transform)

translate

public void translate(int fx,
                      int fy)

roundTranslation

public void roundTranslation()

scale

public void scale(int fx,
                  int fy)

rotate

public void rotate(int fAngle)

rotate

public void rotate(int fCosAngle,
                   int fSinAngle)

shear

public void shear(int fx,
                  int fy)

PulpCore

Copyright © 2007-2009 Interactive Pulp, LLC.