com.jme3.bullet.collision.shapes
Class CompoundCollisionShape

java.lang.Object
  extended by com.jme3.bullet.collision.shapes.CollisionShape
      extended by com.jme3.bullet.collision.shapes.CompoundCollisionShape
All Implemented Interfaces:
Savable

public class CompoundCollisionShape
extends CollisionShape

A CompoundCollisionShape allows combining multiple base shapes to generate a more sophisticated shape.


Field Summary
protected  java.util.ArrayList<ChildCollisionShape> children
           
 
Fields inherited from class com.jme3.bullet.collision.shapes.CollisionShape
margin, objectId, scale
 
Constructor Summary
CompoundCollisionShape()
           
 
Method Summary
 void addChildShape(CollisionShape shape, Vector3f location)
          adds a child shape at the given local translation
 void addChildShape(CollisionShape shape, Vector3f location, Matrix3f rotation)
          adds a child shape at the given local translation
 java.util.List<ChildCollisionShape> getChildren()
           
 void read(JmeImporter im)
           
 void removeChildShape(CollisionShape shape)
          removes a child shape
 void setScale(Vector3f scale)
          WARNING - CompoundCollisionShape scaling has no effect.
 void write(JmeExporter ex)
           
 
Methods inherited from class com.jme3.bullet.collision.shapes.CollisionShape
finalize, getMargin, getObjectId, getScale, setMargin, setObjectId
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

children

protected java.util.ArrayList<ChildCollisionShape> children
Constructor Detail

CompoundCollisionShape

public CompoundCollisionShape()
Method Detail

addChildShape

public void addChildShape(CollisionShape shape,
                          Vector3f location)
adds a child shape at the given local translation

Parameters:
shape - the child shape to add
location - the local location of the child shape

addChildShape

public void addChildShape(CollisionShape shape,
                          Vector3f location,
                          Matrix3f rotation)
adds a child shape at the given local translation

Parameters:
shape - the child shape to add
location - the local location of the child shape

removeChildShape

public void removeChildShape(CollisionShape shape)
removes a child shape

Parameters:
shape - the child shape to remove

getChildren

public java.util.List<ChildCollisionShape> getChildren()

setScale

public void setScale(Vector3f scale)
WARNING - CompoundCollisionShape scaling has no effect.

Overrides:
setScale in class CollisionShape

write

public void write(JmeExporter ex)
           throws java.io.IOException
Specified by:
write in interface Savable
Overrides:
write in class CollisionShape
Throws:
java.io.IOException

read

public void read(JmeImporter im)
          throws java.io.IOException
Specified by:
read in interface Savable
Overrides:
read in class CollisionShape
Throws:
java.io.IOException