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(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 SphereCollisionShape()
public SphereCollisionShape(float radius)
radius
- the desired radius (≥0)public float getRadius()
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 importerpublic 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)protected void createShape()