public class SphereCollisionShape extends CollisionShape
| Modifier and Type | Field and Description |
|---|---|
protected float |
radius
copy of radius (≥0)
|
margin, objectId, scale| Modifier | Constructor and Description |
|---|---|
protected |
SphereCollisionShape()
No-argument constructor needed by SavableClassUtil.
|
|
SphereCollisionShape(float radius)
Instantiate a sphere shape with the specified radius.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
createShape()
Instantiate the configured shape in Bullet.
|
float |
getRadius()
Read the radius of the sphere.
|
void |
read(com.jme3.export.JmeImporter im)
De-serialize this shape, for example when loading from a J3O file.
|
void |
setScale(com.jme3.math.Vector3f scale)
Alter the scaling factors of this shape.
|
void |
write(com.jme3.export.JmeExporter ex)
Serialize this shape, for example when saving to a J3O file.
|
finalize, getDefaultMargin, getMargin, getObjectId, getScale, isNonMoving, setDefaultMargin, setMargin, setObjectIdprotected SphereCollisionShape()
public SphereCollisionShape(float radius)
radius - the desired radius (≥0)public float getRadius()
public void write(com.jme3.export.JmeExporter ex)
throws java.io.IOException
write in interface com.jme3.export.Savablewrite in class CollisionShapeex - exporter (not null)java.io.IOException - from exporterpublic void read(com.jme3.export.JmeImporter im)
throws java.io.IOException
read in interface com.jme3.export.Savableread in class CollisionShapeim - importer (not null)java.io.IOException - from importerpublic void setScale(com.jme3.math.Vector3f scale)
setScale in class CollisionShapescale - the desired scaling factor for each local axis (not null, no
negative component, unaffected, default=1,1,1)protected void createShape()