Home | Hierarchy | Members | Alphabetical | Related Pages |
#include <fog.h>
Inherits Node.
Public Member Functions | |
Fog (const char *name="") | |
virtual | ~Fog () |
virtual unsigned int | nbFields () const |
virtual FieldHandle | field (const std::string &n) |
virtual FieldHandle | field (unsigned int i) |
virtual bool | isSetToDefaultValue (unsigned int i) const |
virtual unsigned int | nbEventsIn () const |
virtual EventInHandle | eventIn (const std::string &n) |
virtual EventInHandle | eventIn (unsigned int i) |
virtual unsigned int | nbEventsOut () const |
virtual EventOutHandle | eventOut (const std::string &n) |
virtual EventOutHandle | eventOut (unsigned int i) |
const char * | typeName () const |
virtual Node * | duplicate () const |
virtual Node * | duplicate (std::map< const Node *, Node * > &) const |
Public Attributes | |
Exposed Fields | |
A field that is capable of receiving events via an eventIn to change its value(s), and generating events via an eventOut when its value(s) change. | |
SFColor | color |
SFString | fogType |
SFFloat | visibilityRange |
Events In | |
EventIn< SFBool > | set_bind |
EventIn< SFColor > | set_color |
EventIn< SFString > | set_fogType |
EventIn< SFFloat > | set_visibilityRange |
Events Out | |
EventOut< SFBool > | isBound |
EventOut< SFColor > | color_changed |
EventOut< SFString > | fogType_changed |
EventOut< SFFloat > | visibilityRange_changed |
The Fog node provides a way to simulate atmospheric effects by blending
objects with the colour specified by the color field based on the
distances of the various objects from the viewer. The distances are calculated
in the coordinate space of the Fog node. The visibilityRange specifies
the distance in metres (in the local coordinate system) at which objects
are totally obscured by the fog. Objects located outside the visibilityRange
from the viewer are drawn with a constant colour of color. Objects
very close to the viewer are blended very little with the fog color.
A visibilityRange of 0.0 disables the Fog node. The visibilityRange
is affected by the scaling transformations of the Fog node's parents; translations
and rotations have no affect on visibilityRange. Values of the visibilityRange
field shall be in the range [0, ).
Since Fog nodes are bindable children nodes (see 4.6.10, Bindable children nodes), a Fog node stack exists, in which the top-most Fog node on the stack is currently active. To push a Fog node onto the top of the stack, a TRUE value is sent to the set_bind eventIn. Once active, the Fog node is bound to the browser view. A FALSE value sent to set_bind, pops the Fog node from the stack and unbinds it from the browser viewer. More details on the Fog node stack can be found in 4.6.10, Bindable children nodes.
The fogType field controls how much of the fog colour is blended with the object as a function of distance. If fogType is "LINEAR", the amount of blending is a linear function of the distance, resulting in a depth cueing effect. If fogType is "EXPONENTIAL," an exponential increase in blending is used, resulting in a more natural fog appearance.
The effect of fog on lighting calculations is described in 4.14, Lighting model.
Fog | ( | const char * | name = "" |
) |
Construct a node with all its fields set to default value, which is equivalent to the code below:
color.setRGB(1,1,1); fogType = string("LINEAR"); visibilityRange = 0.0f;
~Fog | ( | ) | [virtual] |
Virtual destructor, does nothing
unsigned int nbFields | ( | ) | const [inline, virtual] |
Returns the number of fields (exposed or not) for this node type.
Implements Node.
wrl::Node::FieldHandle field | ( | const std::string & | n | ) | [virtual] |
Return a handle on the field named n
of the node or a "unknown" typed handle if there is no such field. Valid names are:
Implements Node.
wrl::Node::FieldHandle field | ( | unsigned int | n | ) | [virtual] |
Return a handle on the i
th field of the node or a "unknown" typed handle if there is no such node. Here is how i
is related to fields:
Implements Node.
bool isSetToDefaultValue | ( | unsigned int | i | ) | const [virtual] |
Implements Node.
unsigned int nbEventsIn | ( | ) | const [inline, virtual] |
Returns the number of events in for this node type.
Implements Node.
wrl::Node::EventInHandle eventIn | ( | const std::string & | n | ) | [virtual] |
Return a handle on the event in named n
of the node or a "unknown" typed handle if there is no such event. Valid names are:
Implements Node.
wrl::Node::EventInHandle eventIn | ( | unsigned int | n | ) | [virtual] |
Return a handle on the i
th event in of the node or a "unknown" typed handle if there is no such node. Here is how i
is related to fields:
This function is useful, with nbEventsIn() if you want to traverse all events in of a Node.
Implements Node.
unsigned int nbEventsOut | ( | ) | const [inline, virtual] |
Returns the number of events out for this node type.
Implements Node.
wrl::Node::EventOutHandle eventOut | ( | const std::string & | n | ) | [virtual] |
Return a handle on the event out named n
of the node or a "unknown" typed handle if there is no such event. Valid names are:
Implements Node.
wrl::Node::EventOutHandle eventOut | ( | unsigned int | n | ) | [virtual] |
Return a handle on the i
th event out of the node or a "unknown" typed handle if there is no such node. Here is how i
is related to fields:
Implements Node.
const char * typeName | ( | ) | const [inline, virtual] |
Returns "Fog"
. Useful for printing.
Implements Node.
wrl::Node * duplicate | ( | ) | const [virtual] |
Returns a deep copy of this node, that is a fully independant node with all children (if any) also copied. This is mainly useful for instanciating protos.
Implements Node.
See Detailed Description for meaning of this field. Default value is set to
color.setRGB(1,1,1);
See Detailed Description for meaning of this field. Default value is set to
fogType = string("LINEAR");
See Detailed Description for meaning of this field. Default value is set to
visibilityRange = 0.0f;
See Detailed Description for meaning of this event.
Set event associated to exposedField fogType
Set event associated to exposedField visibilityRange
See Detailed Description for meaning of this event.
Changed event associated to exposedField color
Changed event associated to exposedField fogType
Changed event associated to exposedField visibilityRange
Generated on 5 Jan 2007 with
![]() |
|