yaarq.sys
Class yrqEnviron

java.lang.Object
  |
  +--yaarq.sys.yrqEnviron

public class yrqEnviron
extends java.lang.Object

This class encapsules all environmental settings used in a 3D environment. It provides support for a background geometry, fog, and two main lights, the basic ambient lights and a directional main light.

Particle visuals are added to the environment. They can only be added here.

Instances of the class automatically attach to the engines root on creation. The engine creates an instance of this class on initialisation, properties of the instance can be set at runtime.

TODO: Nothing


Constructor Summary
yrqEnviron(yrqEngine a_engine)
           
 
Method Summary
 void addVisual(java.lang.String a_name, yrqParticleVisual a_visual)
          This method adds a visual to the environ.
 void clearVisuals()
          This method clears all visuals from the hierarchy, detaching them in the process.
 javax.media.j3d.Fog getFog()
          This function returns the internal LinearFog used by the environ instance.
 javax.media.j3d.BackgroundSound getMusic()
          This function returns the background music playing
 yrqVisual getVisual(java.lang.String a_name)
          This method retrieves a visual which has been added to the environ by its name.
 void removeVisual(java.lang.String a_name)
          This method removes a visual specified by name.
 void removeVisual(yrqVisual a_visual)
          This method removes a visual specified as an instance.
 void setBackground(yrqBasicVisual a_visual)
          This method sets the background visual to be used in the environment.
 void setBaseLight(javax.vecmath.Color3f a_color)
          This method sets the basic ambient lighting level of the environment.
 void setFog(javax.vecmath.Color3f a_color, float a_min, float a_max)
          This method sets the fog to be used in the environment.
 void setMainLight(javax.vecmath.Color3f a_color, javax.vecmath.Vector3f a_direction)
          This method sets the main directional light of the environment.
 void setMusic(javax.media.j3d.MediaContainer a_music, boolean a_loop)
           
 void update()
          This method is called by the engine regulary to update visuals added to the environ
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

yrqEnviron

public yrqEnviron(yrqEngine a_engine)
Method Detail

addVisual

public void addVisual(java.lang.String a_name,
                      yrqParticleVisual a_visual)
This method adds a visual to the environ. Only particle visuals can be added. Added visuals are automatically attached to the root.

Parameters:
a_name - The name under which to add the visual
a_visual - The visual to be added

clearVisuals

public void clearVisuals()
This method clears all visuals from the hierarchy, detaching them in the process.


getFog

public javax.media.j3d.Fog getFog()
This function returns the internal LinearFog used by the environ instance.

Returns:
The internal fog instance

getMusic

public javax.media.j3d.BackgroundSound getMusic()
This function returns the background music playing

Returns:
the backgroundsound object

getVisual

public yrqVisual getVisual(java.lang.String a_name)
This method retrieves a visual which has been added to the environ by its name.

Parameters:
a_name - The name of the visual to be retrieved

removeVisual

public void removeVisual(java.lang.String a_name)
This method removes a visual specified by name. The visual is automatically detached from the local branch.

Parameters:
a_name - The name of the visual to be removed

removeVisual

public void removeVisual(yrqVisual a_visual)
This method removes a visual specified as an instance. The visual is automatically detached from the local branch.

Parameters:
a_visual - The visual to be removed

setBackground

public void setBackground(yrqBasicVisual a_visual)
This method sets the background visual to be used in the environment. Only BasicVisual instances can be set as a background.

Parameters:
a_visual - The visual to use as a background

setBaseLight

public void setBaseLight(javax.vecmath.Color3f a_color)
This method sets the basic ambient lighting level of the environment.

Parameters:
a_color - The color of the basic ambient light

setFog

public void setFog(javax.vecmath.Color3f a_color,
                   float a_min,
                   float a_max)
This method sets the fog to be used in the environment.

Parameters:
a_color - The color of the linear fog
a_min - The start distance of the linear fog
a_max - The full-value distance of the linear fog

setMainLight

public void setMainLight(javax.vecmath.Color3f a_color,
                         javax.vecmath.Vector3f a_direction)
This method sets the main directional light of the environment.

Parameters:
a_color - The color of the directional main light
a_direction - The direction of the directional main light

setMusic

public void setMusic(javax.media.j3d.MediaContainer a_music,
                     boolean a_loop)

update

public void update()
This method is called by the engine regulary to update visuals added to the environ