|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.cult3d.world.Node
This class provides a Java representation for a Cult3D Node that exists in the scene graph of the Cult3D project.
Field Summary | |
static short |
LOCAL
The local reference frame of the Cult3D universe. |
static short |
WORLD
the world reference frame of the Cult3D universe. |
static int |
X
The x-axis. |
static int |
Y
The y-axis. |
static int |
Z
The z-axis. |
Method Summary | |
void |
addChild(Node child)
Attaches a node as a child to this node. |
static void |
addChildToRoot(Node child)
Adds a node too the highest level in the scene graph. |
void |
disconnect()
Disconnects a node from the scene graph. |
boolean |
equals(java.lang.Object obj)
Compares two Nodes for equality. |
Node |
getChildAt(int index)
Returns the child at the specified index. |
int |
getChildCount()
Returns the number of children of this node in the scene graph. |
Node |
getFirstChild()
Returns the first child to this node. |
static Node |
getFirstNode()
Gets the first node of the scene graph. |
java.lang.String |
getInfo()
Returns a string representation of the values of this object. |
java.lang.String |
getName()
Returns the Name of this node. |
Node |
getNextSibling()
Gets the next sibling to this node. |
Matrix4x4 |
getOrientation(short refFrame)
Gets the orientation of this object relative to the given reference frame. |
Node |
getParent()
Gets the parent of this node. |
Vector3 |
getPosition(short refFrame)
Gets the position of this node in the given reference frame. |
Matrix4x4 |
getTransform(short refFrame)
Gets the transform matrix for this object relative to the given reference frame. |
boolean |
isBoundingBoxVisible()
Determines whether this objects boundingbox is visible. |
boolean |
isVisible()
Determines whether this object is visible. |
Matrix4x4 |
nodeToWorld(Matrix4x4 nodecoord)
Converts the given matrix from the local reference frame to the world reference frame. |
void |
rotate(int axis,
float amount)
Rotates the object the given amount in radians around the given axis. |
void |
rotate(int axis,
float amount,
double ms)
Smoothly rotates the object in in radians around the given axis in its own reference frame. |
void |
rotate(int axis,
float amount,
double ms,
boolean loop)
Smoothly rotates the object the given amount in radians around the given axis in its own reference frame. |
void |
rotate(int axis,
float amount,
double ms,
CultEvent ce)
Smoothly rotates the object the given amount in radians around the given axis in its own reference frame. |
void |
rotateDegrees(int axis,
float amount)
Rotates the object the given amount in degrees around the given axis. |
void |
rotateDegrees(int axis,
float amount,
double ms)
Smoothly rotates the object in in degrees around the given axis in its own reference frame. |
void |
rotateDegrees(int axis,
float amount,
double ms,
boolean loop)
Smoothly rotates the object the given amount in degrees around the given axis in its own reference frame. |
void |
rotateDegrees(int axis,
float amount,
double ms,
CultEvent ce)
Smoothly rotates the object the given amount in degrees around the given axis in its own reference frame. |
void |
setBoundingBoxVisible(boolean state)
Shows or hides this objects boundingbox depending on the value of parameter state . |
void |
setName(java.lang.String name)
Changes the name of this node to the name given as parameter |
void |
setOrientation(short refFrame,
Matrix4x4 matrix)
Sets the orientation of this object relative to the given reference frame. |
void |
setPosition(short refFrame,
Vector3 newPos)
Sets the position for this node in the given reference frame. |
void |
setTransform(short refFrame,
Matrix4x4 matrix)
Sets the transform for this object relative to the given reference frame. |
void |
setVisible(boolean state)
Shows or hides this object depending on the value of parameter state . |
void |
setVisible(boolean visibleState,
boolean applyToChildren)
Shows or hides this object depending on the value of parameter. |
void |
stopRotation()
Stops any rotations this object is currently performing. |
void |
stopTranslation()
Stops any translations this object is currently performing. |
java.lang.String |
toString()
Returns a string representation of the values of this object. |
void |
translate(float amountx,
float amounty,
float amountz)
Translates the object in its own reference frame. |
void |
translate(float amountx,
float amounty,
float amountz,
double ms)
Smoothly translates the object in its own reference frame. |
void |
translate(float amountx,
float amounty,
float amountz,
double ms,
boolean loop)
Smoothly translates the object in its own reference frame. |
void |
translate(float amountx,
float amounty,
float amountz,
double ms,
CultEvent ce)
Smoothly translates the object in its own reference frame. |
Matrix4x4 |
worldToNode(Matrix4x4 worldcoord)
Converts the given matrix from the world reference frame to the local reference frame. |
Methods inherited from class java.lang.Object |
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
public static final int X
public static final int Y
public static final int Z
public static final short LOCAL
public static final short WORLD
Method Detail |
public void rotate(int axis, float amount)
axis
- the axis to rotate around. Use the static varables X, Y, and Z defined in this class.amount
- the amount in radians to rotate this object.X
,
Y
,
Z
public void rotate(int axis, float amount, double ms)
axis
- the axis to rotate around. Use the static varables X, Y, and Z defined in this class.amount
- the amount to rotate, in radians.ms
- The time the rotation will last, in milliseconds.X
,
Y
,
Z
public void rotate(int axis, float amount, double ms, CultEvent ce)
axis
- the axis to rotate around. Use the static varables X, Y, and Z defined in this class.amount
- the amount to rotate in radians.ms
- The time the rotation will last, in milliseconds.ce
- A CultEvent to be triggered when the rotation has come to a full stop.X
,
Y
,
Z
public void rotate(int axis, float amount, double ms, boolean loop)
axis
- the axis to rotate around. Use the static varables X, Y, and Z defined in this class.amount
- the amount to rotate in radians.ms
- The time the rotation will last, in milliseconds.X
,
Y
,
Z
,
stopRotation()
public void rotateDegrees(int axis, float amount)
axis
- the axis to rotate around. Use the static varables X, Y, and Z defined in this class.amount
- the amount in degrees to rotate this object.X
,
Y
,
Z
public void rotateDegrees(int axis, float amount, double ms)
axis
- the axis to rotate around. Use the static varables X, Y, and Z defined in this class.amount
- the amount to rotate, in degrees.ms
- The time the rotation will last, in milliseconds.X
,
Y
,
Z
public void rotateDegrees(int axis, float amount, double ms, CultEvent ce)
axis
- the axis to rotate around. Use the static varables X, Y, and Z defined in this class.amount
- the amount to rotate in radians.ms
- The time the rotation will last, in milliseconds.ce
- A CultEvent to be triggered when the rotation has come to a full stop.X
,
Y
,
Z
public void rotateDegrees(int axis, float amount, double ms, boolean loop)
axis
- the axis to rotate around. Use the static varables X, Y, and Z defined in this class.amount
- the amount to rotate in radians.ms
- The time the rotation will last, in milliseconds.X
,
Y
,
Z
,
stopRotation()
public void stopRotation()
public Vector3 getPosition(short refFrame)
refFrame
- The reference frame, use the class variables WORLD or LOCALVector3
,
LOCAL
,
WORLD
public void setPosition(short refFrame, Vector3 newPos)
refFrame
- The reference frame, use the class variables WORLD or LOCALVector3
- The position where the object is moved to in relation with the given reference frameLOCAL
,
WORLD
public Matrix4x4 worldToNode(Matrix4x4 worldcoord)
worldCoord
- The matrix which has been converted from world to local.public Matrix4x4 nodeToWorld(Matrix4x4 nodecoord)
nodecoord
- The matrix which has been converted from local to world.public Matrix4x4 getOrientation(short refFrame)
refFrame
- WORLD or LOCAL for the reference frame. Use the class variables WORLD or LOCAL.LOCAL
,
WORLD
public void setOrientation(short refFrame, Matrix4x4 matrix)
refFrame
- WORLD or LOCAL for the reference frame. Use the class variables WORLD and LOCAL.matrix
- The matrix which contains the coordinates you want to set to this node.LOCAL
,
WORLD
public Matrix4x4 getTransform(short refFrame)
refFrame
- WORLD or LOCAL for the reference frame. Use the class variables WORLD and LOCAL.LOCAL
,
WORLD
public void setTransform(short refFrame, Matrix4x4 matrix)
refFrame
- WORLD or LOCAL for the reference frame. use the class variables WORLD and LOCAL.matrix
- The matrix which contains the coordinates you want to set to this node.LOCAL
,
WORLD
public void translate(float amountx, float amounty, float amountz)
amountx
- the amount to translate along the x-axis.amounty
- the amount to translate along the y-axis.amountz
- the amount to translate along the z-axis.public void translate(float amountx, float amounty, float amountz, double ms)
amountx
- the amount to translate along the x-axis.amounty
- the amount to translate along the y-axis.amountz
- the amount to translate along the z-axis.ms
- The time the rotation will last, in milliseconds.public void translate(float amountx, float amounty, float amountz, double ms, CultEvent ce)
amountx
- the amount to translate along x-axis.amounty
- the amount to translate along y-axis.amountz
- the amount to translate along z-axis.ms
- time in miliseconds.ce
- CultEvent to trigger vhen translation have finished.public void translate(float amountx, float amounty, float amountz, double ms, boolean loop)
amountx
- the amount to translate along the x-axis.amounty
- the amount to translate along the y-axis.amountz
- the amount to translate along the z-axis.ms
- time in miliseconds.loop
- loop flag, if true the translation will loop.public void stopTranslation()
public static Node getFirstNode()
public static void addChildToRoot(Node child)
child
- the node to add to the scene graph.public Node getParent()
public Node getNextSibling()
public int getChildCount()
public Node getFirstChild()
public Node getChildAt(int index)
index
- The index number the child has in the scene graph.public void disconnect()
public void addChild(Node child)
child
- a node to add as a child.public java.lang.String getName()
public void setName(java.lang.String name)
name
- the new name.public boolean equals(java.lang.Object obj)
obj
- the reference object with which to compare.public void setVisible(boolean state)
state
.state
- If true
shows this object, if false
hide this object.isVisible()
public void setVisible(boolean visibleState, boolean applyToChildren)
state
- If true
shows this object, if false
hide this object.applyToChildren
- If true
all child to this object will be hidden/visible, if false
only this object will be hidden/visibleisVisible()
public boolean isVisible()
true
if the object is visible,
false
otherwise.setVisible(boolean)
public void setBoundingBoxVisible(boolean state)
state
.state
- If true the bounding box will be shown, if false the boundingbox will be hidden.isBoundingBoxVisible()
public boolean isBoundingBoxVisible()
true
if the objects boundingbox is visible;
false
otherwise.setBoundingBoxVisible(boolean)
public java.lang.String getInfo()
Returns a string representation of the values of this object.
This method is intended to be used only for debugging purposes, and the content and format of the returned string may vary between implementations and versions of Cult3D.
public java.lang.String toString()
Returns a string representation of the values of this object.
The string contains the name of this class and the name of this node
.This method is intended to be used only for debugging purposes, and the content and format of the returned string may vary between implementations and versions of Cult3D.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |