newspeoplefor developersdocumentationdownloads

nSkyNode Class Reference
[Scene System]

#include <nskynode.h>

Inheritance diagram for nSkyNode:

nTransformNode nSceneNode nRoot nObject nNode nReferenced nSignalEmitter List of all members.

Detailed Description

The SkyNode represents a skybox with sun, clouds and other celestial elements, each represented by a shapenode. The parameters can be set for different points of time (states), to potentiate a course of a day by interpolation.

(C) 2005 RadonLabs GmbH

Definition at line 24 of file nskynode.h.


Public Types

enum  ElementType {
  SkyElement = 0,
  SunElement,
  LightElement,
  CloudElement,
  StarElement,
  GenericElement,
  NumElementTypes,
  InvalidElement
}

Public Member Functions

 nSkyNode ()
 constructor
virtual ~nSkyNode ()
 destructor
virtual bool SaveCmds (nPersistServer *ps)
 object persistency
void Attach (nSceneServer *sceneServer, nRenderContext *renderContext)
 Attach to sceneserver.
void UpdateSky (float worldTime)
 Update.
int AddState (const nString &destName, const nString &stateName, float time)
 Attaches a state to a sky element and defines a point of time.
void RemoveState (const nString &destName, const nString &stateName)
 Detaches a state from a sky element.
void NewElement (nSkyNode::ElementType type, const nString &name)
 Creates a new sky element.
void AddElement (nSkyNode::ElementType type, const nString &name)
 Adds an existing Object as an element.
void DeleteElement (const nString &name)
 Deletes an element.
void LinkTo (const nString &fromName, const nString &toName)
 attaches one element to an other
void SetChannel (const char *name)
 set the variable handle which drives this animator object (e.g. time)
const char * GetChannel ()
 get the variable which drives this animator object
void SetTimeFactor (float factor)
 sets time multiplier
float GetTimeFactor ()
 gets time multiplier
void SetStartTime (float time)
 sets start time
float GetStartTime ()
 gets start time
void SetRefreshTime (const nString &name, float time)
 set refresh time
float GetRefreshTime (const nString &name)
 get refresh time
void SetTimePeriod (float periode)
 set time periode
float GetTimePeriod ()
 get time periode
float GetSkyTime ()
 get actual sky time
int SetStateTime (const nString &elementName, const nString &stateName, float time)
 Changes a statetime.
int SetStateTime (int elementNr, int stateNr, float time)
 Changes a statetime.
float GetStateTime (const nString &destName, const nString &stateName)
 Changes a statetime.
float GetStateTime (int elementNr, int stateNr)
 Changes a statetime.
int GetNumElements ()
 Get number of elements.
int GetNumStates (int elementNr)
 Get number of states of an element.
nAbstractShaderNodeGetElement (const nString &name)
 Get element (by name).
nAbstractShaderNodeGetElement (int elementNr)
 Get element (by number).
nSkyStateGetState (const nString &elementName, const nString &stateName)
 Get state (by name).
nSkyStateGetState (int elementNr, int stateNr)
 Get state (by number).
nSkyNode::ElementType GetElementType (const nString &name)
 Get element type (by name).
nSkyNode::ElementType GetElementType (int elementNr)
 Get element type (by number).
const char * TypeToString (nSkyNode::ElementType type) const
 converts enum type to string
nSkyNode::ElementType StringToType (const char *str) const
 converts a string to enum type

Static Public Attributes

static const float CloudSpeedFactor = 0.0005f

Protected Member Functions

void CollectParams (nShaderParams params, ParamList &paramList)
 Adds all params from nShaderparams to param list.
int FindElement (const nString &name)
 Returns the index of the searched element.
int FindState (int elementNr, const nString &stateName)
 Returns the index of the searched state.
vector3 GetSphericalCoordinates (vector3 angles)
 Positions an Element by spherical coordinates.
void SetFaceToViewer (int element)
 Rotates element to face the viewer.
void FindStates (int element, float time, int &state0, int &state1)
 Find relevant states at a specific time for an specific element.
void SortOutParams (int element, ParamList &paramList)
 Sort out params, not to apply generic.
float ComputeWeight (int element, float time, int state0, int state1)
 compute state weight
vector3 GetCameraPos ()
 Get actual camera position.

Protected Attributes

nArray< ElementGroupelements
float timePeriod
float timeFactor
float sunSpeedFactor
float startTime
float skyTime
float worldTime
float jumpTime
nVariable::Handle channelVarHandle

Classes

struct  ElementGroup
struct  ParamList
struct  StateGroup

Member Enumeration Documentation

enum nSkyNode::ElementType
 

Enumerator:
SkyElement 
SunElement 
LightElement 
CloudElement 
StarElement 
GenericElement 
NumElementTypes 
InvalidElement 

Definition at line 28 of file nskynode.h.


Constructor & Destructor Documentation

nSkyNode::nSkyNode  ) 
 

constructor

Definition at line 19 of file nskynode_main.cc.

nSkyNode::~nSkyNode  )  [virtual]
 

destructor

Definition at line 36 of file nskynode_main.cc.


Member Function Documentation

virtual bool nSkyNode::SaveCmds nPersistServer ps  )  [virtual]
 

object persistency

Reimplemented from nTransformNode.

void nSkyNode::Attach nSceneServer sceneServer,
nRenderContext renderContext
[virtual]
 

Attach to sceneserver.

Attach to the scene server.

Reimplemented from nTransformNode.

Definition at line 46 of file nskynode_main.cc.

void nSkyNode::UpdateSky float  newTime  ) 
 

Update.

Updates all elements of the nskynode

Definition at line 520 of file nskynode_main.cc.

int nSkyNode::AddState const nString destName,
const nString stateName,
float  time
 

Attaches a state to a sky element and defines a point of time.

Attaches a state to a sky element and defines a point of time, when it should be applied

Definition at line 276 of file nskynode_main.cc.

void nSkyNode::RemoveState const nString destName,
const nString stateName
 

Detaches a state from a sky element.

Removes a state from an element

Definition at line 319 of file nskynode_main.cc.

void nSkyNode::NewElement nSkyNode::ElementType  type,
const nString name
 

Creates a new sky element.

Creates a new sky element and initializes it.

Definition at line 350 of file nskynode_main.cc.

void nSkyNode::AddElement nSkyNode::ElementType  type,
const nString name
 

Adds an existing Object as an element.

Adds an existing Object as an element

Definition at line 66 of file nskynode_main.cc.

void nSkyNode::DeleteElement const nString name  ) 
 

Deletes an element.

Deletes an existing sky element

Definition at line 384 of file nskynode_main.cc.

void nSkyNode::LinkTo const nString fromName,
const nString toName
 

attaches one element to an other

links one element to another

Definition at line 406 of file nskynode_main.cc.

void nSkyNode::SetChannel const char *  name  ) 
 

set the variable handle which drives this animator object (e.g. time)

Sets the "animation channel" which drives the sky animation. This could be something like "time", but the actual names are totally up to the application. The actual channel value will be pulled from the render context.

Definition at line 1014 of file nskynode_main.cc.

const char * nSkyNode::GetChannel  ) 
 

get the variable which drives this animator object

Return the animation channel which drives the sky animation.

Definition at line 1025 of file nskynode_main.cc.

void nSkyNode::SetTimeFactor float  factor  )  [inline]
 

sets time multiplier

Sets the multiplier for the time

Definition at line 175 of file nskynode.h.

float nSkyNode::GetTimeFactor  )  [inline]
 

gets time multiplier

Gets the multiplier for the time

Definition at line 186 of file nskynode.h.

void nSkyNode::SetStartTime float  time  )  [inline]
 

sets start time

Sets the start point of time

Definition at line 197 of file nskynode.h.

float nSkyNode::GetStartTime  )  [inline]
 

gets start time

Gets the start point of time

Definition at line 209 of file nskynode.h.

void nSkyNode::SetRefreshTime const nString name,
float  time
 

set refresh time

Sets the refresh time for an element

Definition at line 826 of file nskynode_main.cc.

float nSkyNode::GetRefreshTime const nString name  ) 
 

get refresh time

Gets the refresh time of an element

Definition at line 836 of file nskynode_main.cc.

void nSkyNode::SetTimePeriod float  period  )  [inline]
 

set time periode

Sets the time period for a day

Definition at line 220 of file nskynode.h.

float nSkyNode::GetTimePeriod  )  [inline]
 

get time periode

Gets the time period for a day

Definition at line 231 of file nskynode.h.

float nSkyNode::GetSkyTime  )  [inline]
 

get actual sky time

Gets the actual time from this skynode

Definition at line 242 of file nskynode.h.

int nSkyNode::SetStateTime const nString elementName,
const nString stateName,
float  time
 

Changes a statetime.

Definition at line 846 of file nskynode_main.cc.

int nSkyNode::SetStateTime int  elementNr,
int  stateNr,
float  time
 

Changes a statetime.

Definition at line 858 of file nskynode_main.cc.

float nSkyNode::GetStateTime const nString destName,
const nString stateName
 

Changes a statetime.

Definition at line 882 of file nskynode_main.cc.

float nSkyNode::GetStateTime int  elementNr,
int  stateNr
 

Changes a statetime.

Definition at line 894 of file nskynode_main.cc.

int nSkyNode::GetNumElements  ) 
 

Get number of elements.

Gets number of elements

Definition at line 904 of file nskynode_main.cc.

int nSkyNode::GetNumStates int  elementNr  ) 
 

Get number of states of an element.

Gets number of states of an element

Definition at line 914 of file nskynode_main.cc.

nAbstractShaderNode * nSkyNode::GetElement const nString name  ) 
 

Get element (by name).

Gets a pointer to an element (by name)

Definition at line 924 of file nskynode_main.cc.

nAbstractShaderNode * nSkyNode::GetElement int  elementNr  ) 
 

Get element (by number).

Gets a pointer to an element (by number)

Definition at line 934 of file nskynode_main.cc.

nSkyState * nSkyNode::GetState const nString elementName,
const nString stateName
 

Get state (by name).

Gets a pointer to an state of an element (by name)

Definition at line 944 of file nskynode_main.cc.

nSkyState * nSkyNode::GetState int  elementNr,
int  stateNr
 

Get state (by number).

Gets a pointer to an state of an element (by number)

Definition at line 954 of file nskynode_main.cc.

nSkyNode::ElementType nSkyNode::GetElementType const nString name  ) 
 

Get element type (by name).

Get element type (by name)

Definition at line 964 of file nskynode_main.cc.

nSkyNode::ElementType nSkyNode::GetElementType int  elementNr  ) 
 

Get element type (by number).

Get element type (by number)

Definition at line 974 of file nskynode_main.cc.

const char * nSkyNode::TypeToString nSkyNode::ElementType  type  )  const [inline]
 

converts enum type to string

translates element types to string

Definition at line 253 of file nskynode.h.

nSkyNode::ElementType nSkyNode::StringToType const char *  str  )  const [inline]
 

converts a string to enum type

translates string to element type

Definition at line 274 of file nskynode.h.

void nSkyNode::CollectParams nShaderParams  params,
ParamList paramList
[protected]
 

Adds all params from nShaderparams to param list.

Adds all params from the nShaderParams to the paramList

Definition at line 984 of file nskynode_main.cc.

int nSkyNode::FindElement const nString name  )  [protected]
 

Returns the index of the searched element.

returns the index of an element

Definition at line 416 of file nskynode_main.cc.

int nSkyNode::FindState int  elementNr,
const nString stateName
[protected]
 

Returns the index of the searched state.

returns the index of an state

Definition at line 430 of file nskynode_main.cc.

vector3 nSkyNode::GetSphericalCoordinates vector3  angles  )  [protected]
 

Positions an Element by spherical coordinates.

Returns cartesian coordinates from spherical coordinates

Definition at line 809 of file nskynode_main.cc.

void nSkyNode::SetFaceToViewer int  element  )  [protected]
 

Rotates element to face the viewer.

Updates the angle of the element, to ensure being faced to viewer

Definition at line 794 of file nskynode_main.cc.

void nSkyNode::FindStates int  element,
float  time,
int &  state0,
int &  state1
[protected]
 

Find relevant states at a specific time for an specific element.

Definition at line 444 of file nskynode_main.cc.

void nSkyNode::SortOutParams int  element,
ParamList paramList
[protected]
 

Sort out params, not to apply generic.

Definition at line 473 of file nskynode_main.cc.

float nSkyNode::ComputeWeight int  element,
float  time,
int  state0,
int  state1
[protected]
 

compute state weight

Definition at line 503 of file nskynode_main.cc.

vector3 nSkyNode::GetCameraPos  )  [protected]
 

Get actual camera position.

Return actual Camera Position

Definition at line 1039 of file nskynode_main.cc.


Member Data Documentation

const float nSkyNode::CloudSpeedFactor = 0.0005f [static]
 

Definition at line 14 of file nskynode_main.cc.

nArray<ElementGroup> nSkyNode::elements [protected]
 

Definition at line 158 of file nskynode.h.

float nSkyNode::timePeriod [protected]
 

Definition at line 159 of file nskynode.h.

float nSkyNode::timeFactor [protected]
 

Definition at line 160 of file nskynode.h.

float nSkyNode::sunSpeedFactor [protected]
 

Definition at line 161 of file nskynode.h.

float nSkyNode::startTime [protected]
 

Definition at line 162 of file nskynode.h.

float nSkyNode::skyTime [protected]
 

Definition at line 163 of file nskynode.h.

float nSkyNode::worldTime [protected]
 

Definition at line 164 of file nskynode.h.

float nSkyNode::jumpTime [protected]
 

Definition at line 165 of file nskynode.h.

nVariable::Handle nSkyNode::channelVarHandle [protected]
 

Definition at line 166 of file nskynode.h.


The documentation for this class was generated from the following files:

Copyright © 1999-2005 by the contributing authors. Ideas, requests, problems: Send feedback.