Class CapsuleCollisionShape

java.lang.Object
com.jme3.bullet.collision.shapes.CollisionShape
com.jme3.bullet.collision.shapes.CapsuleCollisionShape
All Implemented Interfaces:
com.jme3.export.Savable

public class CapsuleCollisionShape extends CollisionShape
Basic capsule collision shape
Author:
normenhansen
  • Field Details

    • radius

      protected float radius
    • height

      protected float height
    • axis

      protected int axis
  • Constructor Details

    • CapsuleCollisionShape

      protected CapsuleCollisionShape()
    • CapsuleCollisionShape

      public CapsuleCollisionShape(float radius, float height)
      Creates a new CapsuleCollisionShape with the given radius and height. The capsule is oriented along the Y axis (1).
      Parameters:
      radius - the radius of the capsule
      height - the height of the capsule
    • CapsuleCollisionShape

      public CapsuleCollisionShape(float radius, float height, int axis)
      Creates a capsule shape around the given axis (0=X,1=Y,2=Z).
      Parameters:
      radius - the desired unscaled radius
      height - the desired unscaled height of the cylindrical portion
      axis - which local axis for the height: 0→X, 1→Y, 2→Z
  • Method Details

    • getRadius

      public float getRadius()
    • getHeight

      public float getHeight()
    • getAxis

      public int getAxis()
    • write

      public void write(com.jme3.export.JmeExporter ex) throws IOException
      Specified by:
      write in interface com.jme3.export.Savable
      Overrides:
      write in class CollisionShape
      Throws:
      IOException
    • read

      public void read(com.jme3.export.JmeImporter im) throws IOException
      Specified by:
      read in interface com.jme3.export.Savable
      Overrides:
      read in class CollisionShape
      Throws:
      IOException
    • createShape

      protected void createShape()