public class CylinderCollisionShape extends CollisionShape
Modifier and Type | Field and Description |
---|---|
protected int |
axis
copy of main (height) axis (0→X, 1→Y, 2→Z)
|
protected Vector3f |
halfExtents
copy of half-extents of the cylinder on each local axis (not null, no
negative component)
|
margin, objectId, scale
Modifier | Constructor and Description |
---|---|
protected |
CylinderCollisionShape()
No-argument constructor needed by SavableClassUtil.
|
|
CylinderCollisionShape(Vector3f halfExtents)
Instantiate a Z-axis cylinder shape with the specified half extents.
|
|
CylinderCollisionShape(Vector3f halfExtents,
int axis)
Instantiate a cylinder shape around the specified axis.
|
Modifier and Type | Method and Description |
---|---|
protected void |
createShape()
Instantiate the configured shape in Bullet.
|
int |
getAxis()
Determine the main axis of the cylinder.
|
Vector3f |
getHalfExtents()
Access the half extents of the cylinder.
|
void |
read(JmeImporter im)
De-serialize this shape, for example when loading from a J3O file.
|
void |
setScale(Vector3f scale)
Alter the scaling factors of this shape.
|
void |
write(JmeExporter ex)
Serialize this shape, for example when saving to a J3O file.
|
finalize, getDefaultMargin, getMargin, getObjectId, getScale, isNonMoving, setDefaultMargin, setMargin, setObjectId
protected Vector3f halfExtents
protected int axis
protected CylinderCollisionShape()
public CylinderCollisionShape(Vector3f halfExtents)
halfExtents
- the desired unscaled half extents (not null, no
negative component, alias created)public CylinderCollisionShape(Vector3f halfExtents, int axis)
halfExtents
- the desired unscaled half extents (not null, no
negative component, alias created)axis
- which local axis: 0→X, 1→Y, 2→Zpublic final Vector3f getHalfExtents()
public int getAxis()
public void setScale(Vector3f scale)
setScale
in class CollisionShape
scale
- the desired scaling factor for each local axis (not null, no
negative component, unaffected, default=1,1,1)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()