net.dzzd.access
Interface IScene3D

All Superinterfaces:
IScene, IScene2D

public interface IScene3D
extends IScene2D

Used for accessing to a Scene3D.
provide simple methods to manage a 3D scene.

Since:
1.0
Version:
1.0
Author:
Bruno Augier
See Also:
Copyright Bruno Augier 2005

Method Summary
 void addCamera3D(ICamera3D c)
          Add the given Camera3D to this scene.
 void addLight3D(ILight3D l)
          Add the given Light3D to this scene.
 void addMesh3D(IMesh3D m)
          Add the given Mesh3D to this scene.
 void addScene3DObject(IScene3DObject object)
          Add the given Scene3DObject to this scene.
 void addScene3DObjects(IScene3DObject[] objects3D)
          Add multiple Scene3DObject to this scene.
 void clearScene3D()
          Clear this scene3D.
 int getBackgroundColor()
          Gets background color.
 ICamera3D getCamera3DById(int id)
          Gets the Camera3D having the given id from this scene.
 ICamera3D getCamera3DByName(java.lang.String name)
          Gets the Camera3D having the given name from this scene.
 ICamera3D getCurrentCamera3D()
          Gets the Camera3D used for camera space.
 int getFogColor()
          Gets fog color.
 ILight3D getLight3DById(int id)
          Gets the Light3D having the given id from this scene.
 ILight3D getLight3DByName(java.lang.String name)
          Gets the Light3D having the given name from this scene.
 IMesh3D getMesh3DById(int id)
          Gets the Mesh3D having the given id from this scene.
 IMesh3D getMesh3DByName(java.lang.String name)
          Gets the Mesh3D having the given name from this scene.
 int getNbCamera3D()
          Gets the number of ICamera3D for this scene.
 int getNbLight3D()
          Gets the number of ILight3D for this scene.
 int getNbMesh3D()
          Gets the number of IMesh3D for this scene.
 int getNbScene3DObject()
          Gets the number of Scene3DObject for this scene.
 int getSkyBoxMesh3DId()
          Gets the Mesh3D id object used as sky box.
 java.lang.String getSkyBoxMesh3DName()
          Gets the Mesh3D name object used as sky box.
 boolean isBackgroundEnabled()
          Gets the backgroundEnabled flag .
 boolean isFogEnabled()
          Gets the fogEnabled flag .
 void playScene3DObjectAnimator(int time)
          Sets all Scene3DObject using there Scene3DObjectAnimator for the given time.
 void removeCamera3DById(int id)
          Remove the Camera3D having the given id from this scene.
 void removeLight3DById(int id)
          Remove the Light3D having the given id from this scene.
 void removeMesh3DById(int id)
          Remove the Mesh3D having the given id from this scene.
 void removeScene3DObject(IScene3DObject object)
          Remove the given Scene3DObject from this scene.
 void setBackgroundColor(int color)
          Sets background color.
 void setBackgroundEnabled(boolean flag)
          Sets the backgroundEnabled flag .
 void setCurrentCamera3DById(int id)
          Sets the Camera3D to use for camera space using its id.
 void setCurrentCamera3DByName(java.lang.String name)
          Sets the Camera3D to use for camera space using its name.
 void setFogColor(int color)
          Sets fog color.
 void setFogEnabled(boolean flag)
          Sets the fogEnabled flag .
 void setScene3DBufferSize(int maxMesh3D, int maxLight3D, int maxCamera3D)
          Sets this scene3D internal buffer size.
 void setScene3DLoader(IScene3DLoader sceneLoader)
          Sets a Scene3DLoader for this Scene3D
 void setScene3DObjectToCamera()
          Sets all Scene3DObject to camera space.
 void setScene3DObjectToWorld()
          Sets all Scene3DObject to world space.
 void setSkyBoxMesh3DById(int id)
          Sets the Mesh3D id object to use as sky box.
 void setSkyBoxMesh3DByName(java.lang.String name)
          Sets the Mesh3D name object to use as sky box.
 
Methods inherited from interface net.dzzd.access.IScene2D
addScene2DObject, addScene2DObjects, addShape2D, clearScene2D, getNbScene2DObject, getNbShape2D, getShape2DById, getShape2DByName, removeScene2DObject, removeShape2DById, setScene2DBufferSize
 
Methods inherited from interface net.dzzd.access.IScene
addMaterial, addSceneObject, addSceneObjects, addTexture, getMaterialById, getMaterialByName, getMonitoredSceneObject, getNbMaterial, getNbMonitoredSceneObject, getNbSceneObject, getNbTexture, getTextureById, getTextureByName, removeMaterialById, removeSceneObject, removeTextureById, setSceneBufferSize, startMonitorSceneObject, stopMonitorSceneObject, updateMonitoredSceneObjects
 

Method Detail

setScene3DBufferSize

public void setScene3DBufferSize(int maxMesh3D,
                                 int maxLight3D,
                                 int maxCamera3D)
Sets this scene3D internal buffer size.

this method must be used to increase/reduce the scene3D internal buffers size.

Default value are :
IMesh3D : 4096
ILight3D : 1024
ICamera3D: 1024


Note: This method will reset the scene3D by calling clearScene3D internally.

Parameters:
maxMesh3D - maximum number of mesh3D allowed.
maxLight3D - maximum number of light3D allowed.
maxCamera3D - maximum number of camera3D allowed.

getNbScene3DObject

public int getNbScene3DObject()
Gets the number of Scene3DObject for this scene.

Returns:
number of Scene3DObject

getNbMesh3D

public int getNbMesh3D()
Gets the number of IMesh3D for this scene.

Returns:
number of IMesh3D

getNbLight3D

public int getNbLight3D()
Gets the number of ILight3D for this scene.

Returns:
number of ILight3D

getNbCamera3D

public int getNbCamera3D()
Gets the number of ICamera3D for this scene.

Returns:
number of ICamera3D

addMesh3D

public void addMesh3D(IMesh3D m)
Add the given Mesh3D to this scene.

Parameters:
m - the new Mesh3D to add.

addLight3D

public void addLight3D(ILight3D l)
Add the given Light3D to this scene.

Parameters:
l - the new Light3D to add.

addCamera3D

public void addCamera3D(ICamera3D c)
Add the given Camera3D to this scene.

Parameters:
c - the new Camera3D to add.

addScene3DObject

public void addScene3DObject(IScene3DObject object)
Add the given Scene3DObject to this scene.

Parameters:
object - the new Scene3DObject to add.

addScene3DObjects

public void addScene3DObjects(IScene3DObject[] objects3D)
Add multiple Scene3DObject to this scene.

Parameters:
objects3D - array containing Scene3DObject to add.

removeScene3DObject

public void removeScene3DObject(IScene3DObject object)
Remove the given Scene3DObject from this scene.

this method will remove the given Scene3DObject and all its childrens.

Material and Texture are not affected by this method.

Parameters:
object - the Scene3DObject to remove.

removeMesh3DById

public void removeMesh3DById(int id)
Remove the Mesh3D having the given id from this scene.

this method will remove Mesh3D and all its childrens.

Material and Texture are not affected by this method.

Parameters:
id - id of the Mesh3D to remove.

removeLight3DById

public void removeLight3DById(int id)
Remove the Light3D having the given id from this scene.

this method will remove Light3D and all its childrens.

Material and Texture are not affected by this method.

Parameters:
id - id of the Light3D to remove.

removeCamera3DById

public void removeCamera3DById(int id)
Remove the Camera3D having the given id from this scene.

this method will remove Camera3D and all its childrens.

Material and Texture are not affected by this method.

Parameters:
id - id of the Camera3D to remove.

clearScene3D

public void clearScene3D()
Clear this scene3D.

remove all SceneObject including mesh,camera,light,material and texture.

a new default camera and light will be created just before this method return.


getMesh3DById

public IMesh3D getMesh3DById(int id)
Gets the Mesh3D having the given id from this scene.

Parameters:
id - id of the Mesh3D to get.

getMesh3DByName

public IMesh3D getMesh3DByName(java.lang.String name)
Gets the Mesh3D having the given name from this scene.

Parameters:
name - name of the Mesh3D to get.

getCamera3DById

public ICamera3D getCamera3DById(int id)
Gets the Camera3D having the given id from this scene.

Parameters:
id - id of the Camera3D to get.

getCamera3DByName

public ICamera3D getCamera3DByName(java.lang.String name)
Gets the Camera3D having the given name from this scene.

Parameters:
name - name of the Camera3D to get.

getLight3DById

public ILight3D getLight3DById(int id)
Gets the Light3D having the given id from this scene.

Parameters:
id - id of the Light3D to get.

getLight3DByName

public ILight3D getLight3DByName(java.lang.String name)
Gets the Light3D having the given name from this scene.

Parameters:
name - name of the Light3D to get.

setSkyBoxMesh3DByName

public void setSkyBoxMesh3DByName(java.lang.String name)
Sets the Mesh3D name object to use as sky box.

Mesh3D used as skybox will be rendered without lighting and always at position 0,0,0 relative to the camera.

Typically this will be a 3D box with its pivot located at the center and faces normal reversed.

Other object than 3d box can be used : sphere,dome...

Parameters:
name - name of the Mesh3D to use as sky box.

setSkyBoxMesh3DById

public void setSkyBoxMesh3DById(int id)
Sets the Mesh3D id object to use as sky box.

Mesh3D used as skybox will be rendered without lighting and always at position 0,0,0 relative to the camera.

Typically this will be a 3D box with its pivot located at the center and faces normal reversed.

Other object than 3d box can be used : sphere,dome...

Parameters:
id - id of the Mesh3D to use as sky box.

getSkyBoxMesh3DId

public int getSkyBoxMesh3DId()
Gets the Mesh3D id object used as sky box.

Mesh3D used as skybox will be rendered without lighting and always at position 0,0,0 relative to the camera.

Typically this will be a 3D box with its pivot located at the center and faces normal reversed.

Other object than 3d box can be used : sphere,dome...

Returns:
id of the Mesh3D to use as sky box.

getSkyBoxMesh3DName

public java.lang.String getSkyBoxMesh3DName()
Gets the Mesh3D name object used as sky box.

Mesh3D used as skybox will be rendered without lighting and always at position 0,0,0 relative to the camera.

Typically this will be a 3D box with its pivot located at the center and faces normal reversed.

Other object than 3d box can be used : sphere,dome...

Returns:
id of the Mesh3D to use as sky box.

setCurrentCamera3DById

public void setCurrentCamera3DById(int id)
Sets the Camera3D to use for camera space using its id.

this camera will be used for camera space as well as to render the scene when scene is passed to a Render3D.

Parameters:
id - id of the Camera3D to use for camera space.

setCurrentCamera3DByName

public void setCurrentCamera3DByName(java.lang.String name)
Sets the Camera3D to use for camera space using its name.

this camera will be used for camera space as well as to render the scene when scene is passed to a Render3D.

Parameters:
name - name of the Camera3D to use for camera space.

getCurrentCamera3D

public ICamera3D getCurrentCamera3D()
Gets the Camera3D used for camera space.

this camera will be used for camera space as well as to render the scene when scene is passed to a Render3D.

Returns:
the Camera3D used for camera space.

setScene3DObjectToWorld

public void setScene3DObjectToWorld()
Sets all Scene3DObject to world space.

all Scene3DObject will be passed to world space.


setScene3DObjectToCamera

public void setScene3DObjectToCamera()
Sets all Scene3DObject to camera space.

setScene3DObjectToWorld must have been called at least once before each call to this method.

all Scene3DObject will be passed to world space.


isBackgroundEnabled

public boolean isBackgroundEnabled()
Gets the backgroundEnabled flag .
set this flag to false to disable background filling.

Returns:
backgroundEnabled flag

setBackgroundEnabled

public void setBackgroundEnabled(boolean flag)
Sets the backgroundEnabled flag .
set this flag to false to disable background filling.

Parameters:
flag - backgroundEnabled flag

setBackgroundColor

public void setBackgroundColor(int color)
Sets background color.

Parameters:
color - new background color

getBackgroundColor

public int getBackgroundColor()
Gets background color.

Returns:
current background color

isFogEnabled

public boolean isFogEnabled()
Gets the fogEnabled flag .
set this flag to false to disable fog.

Returns:
fogEnabled flag

setFogEnabled

public void setFogEnabled(boolean flag)
Sets the fogEnabled flag .
set this flag to false to disable fog filling.

Parameters:
flag - fogEnabled flag

setFogColor

public void setFogColor(int color)
Sets fog color.

Parameters:
color - new fog color

getFogColor

public int getFogColor()
Gets fog color.

Returns:
current fog color

playScene3DObjectAnimator

public void playScene3DObjectAnimator(int time)
Sets all Scene3DObject using there Scene3DObjectAnimator for the given time.

call the Scene3DObjectAnimator.playAt method for each Scene3DObjectAnimator used by Scene3DObject of this scene3D.

Parameters:
time - time in keyframer that should be set for each Scene3DObject

setScene3DLoader

public void setScene3DLoader(IScene3DLoader sceneLoader)
Sets a Scene3DLoader for this Scene3D

Parameters:
sceneLoader - a Scene3DLoader that will be added to this scene once loaded