|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.lenkaspace.creeper.model.CRBaseModel net.lenkaspace.creeper.model.CRBaseSituatedModel
public class CRBaseSituatedModel
Represents a model that is situated in a CRWorld and can optionally be rendered but doesn't update
Nested Class Summary | |
---|---|
static class |
CRBaseSituatedModel.SHAPE
|
Field Summary | |
---|---|
int |
binIndex
|
Fields inherited from class net.lenkaspace.creeper.model.CRBaseModel |
---|
childModels, id |
Constructor Summary | |
---|---|
CRBaseSituatedModel(int id_,
CRVector3d position_,
CRVector3d size_,
double rotation_,
CRBaseSituatedModel.SHAPE shape_,
java.lang.String imageFileName_)
Constructor |
Method Summary | |
---|---|
void |
adjustPositionInBorderlessWorld()
Sends agent to the left side when went away through right, etc. |
double |
getAlpha()
|
CRVector3d[] |
getCorners()
Get coordinates of corners, based on shape and current rotation |
java.lang.String |
getImageFileName()
|
CRVector3d |
getPosition()
|
CRVector3d |
getPreviousPosition()
|
CRVector3d |
getRelativeVectorTo(CRVector3d vector_)
Get vector to an object translated into local coordinates, based on middle of own body as pivot |
CRVector3d |
getRelativeVectorTo(CRVector3d vector_,
CRVector3d pivot_)
Get vector to an object translated into local coordinates |
double |
getRotation()
|
CRBaseSituatedModel.SHAPE |
getShape()
|
CRVector3d |
getSize()
|
java.lang.String |
getToolTip()
|
CRWorld |
getWorld()
|
boolean |
isAt(CRVector3d coords_,
int extraSpace_)
Find out whether specific coordinates have been reached by any part of the body |
boolean |
isCollidingWith(CRBaseSituatedModel anotherObject_)
Find out if colliding with another object |
boolean |
isCollidingWith(CRBaseSituatedModel anotherObject_,
int extraSpace_)
Find out if colliding with another object |
boolean |
isVisible()
|
void |
onTrialStart(int trialNumber_,
int runNumber_)
Set variables according to their initial values |
void |
rotateVectorInLocalCoordinates(CRVector3d vector_)
Rotate a vector around own middle |
void |
setAlpha(double alpha_)
|
void |
setImageFileName(java.lang.String imageFileName_)
|
void |
setIsRemoved(boolean is_)
|
void |
setIsVisible(boolean value_)
|
void |
setPosition(CRVector3d position_)
|
void |
setPositionX(double value_)
|
void |
setPositionY(double value_)
|
void |
setRotation(double rotation_)
|
void |
setSize(CRVector3d size_)
|
void |
setToolTop(java.lang.String toolTip_)
|
void |
setWorld(CRWorld world_)
|
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 |
Field Detail |
---|
public int binIndex
Constructor Detail |
---|
public CRBaseSituatedModel(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 constantsMethod Detail |
---|
public void onTrialStart(int trialNumber_, int runNumber_)
onTrialStart
in class CRBaseModel
trialNumber_
- int new trial numberrunNumber_
- int new run numberpublic boolean isCollidingWith(CRBaseSituatedModel anotherObject_)
anotherObject_
- CRBaseSituatedModel another object
public boolean isCollidingWith(CRBaseSituatedModel anotherObject_, int extraSpace_)
anotherObject_
- CRBaseSituatedModel another objectextraSpace_
- int extra space around this object that will also count as collision. Not implemented for RECRANGLEs
public boolean isAt(CRVector3d coords_, int extraSpace_)
coords_
- CRVector3d coordinates to hit test withextraSpace_
- int extra space around the object that should be included in the hit test !TODO: not implemented for Rectangles
public CRVector3d[] getCorners()
public void rotateVectorInLocalCoordinates(CRVector3d vector_)
vector_
- CRVector3d vector to rotatepublic CRVector3d getRelativeVectorTo(CRVector3d vector_)
vector_
- CRVector3d vector to point towards
public CRVector3d getRelativeVectorTo(CRVector3d vector_, CRVector3d pivot_)
vector_
- CRVector3d vector to point towardspivot_
- CRVector3d vector (within own body) to measure from.
public void adjustPositionInBorderlessWorld()
public double getRotation()
public void setRotation(double rotation_)
public CRVector3d getPosition()
public void setPosition(CRVector3d position_)
public void setPositionX(double value_)
public void setPositionY(double value_)
public CRVector3d getPreviousPosition()
public CRVector3d getSize()
public void setSize(CRVector3d size_)
public CRWorld getWorld()
public void setWorld(CRWorld world_)
public java.lang.String getImageFileName()
public void setImageFileName(java.lang.String imageFileName_)
public boolean isVisible()
public void setIsVisible(boolean value_)
public CRBaseSituatedModel.SHAPE getShape()
public void setIsRemoved(boolean is_)
setIsRemoved
in class CRBaseModel
public void setToolTop(java.lang.String toolTip_)
public java.lang.String getToolTip()
public void setAlpha(double alpha_)
public double getAlpha()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |