ygEnvironment derived from ygSpace Example Source Header

Description: establishes sky color, fog, and clipping plane parameters within a space

notes:
Category: Attributes
Author: Dave Pape
11/01/01
06/01/03 Alex Hill - added acceptNetMessage function to update clients
Revision: 08/01/03 Dave Pape - updated logic to fix overlapping volumes

    Messages
clip two floats set the near and far clipping planes
skyColor three floats set the sky color
fog (off | lin | linear | exp | exp2), three floats, float, float set the fog properties (type, color, onset, opaque)
    Comments

method activeEnvironment_

constructor ygEnvironment

destructor ~ygEnvironment

method reset

1 set near and far planes to 0.1 and 1000
2 set sky color to black (0,0,0)
3 set fog to off

method message

1 set the near and far clipping planes
2 set the sky color
3 set the fog properties (type, color, onset, opaque)

method setClip

method nearClip

method farClip

method setSkyColor

method skyColor

method fogOff

method setFog

method app

1 if space contains user then apply settings

method apply

1 if properties have changed
1.1 set world clipping planes
1.2 set world sky color
1.3 if fog then set world fog properties
2
 The activeEnvironment_ class variable is intended to take care
      of cases where environment nodes overlap.  It keeps track of which
      node is 'active', i.e. the last one to apply itself.  Effectively,
      when there is an overlap, the winning node changes the other node's
      lastApply value to let the other node know that it has been un-applied,
      allowing it to re-apply itself when the user gets out of the overlap
      region.