Class ChildCollisionShape

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

public class ChildCollisionShape extends Object implements com.jme3.export.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.

Author:
normenhansen
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    com.jme3.math.Vector3f
    translation relative to parent shape (not null)
    com.jme3.math.Matrix3f
    rotation relative to parent shape (not null)
    base shape (not null, not a compound shape)
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    No-argument constructor needed by SavableClassUtil.
     
    ChildCollisionShape(com.jme3.math.Vector3f location, com.jme3.math.Matrix3f rotation, CollisionShape shape)
    Instantiate a child shape for use in a compound shape.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    read(com.jme3.export.JmeImporter im)
    De-serialize this shape, for example when loading from a J3O file.
    void
    write(com.jme3.export.JmeExporter ex)
    Serialize this shape, for example when saving to a J3O file.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • location

      public com.jme3.math.Vector3f location
      translation relative to parent shape (not null)
    • rotation

      public com.jme3.math.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(com.jme3.math.Vector3f location, com.jme3.math.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(com.jme3.export.JmeExporter ex) throws IOException
      Serialize this shape, for example when saving to a J3O file.
      Specified by:
      write in interface com.jme3.export.Savable
      Parameters:
      ex - exporter (not null)
      Throws:
      IOException - from exporter
    • read

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