org.newdawn.slick.geom
Class MorphShape

java.lang.Object
  extended by org.newdawn.slick.geom.Shape
      extended by org.newdawn.slick.geom.MorphShape
All Implemented Interfaces:
java.io.Serializable

public class MorphShape
extends Shape

A shape that morphs between a set of other shapes

Author:
kevin
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.newdawn.slick.geom.Shape
boundingCircleRadius, center, maxX, maxY, minX, minY, points, pointsDirty, trianglesDirty, tris, x, y
 
Constructor Summary
MorphShape(Shape base)
          Create a new mighty morphin shape
 
Method Summary
 void addShape(Shape shape)
          Add a subsequent shape that we should morph too in order
protected  void createPoints()
          Subclasses implement this to create the points of the shape.
 void setExternalFrame(Shape current)
          Set the current frame
 void setMorphTime(float time)
          Set the "time" index for this morph.
 Shape transform(Transform transform)
          Apply a transformation and return a new shape.
 void updateMorphTime(float delta)
          Update the morph time and hence the curent frame
 
Methods inherited from class org.newdawn.slick.geom.Shape
calculateRadius, calculateTriangles, checkPoints, closed, contains, contains, findCenter, getBoundingCircleRadius, getCenter, getCenterX, getCenterY, getHeight, getLocation, getMaxX, getMaxY, getMinX, getMinY, getNormal, getPoint, getPointCount, getPoints, getTriangles, getWidth, getX, getY, hasVertex, includes, increaseTriangulation, indexOf, intersects, preCache, prune, setCenterX, setCenterY, setLocation, setLocation, setX, setY, subtract, union
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MorphShape

public MorphShape(Shape base)
Create a new mighty morphin shape

Parameters:
base - The base shape we're starting the morph from
Method Detail

addShape

public void addShape(Shape shape)
Add a subsequent shape that we should morph too in order

Parameters:
shape - The new shape that forms part of the morphing shape

setMorphTime

public void setMorphTime(float time)
Set the "time" index for this morph. This is given in terms of shapes, so 0.5f would give you the position half way between the first and second shapes.

Parameters:
time - The time index to represent on this shape

updateMorphTime

public void updateMorphTime(float delta)
Update the morph time and hence the curent frame

Parameters:
delta - The amount to change the morph time by

setExternalFrame

public void setExternalFrame(Shape current)
Set the current frame

Parameters:
current - The current frame

createPoints

protected void createPoints()
Description copied from class: Shape
Subclasses implement this to create the points of the shape.

Specified by:
createPoints in class Shape
See Also:
createPoints()

transform

public Shape transform(Transform transform)
Description copied from class: Shape
Apply a transformation and return a new shape. This will not alter the current shape but will return the transformed shape.

Specified by:
transform in class Shape
Parameters:
transform - The transform to be applied
Returns:
The transformed shape.
See Also:
transform(Transform)


Copyright © 2006 New Dawn Software. All Rights Reserved.