Modifier and Type | Class and Description |
---|---|
static class |
MrObject.MrObjectBuilder
Builder base class for MrObject creation
|
Modifier | Constructor and Description |
---|---|
protected |
MrObject(MrObjectController controller)
Creates an MrObject using a controller
|
Modifier and Type | Method and Description |
---|---|
boolean |
addChild(MrObject data) |
java.util.Iterator<MrObject> |
breadthTraversal() |
java.util.Iterator<MrObject> |
depthTraversal() |
MrObject |
findChild(java.lang.String key) |
java.util.List<MrObject> |
getByType(MrSceneObjectType type) |
java.util.List<MrObject> |
getChildren() |
MrObjectController |
getController()
Gets the object controller of this object
|
MrEventsListener |
getEventsListener()
Gets the current event listener
|
MrVector3f |
getForward()
Gets the positive Y axis of this object local axis in world coordinates
|
MrVector3f |
getLocation()
Gets the location of this object
|
java.lang.String |
getName()
Gets the name of this object
|
MrObject |
getParent() |
java.util.Set<java.lang.String> |
getRegisteredEvents()
Gets a set of all registered events
|
MrVector3f |
getRight()
Gets the positive X axis of this object local axis in world coordinates
|
MrRobottoEngine |
getRobottoEngine()
Gets the reference to the engine used.
|
MrObject |
getRoot() |
MrQuaternion |
getRotation()
Gets the rotation quaternion
|
MrVector3f |
getScale()
Gets the scale vector of this object
|
MrSceneObjectType |
getSceneObjectType()
Gets the type of this object
|
MrShaderProgram |
getShaderProgram()
Gets the current shader program, if the object has any
|
MrTransform |
getTransform()
Gets the transformation object of this object
|
MrSceneTree |
getTree()
Gets the SceneTree which this objects belongs to
|
java.util.Map<java.lang.String,MrUniformGenerator> |
getUniformGenerators()
Gets the uniform generators associated to this object
|
java.util.Map<java.lang.String,MrUniformKey> |
getUniformKeys()
Gets the uniform keys provided by this object
|
MrVector3f |
getUp()
Gets the positive Z axis of this object local axis in world coordinates
|
void |
initializeUniforms(java.util.Map<java.lang.String,MrUniformGenerator> uniformGenerators)
Call this method if you want to create a new uniform generator for this object
|
boolean |
isChild(MrObject data) |
boolean |
isChild(java.lang.String key) |
boolean |
isEventRegistered(java.lang.String evName)
Checks if the event is register in the event listener of this object
|
boolean |
isInitialized()
Checks if initialize has been called on this object
|
java.util.Iterator<java.util.Map.Entry<java.lang.String,MrObject>> |
parentKeyChildValueTraversal() |
java.util.Iterator<MrObject> |
parentTraversal() |
protected void |
queueEvent(java.lang.Runnable runnable)
Queues a runnable.
|
void |
registerEvent(java.lang.String eventName)
Registers an event
|
boolean |
removeChild(MrObject data) |
void |
rotate(float angle,
float x,
float y,
float z)
Rotates this object by the given angle around the given axis
|
void |
rotate(float angle,
MrVector3f axis)
Rotates the object by a certain angle around the given axis
|
void |
rotate(MrQuaternion q)
Rotates this object by the given rotation
|
void |
rotateAround(float angle,
MrVector3f point,
MrVector3f axis)
Rotates this object by the given angle, around the given axis, located at the given point
|
void |
rotateAround(float angle,
MrVector3f point,
MrVector3f axis,
MrVector3f through)
Rotates this object by the given angle, around the given axis and passing through the given point
|
void |
scale(float s)
Scales the object in all axis
|
void |
scale(float sx,
float sy,
float sz)
Scales every axis by given values
|
void |
scale(MrVector3f s)
Scales every axis by given values
|
void |
setEventsListener(MrEventsListener eventsListener)
Sets a new event listener
|
void |
setLocation(float x,
float y,
float z)
Sets the location of this object.
|
void |
setLocation(MrVector3f location)
Sets the location of this object.
|
void |
setLookAt(MrVector3f look)
Sets where this object will point to.
|
void |
setLookAt(MrVector3f look,
MrVector3f up)
Points this object to look with the given up vector
|
void |
setRobottoEngine(MrRobottoEngine robotto)
Sets the reference to the engine.
|
void |
setRotation(float angle,
float x,
float y,
float z)
Sets the rotation of this object.
|
void |
setRotation(float angle,
MrVector3f axis)
Sets the rotation of this object.
|
void |
setRotation(MrQuaternion rotation)
Sets the rotation of this object using a quaternion
|
void |
setScale(float sx,
float sy,
float sz)
Sets the scale of this object.
|
void |
setScale(MrVector3f scale)
Sets the scale of this object.
|
void |
setTransform(MrTransform transform)
Sets a new transform for this object
|
void |
setTree(MrSceneTree tree) |
java.lang.String |
toString() |
void |
translate(float x,
float y,
float z)
Translates an object by x, y, z for every axis in world coordinates
|
void |
translate(MrVector3f v)
Translates an object by the given vector in world coordinates
|
void |
unregisterEvent(java.lang.String eventName)
Unregisters an event
|
protected MrObject(MrObjectController controller)
controller
- controller for this objectpublic MrObjectController getController()
public MrRobottoEngine getRobottoEngine()
public void setRobottoEngine(MrRobottoEngine robotto)
robotto
- the engine which contains this objectprotected void queueEvent(java.lang.Runnable runnable)
runnable
- runnable to be executedpublic void initializeUniforms(java.util.Map<java.lang.String,MrUniformGenerator> uniformGenerators)
uniformGenerators
- uniform generator map to add new generatorspublic MrSceneObjectType getSceneObjectType()
public boolean isInitialized()
public java.lang.String getName()
public MrTransform getTransform()
public void setTransform(MrTransform transform)
transform
- public java.util.Map<java.lang.String,MrUniformGenerator> getUniformGenerators()
public MrShaderProgram getShaderProgram()
public java.util.Map<java.lang.String,MrUniformKey> getUniformKeys()
public MrSceneTree getTree()
public void setTree(MrSceneTree tree)
public boolean addChild(MrObject data)
public boolean removeChild(MrObject data)
public java.util.List<MrObject> getByType(MrSceneObjectType type)
public MrObject getRoot()
public MrObject findChild(java.lang.String key)
public boolean isChild(MrObject data)
public boolean isChild(java.lang.String key)
public MrObject getParent()
public java.util.List<MrObject> getChildren()
public java.util.Iterator<MrObject> parentTraversal()
public java.util.Iterator<MrObject> breadthTraversal()
public java.util.Iterator<MrObject> depthTraversal()
public java.util.Iterator<java.util.Map.Entry<java.lang.String,MrObject>> parentKeyChildValueTraversal()
public MrEventsListener getEventsListener()
public void setEventsListener(MrEventsListener eventsListener)
eventsListener
- public boolean isEventRegistered(java.lang.String evName)
evName
- event namepublic java.util.Set<java.lang.String> getRegisteredEvents()
public void registerEvent(java.lang.String eventName)
eventName
- public void unregisterEvent(java.lang.String eventName)
eventName
- public MrQuaternion getRotation()
public void setRotation(MrQuaternion rotation)
rotation
- public void rotate(float angle, MrVector3f axis)
angle
- angle of rotation in degreesaxis
- axis in world coordinatespublic void translate(float x, float y, float z)
x
- translation in xy
- translation in yz
- translation in zpublic void scale(float s)
s
- scale factorpublic void scale(MrVector3f s)
s
- scale vectorpublic MrVector3f getRight()
public void setLookAt(MrVector3f look, MrVector3f up)
look
- up
- public void scale(float sx, float sy, float sz)
sx
- scale in X axissy
- scale in Y axissz
- scale in Z axispublic void setScale(float sx, float sy, float sz)
sx
- sy
- sz
- public void translate(MrVector3f v)
v
- public MrVector3f getForward()
public MrVector3f getScale()
public void setScale(MrVector3f scale)
scale
- public void setLocation(float x, float y, float z)
x
- y
- z
- public void setRotation(float angle, MrVector3f axis)
angle
- angle of rotation in degreesaxis
- axis to rotate around in world coordinatespublic MrVector3f getUp()
public void setLookAt(MrVector3f look)
look
- public void setRotation(float angle, float x, float y, float z)
angle
- angle of rotation in degreesx
- y
- z
- public MrVector3f getLocation()
public void setLocation(MrVector3f location)
location
- public void rotateAround(float angle, MrVector3f point, MrVector3f axis)
angle
- angle of rotation in degreespoint
- point where the object will be locatedaxis
- axis of rotation in world coordinatespublic void rotate(MrQuaternion q)
q
- public void rotateAround(float angle, MrVector3f point, MrVector3f axis, MrVector3f through)
angle
- angle of rotation in degreespoint
- point where the object will be locatedaxis
- axis of rotation in world coordinatesthrough
- point to pass through when rotates in world coordinatespublic void rotate(float angle, float x, float y, float z)
angle
- x
- y
- z
- public java.lang.String toString()
toString
in class java.lang.Object