espresso3d.engine.world.sector
Class E3DSector

java.lang.Object
  extended byespresso3d.engine.base.E3DEngineItem
      extended byespresso3d.engine.renderer.base.E3DRenderable
          extended byespresso3d.engine.world.sector.E3DSector

public class E3DSector
extends E3DRenderable

Author:
espresso3d Worlds are divided up into multiple sectors. Sectors contain actors, lights and geometry. A portaling algorithm then connects sectors together through portals. This is a way of reducing the potentially visibile triangles quickly. (portaling will come soon) Outdoor scenes will have special terrain sectors that will work in the same sort of fashion (not implemented).

Constructor Summary
E3DSector(E3DEngine engine, java.lang.String sectorID)
           
 
Method Summary
 void addActor(E3DActor actor)
          Add an actor to this sector
 void addLight(E3DLight light)
           
 void addTriangle(E3DTriangle triangle)
          Add a triangle to the geometry of the sector This is handled by map loading, but triangles can be added programatically as well.
 E3DActor getActorByID(java.lang.String actorID)
          Get an actor in this sector by its ID
 java.util.HashMap getActorMap()
           
 java.util.HashMap getLightMap()
           
 java.lang.String getSectorID()
           
 java.util.HashMap getTextureSortedTriangleList()
           
 java.util.ArrayList getTriangleList()
           
 E3DWorld getWorld()
           
 boolean isNeedingLightRecalc()
          This is true if a light has moved and we need to recalculate the lighting
 void removeActor(java.lang.String actorID)
          Remove an actor with actorID from this sector
 void renderAtPosition(E3DVector3F atPosition)
          This renders the sector geometry and actors in the sector atPosition This is handled by the engine's rendering loop
 void setActorMap(java.util.HashMap actorMap)
           
 void setLightMap(java.util.HashMap lightMap)
           
 void setNeedingLightRecalc(boolean needingLightRecalc)
           
 void setTextureSortedTriangleList(java.util.HashMap textureSortedTriangleList)
           
 void setWorld(E3DWorld world)
           
 
Methods inherited from class espresso3d.engine.renderer.base.E3DRenderable
render
 
Methods inherited from class espresso3d.engine.base.E3DEngineItem
getEngine, setEngine
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

E3DSector

public E3DSector(E3DEngine engine,
                 java.lang.String sectorID)
Method Detail

addTriangle

public void addTriangle(E3DTriangle triangle)
Add a triangle to the geometry of the sector This is handled by map loading, but triangles can be added programatically as well.

Parameters:
triangle -

getSectorID

public java.lang.String getSectorID()
Returns:
Returns the sectorID.

getTriangleList

public java.util.ArrayList getTriangleList()
Returns:
Returns the list of triangles that comprise the geometry of the sector. Be careful modifying the triangles! It can have -really bad- consequences if they aren't modified through the correct procedures! For example, as triangles are added they are sorted by their texture. If you then later change the texture it will completely break the rendering pipeline optimization having to do with triangles.

renderAtPosition

public void renderAtPosition(E3DVector3F atPosition)
This renders the sector geometry and actors in the sector atPosition This is handled by the engine's rendering loop

Specified by:
renderAtPosition in class E3DRenderable

getTextureSortedTriangleList

public java.util.HashMap getTextureSortedTriangleList()
Returns:
Returns the textureSortedTriangleList.

setTextureSortedTriangleList

public void setTextureSortedTriangleList(java.util.HashMap textureSortedTriangleList)
Parameters:
textureSortedTriangleList - The textureSortedTriangleList to set.

getLightMap

public java.util.HashMap getLightMap()
Returns:
Returns the lightMap.

setLightMap

public void setLightMap(java.util.HashMap lightMap)

addLight

public void addLight(E3DLight light)

getActorMap

public java.util.HashMap getActorMap()
Returns:
Returns the actorMap.

setActorMap

public void setActorMap(java.util.HashMap actorMap)
Parameters:
actorMap - The actorMap to set.

addActor

public void addActor(E3DActor actor)
Add an actor to this sector

Parameters:
actor -

getActorByID

public E3DActor getActorByID(java.lang.String actorID)
Get an actor in this sector by its ID

Parameters:
actorID -
Returns:

removeActor

public void removeActor(java.lang.String actorID)
Remove an actor with actorID from this sector

Parameters:
actorID -

getWorld

public E3DWorld getWorld()
Returns:
Returns the world.

setWorld

public void setWorld(E3DWorld world)
Parameters:
world - The world to set.

isNeedingLightRecalc

public boolean isNeedingLightRecalc()
This is true if a light has moved and we need to recalculate the lighting

Returns:

setNeedingLightRecalc

public void setNeedingLightRecalc(boolean needingLightRecalc)