public class ConeCollisionShape extends CollisionShape
Modifier and Type | Field and Description |
---|---|
protected int |
axis
copy of main (height) axis (0→X, 1→Y, 2→Z)
|
protected float |
height
copy of height (≥0)
|
protected float |
radius
copy of radius (≥0)
|
margin, objectId, scale
Modifier | Constructor and Description |
---|---|
protected |
ConeCollisionShape()
No-argument constructor needed by SavableClassUtil.
|
|
ConeCollisionShape(float radius,
float height)
Instantiate a cone shape oriented along the Y axis.
|
|
ConeCollisionShape(float radius,
float height,
int axis)
Instantiate a cone shape around the specified main (height) axis.
|
Modifier and Type | Method and Description |
---|---|
protected void |
createShape()
Instantiate the configured shape in Bullet.
|
float |
getHeight()
Read the height of the cone.
|
float |
getRadius()
Read the radius of the cone.
|
void |
read(JmeImporter im)
De-serialize this shape, for example when loading from a J3O file.
|
void |
write(JmeExporter ex)
Serialize this shape, for example when saving to a J3O file.
|
finalize, getDefaultMargin, getMargin, getObjectId, getScale, isNonMoving, setDefaultMargin, setMargin, setObjectId, setScale
protected float radius
protected float height
protected int axis
protected ConeCollisionShape()
public ConeCollisionShape(float radius, float height, int axis)
radius
- the desired radius (≥0)height
- the desired height (≥0)axis
- which local axis: 0→X, 1→Y, 2→Zpublic ConeCollisionShape(float radius, float height)
radius
- the desired radius (≥0)height
- the desired height (≥0)public float getRadius()
public float getHeight()
public void write(JmeExporter ex) throws java.io.IOException
write
in interface Savable
write
in class CollisionShape
ex
- exporter (not null)java.io.IOException
- from exporterpublic void read(JmeImporter im) throws java.io.IOException
read
in interface Savable
read
in class CollisionShape
im
- importer (not null)java.io.IOException
- from importerprotected void createShape()