|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.lenkaspace.creeper.model.CRBaseModel
net.lenkaspace.creeper.model.CRBaseSituatedModel
net.lenkaspace.creeper.model.CRBaseDynamicModel
public class CRBaseDynamicModel
Represents a model that is situated in a CRWorld, can be rendered and moves / updates
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class net.lenkaspace.creeper.model.CRBaseSituatedModel |
|---|
CRBaseSituatedModel.SHAPE |
| Field Summary |
|---|
| Fields inherited from class net.lenkaspace.creeper.model.CRBaseSituatedModel |
|---|
binIndex |
| Fields inherited from class net.lenkaspace.creeper.model.CRBaseModel |
|---|
childModels, id |
| Constructor Summary | |
|---|---|
CRBaseDynamicModel(int id_,
CRVector3d position_,
CRVector3d size_,
double rotation_,
CRBaseSituatedModel.SHAPE shape_,
java.lang.String imageFileName_)
Constructor |
|
| Method Summary | |
|---|---|
void |
applyThrusters()
Calculation of new x y position based on thrust forces |
CRVector3d |
getLookAtVector()
Get vector that points in front of the situated model |
CRVector3d |
getOrientationVector()
Get normalised steering force vector |
double |
getThrustForce()
|
CRVector3d |
getVelocity()
Get current velocity based on rotation and thrustforce. |
void |
onTrialStart(int trialNumber_,
int runNumber_)
Set variables according to their initial values |
void |
onUpdateLoopEnd()
Called from CRWorld after update() of all objects is called. |
void |
onUpdateLoopStart()
Called from CRWorld before update() of all objects is called. |
void |
setThrustForce(double value)
Sets thrust force and makes sure it is within specified bounds. |
void |
turnByAngle(double angle_)
Turn by a certain angle, i.e. |
void |
update()
Main update function. |
| Methods inherited from class net.lenkaspace.creeper.model.CRBaseSituatedModel |
|---|
adjustPositionInBorderlessWorld, getAlpha, getCorners, getImageFileName, getPosition, getPreviousPosition, getRelativeVectorTo, getRelativeVectorTo, getRotation, getShape, getSize, getToolTip, getWorld, isAt, isCollidingWith, isCollidingWith, isVisible, rotateVectorInLocalCoordinates, setAlpha, setImageFileName, setIsRemoved, setIsVisible, setPosition, setPositionX, setPositionY, setRotation, setSize, setToolTop, setWorld |
| Methods inherited from class net.lenkaspace.creeper.model.CRBaseModel |
|---|
addChildModel, clearChildren, getId, getIsRemoved, onRunEnd, onRunStart, onTrialEnd, removeChildModel, setId |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CRBaseDynamicModel(int id_,
CRVector3d position_,
CRVector3d size_,
double rotation_,
CRBaseSituatedModel.SHAPE shape_,
java.lang.String imageFileName_)
id_ - Id of the modelposition_ - CRVector3d position [x,y,z]size_ - CRVector3d size [width, height, depth]rotation_ - Double rotation in degrees where 0 is pointing towards topshape_ - SHAPE shapeimageFileName_ - String image name that is used for rendering. If empty or null, the instance doesn't render. Use your own image or one of CRRenderer constants| Method Detail |
|---|
public void onTrialStart(int trialNumber_,
int runNumber_)
onTrialStart in class CRBaseSituatedModeltrialNumber_ - int new trial numberrunNumber_ - int new run numberpublic void onUpdateLoopStart()
public void onUpdateLoopEnd()
public void update()
public void applyThrusters()
public void turnByAngle(double angle_)
angle_ - value to add to the current rotationpublic CRVector3d getVelocity()
public CRVector3d getOrientationVector()
public CRVector3d getLookAtVector()
public double getThrustForce()
public void setThrustForce(double value)
value - thrust force
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||