simbad.sim
Class World

java.lang.Object
  extended bysimbad.sim.World

public class World
extends java.lang.Object

Represents a 3d world - this class use intensively JAVA3D. It creates the scenegraph and the view platform. The building process uses a EnvironmentDescription object containing colors , objects and attributes given by the user. This class is thighly coupled with Simulator Class. Remember to call System.setProperty("j3d.implicitAntialiasing", "true") at the very beginning of your program in order to enable antialiasing.


Field Summary
static int VIEW_ABOVE_AGENT
           
static int VIEW_ABOVE_AGENT_NEAR
           
static int VIEW_AGENT_SIDE
           
static int VIEW_BEHIND_AGENT
           
static int VIEW_FROM_EAST
           
static int VIEW_FROM_TOP
           
 
Constructor Summary
World(EnvironmentDescription ed)
          Construct a World from a given EnvironmentDescription.
 
Method Summary
 void addObjectToPickableSceneBranch(simbad.sim.BaseObject obj3d)
          Adds a 3D object to the world.
 void attach(simbad.sim.BaseObject obj3d)
          attach a 3d object to the scenegraph.
 void changeViewPoint(int type, SimpleAgent agent)
          Change the user view Point .
 void detach(simbad.sim.BaseObject obj3d)
          Detach a previously attached object from the scenegraph.
 void dispose()
          Destroy the java3d graph
 javax.media.j3d.Canvas3D getCanvas3D()
           
 void renderOnce()
          Do one rendering on main canvas 3D .
 void startRendering()
          Restart rendering on main canvas 3D .
 void stopRendering()
          Stop rendering on main canvas 3D .
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VIEW_FROM_TOP

public static final int VIEW_FROM_TOP
See Also:
Constant Field Values

VIEW_FROM_EAST

public static final int VIEW_FROM_EAST
See Also:
Constant Field Values

VIEW_BEHIND_AGENT

public static final int VIEW_BEHIND_AGENT
See Also:
Constant Field Values

VIEW_ABOVE_AGENT

public static final int VIEW_ABOVE_AGENT
See Also:
Constant Field Values

VIEW_ABOVE_AGENT_NEAR

public static final int VIEW_ABOVE_AGENT_NEAR
See Also:
Constant Field Values

VIEW_AGENT_SIDE

public static final int VIEW_AGENT_SIDE
See Also:
Constant Field Values
Constructor Detail

World

public World(EnvironmentDescription ed)
Construct a World from a given EnvironmentDescription.

Method Detail

addObjectToPickableSceneBranch

public void addObjectToPickableSceneBranch(simbad.sim.BaseObject obj3d)
Adds a 3D object to the world. Used only in the creation phase.


detach

public void detach(simbad.sim.BaseObject obj3d)
Detach a previously attached object from the scenegraph.


attach

public void attach(simbad.sim.BaseObject obj3d)
attach a 3d object to the scenegraph.


changeViewPoint

public void changeViewPoint(int type,
                            SimpleAgent agent)
Change the user view Point . Note that we modify the ViewBranch transform not the scene transform.

Parameters:
type - can be VIEW_FROM_TOP,VIEW_FROM_EAST,VIEW_BEHIND_AGENT
agent - : specify the agent if VIEW_BEHIND_AGENT The VIEW_BEHIND_AGENT case has to be called regularly because of the agent displacement.

stopRendering

public void stopRendering()
Stop rendering on main canvas 3D . Used for background mode.


startRendering

public void startRendering()
Restart rendering on main canvas 3D . Used for background mode.


renderOnce

public void renderOnce()
Do one rendering on main canvas 3D . Used for background mode.


dispose

public void dispose()
Destroy the java3d graph


getCanvas3D

public javax.media.j3d.Canvas3D getCanvas3D()
Returns:
the canvas3D associated to the world view platform