Class ChildCollisionShape

java.lang.Object
com.jme3.bullet.collision.shapes.infos.ChildCollisionShape
All Implemented Interfaces:
Savable

public class ChildCollisionShape extends Object implements Savable
An element of a CompoundCollisionShape, consisting of a (non-compound) child shape, offset and rotated with respect to its parent.

This class is shared between JBullet and Native Bullet.

  • Field Details

    • location

      public Vector3f location
      translation relative to parent shape (not null)
    • rotation

      public Matrix3f rotation
      rotation relative to parent shape (not null)
    • shape

      public CollisionShape shape
      base shape (not null, not a compound shape)
  • Constructor Details

    • ChildCollisionShape

      protected ChildCollisionShape()
      No-argument constructor needed by SavableClassUtil. Do not invoke directly!
    • ChildCollisionShape

      public ChildCollisionShape(Vector3f location, Matrix3f rotation, CollisionShape shape)
      Instantiate a child shape for use in a compound shape.
      Parameters:
      location - translation relative to the parent (not null, alias created)
      rotation - rotation relative to the parent (not null, alias created)
      shape - the base shape (not null, not a compound shape, alias created)
  • Method Details

    • write

      public void write(JmeExporter ex) throws IOException
      Serialize this shape, for example when saving to a J3O file.
      Specified by:
      write in interface Savable
      Parameters:
      ex - exporter (not null)
      Throws:
      IOException - from exporter
    • read

      public void read(JmeImporter im) throws IOException
      De-serialize this shape, for example when loading from a J3O file.
      Specified by:
      read in interface Savable
      Parameters:
      im - importer (not null)
      Throws:
      IOException - from importer