com.cult3d.world
Class CultObject

java.lang.Object
  |
  +--com.cult3d.world.Node
        |
        +--com.cult3d.world.CultObject

public class CultObject
extends Node

This class provides a Java representation for a Cult3D object that exists in the scene graph of the Cult3D Designer.

Here is an example which creates an CultObject. After creation a rotatin around the x-axis and a translation along the y-axis is performed.

 	CultObject cube = new CultObject("RedCube");
 	cube.rotate(Node.X, 2.0);
 	cube.translate(0.0, 1.0, 0.0, 2000);
  
Note, methods have been moved to the parent/super class in 5.3 release to achieve a better structure.

Since:
Cult3D 4.0

Field Summary
static byte AA_DEFAULT
          Sets the object to a none antialiased state when changing materials.
static byte AA_IGNORE
          The object stays in its current antialiased mode when changing materials, as opposed to AA_DEFAULT.
 
Fields inherited from class com.cult3d.world.Node
LOCAL, WORLD, X, Y, Z
 
Constructor Summary
CultObject(java.lang.String name)
          Constructs a Java representation of a Cult3D Object that exists in the scene graph of the Cult3D Designer.
 
Method Summary
 java.lang.String getInfo()
           Returns a string representation of the values of this object.
 Material getMaterialAt(int index)
          Gets the material at the specified index.
 int getMaterialCount()
          Returns the number of materials assigned to this object.
 Vector3 getMaxVertexPosition()
          Returns one position of one of the max corner of the bounding box of this object.
 Vector3 getMinVertexPosition()
          Returns one position of one of the min corner of the bounding box of this object.
 void replaceTextureColor(java.awt.Color oldColor, java.awt.Color newColor, boolean applyToChildren)
          Replaces one color in all textures of this object.
 void replaceTextureColor(java.awt.Color oldColor, java.awt.Color newColor, boolean applyToChildren, int tolerance)
          Replaces one color in all textures of this object.
 void replaceTextureColor(RGB oldColor, RGB newColor, boolean applyToChildren)
          Replaces one color in all textures of this object.
 void replaceTextureColor(RGB oldColor, RGB newColor, boolean applyToChildren, int tolerance)
          Replaces one color in all textures of this object.
 void setInteractivityFeedbackStatus(boolean status)
          Changes the feedback of the cursor when hoovering over this object.
 void setMaterialAt(int index, Material material, boolean applyToChilren, boolean applyUniformly)
          Sets the material at the specified index.
 void setMaterialAt(int index, Material material, boolean applyToChilren, boolean applyUniformly, byte antiAliasingMode)
          Sets the material at the specified index.
 java.lang.String toString()
           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.
 
Methods inherited from class com.cult3d.world.Node
addChild, addChildToRoot, disconnect, equals, getChildAt, getChildCount, getFirstChild, getFirstNode, getName, getNextSibling, getOrientation, getParent, getPosition, getTransform, isBoundingBoxVisible, isVisible, nodeToWorld, rotate, rotate, rotate, rotate, rotateDegrees, rotateDegrees, rotateDegrees, rotateDegrees, setBoundingBoxVisible, setName, setOrientation, setPosition, setTransform, setVisible, setVisible, stopRotation, stopTranslation, translate, translate, translate, translate, worldToNode
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

AA_DEFAULT

public static final byte AA_DEFAULT
Sets the object to a none antialiased state when changing materials.
Since:
Cult3D 5.2

AA_IGNORE

public static final byte AA_IGNORE
The object stays in its current antialiased mode when changing materials, as opposed to AA_DEFAULT.
Since:
Cult3D 5.2
Constructor Detail

CultObject

public CultObject(java.lang.String name)
Constructs a Java representation of a Cult3D Object that exists in the scene graph of the Cult3D Designer. The uniqe name of the object, as defined in the Designer, is given as a parameter. Make sure that the spelling of the name is exactly as in the Designer, including any captial letters.
Parameters:
name - The name of the object.
Throws:
NameNotFoundException - if an object with the given name can't be found.
Since:
Cult3D 4.0
Method Detail

getMinVertexPosition

public Vector3 getMinVertexPosition()
Returns one position of one of the min corner of the bounding box of this object.
The pivot of the object has coordinate (0,0,0). Each vertex can be seen as an offset from the pivot. When you ask for the minimum vertex positions, you are asking for the largest negative offset value. This coordinate is not necessarily describing real vertices of the objects, but the bounding box.

Use getMaxVertexPosition() to obtain the position of the opposite corner of the bounding box.

Returns:
The position of the minimum corner of the bounding box.
Since:
Cult3D 4.2
See Also:
getMaxVertexPosition()

getMaxVertexPosition

public Vector3 getMaxVertexPosition()
Returns one position of one of the max corner of the bounding box of this object.
The pivot of the object has coordinate (0,0,0). Each vertex can be seen as an offset from the pivot. When you ask for the maximum vertex positions, you are asking for the largest positive offset value. This coordinate is not necessarily describing real vertices of the objects, but the bounding box.

Use getMinVertexPosition() to obtain the position of the opposite corner of the bounding box.

Returns:
The position of the maximum corner of the bounding box.
Since:
Cult3D 4.2
See Also:
getMaxVertexPosition()

setInteractivityFeedbackStatus

public void setInteractivityFeedbackStatus(boolean status)
Changes the feedback of the cursor when hoovering over this object. If set to true, the cursor will change to a pointing hand when the mouse cursor hoovers over this object, to indicate that it is clickable. If set to false, this interactivity feedback is disabled. If this object is clickable and you set setInteractivityFeedbackStatus to false it will still be clickable but with no hand to indicate it.
Parameters:
status - If true, the interactive cursor is used on this object. Otherwise, it's not used.
Since:
Cult3D 4.2

getMaterialCount

public int getMaterialCount()
Returns the number of materials assigned to this object.
Returns:
the number of materials.
Since:
Cult3D 4.2

getMaterialAt

public Material getMaterialAt(int index)
Gets the material at the specified index.
Parameters:
index - the index.
Returns:
the Material.
Throws:
IndexOutOfBoundsException - is throwed when the index is out of range.
Since:
Cult3D 4.2
See Also:
setMaterialAt(int, com.cult3d.world.Material, boolean, boolean)

setMaterialAt

public void setMaterialAt(int index,
                          Material material,
                          boolean applyToChilren,
                          boolean applyUniformly)
Sets the material at the specified index.
Parameters:
index - the index.
material - the new Material.
applyToChildren - if true this is applied to this objects children.
applyUniformly - if true all Materials of this objects are set to the new material.
Throws:
IndexOutOfBoundsException - is throwed when the index is out of range.
Since:
Cult3D 4.2
See Also:
getMaterialAt(int)

setMaterialAt

public void setMaterialAt(int index,
                          Material material,
                          boolean applyToChilren,
                          boolean applyUniformly,
                          byte antiAliasingMode)
Sets the material at the specified index.
Parameters:
index - the index.
material - the new Material.
applyToChildren - if true this is applied to this objects children.
applyUniformly - if true all Materials of this objects are set to the new material.
antiAliasingMode - AntiAliasing behaviour. Set to AA_DEFAULT for default behavior, AA_IGNORE for Antialiasing not to care about this call.
Throws:
IndexOutOfBoundsException - is throwed when the index is out of range.
Since:
Cult3D 5.2
See Also:
getMaterialAt(int)

replaceTextureColor

public void replaceTextureColor(RGB oldColor,
                                RGB newColor,
                                boolean applyToChildren)
Replaces one color in all textures of this object.
Parameters:
oldColor - the old color.
newColor - the new color.
applyToChildren - if true this is applied to this objects children.
Since:
Cult3D 4.2

replaceTextureColor

public void replaceTextureColor(java.awt.Color oldColor,
                                java.awt.Color newColor,
                                boolean applyToChildren)
Replaces one color in all textures of this object.
Parameters:
oldColor - the old color.
newColor - the new color.
applyToChildren - if true this is applied to this objects children.
Since:
Cult3D 4.2

replaceTextureColor

public void replaceTextureColor(RGB oldColor,
                                RGB newColor,
                                boolean applyToChildren,
                                int tolerance)
Replaces one color in all textures of this object.
Parameters:
oldColor - the old color.
newColor - the new color.
applyToChildren - if true this is applied to this objects children.
tolerance - how tolerant should the change be.
Since:
Cult3D 4.2

replaceTextureColor

public void replaceTextureColor(java.awt.Color oldColor,
                                java.awt.Color newColor,
                                boolean applyToChildren,
                                int tolerance)
Replaces one color in all textures of this object.
Parameters:
oldColor - the old color.
newColor - the new color.
applyToChildren - if true this is applied to this objects children.
tolerance -  
Since:
Cult3D 4.2

getInfo

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.

Overrides:
getInfo in class Node
Returns:
A string representing this object.
Since:
Cult3D 5.3

toString

public java.lang.String toString()

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.

Overrides:
toString in class Node
Returns:
A string representing this object.