public class BodyModel extends FeatureModel implements Body
GRAVITY_EARTH, GRAVITY_MARS, GRAVITY_MOON
Constructor and Description |
---|
BodyModel()
Create a body model.
|
Modifier and Type | Method and Description |
---|---|
double |
getMass()
Get body mass.
|
double |
getWeight()
Get body weight (mass * gravity).
|
void |
prepare(FeatureProvider provider)
Prepare the feature.
|
void |
resetGravity()
Reset current gravity force (usually when hit the ground).
|
void |
setDesiredFps(int desiredFps)
Set the desired fps.
|
void |
setGravity(double gravity)
Set the gravity to use.
|
void |
setGravityMax(double max)
Set the maximum gravity value.
|
void |
setMass(double mass)
Set body mass.
|
void |
setVectors(Direction... vectors)
Set forces involved in gravity and movement.
|
void |
update(double extrp) |
checkListener, getFeature, getFeatures, getFeaturesType, hasFeature
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
checkListener
getFeature, getFeatures, getFeaturesType, hasFeature
public BodyModel()
The Featurable
must have:
public void prepare(FeatureProvider provider)
Feature
Featurable.addFeature(Feature)
or
Featurable.addFeatureAndGet(Feature)
.prepare
in interface Feature
prepare
in class FeatureModel
provider
- The owner reference.public void resetGravity()
Body
resetGravity
in interface Body
public void setVectors(Direction... vectors)
Body
setVectors
in interface Body
vectors
- The vectors list.public void setDesiredFps(int desiredFps)
Body
setDesiredFps
in interface Body
desiredFps
- The desired fps.public void setGravity(double gravity)
Body
Body.GRAVITY_EARTH
is used by default.setGravity
in interface Body
gravity
- The gravity to use (in m/s²).public void setGravityMax(double max)
Body
setGravityMax
in interface Body
max
- The maximum gravity value.public void setMass(double mass)
Body
public double getMass()
Body
Copyright © 2017 Byron 3D Games Studio. All rights reserved.