Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

kerosin::Light Class Reference

#include <light.h>

Inheritance diagram for kerosin::Light:

Inheritance graph
[legend]
Collaboration diagram for kerosin::Light:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Light ()
float GetRadius () const
 gets the light radius
void SetRadius (float radius)
 sets the light radius
virtual void Prepare ()
 Enable render settings of this light.
void RenderLitMesh (boost::shared_ptr< StaticMesh > mesh)
 draw lit triangles of mesh
void FlushCache ()
 flush the internal cached geometry
void ComputeBoundingBox ()
 update the bounding box
void SetAmbient (const RGBA &ambient)
 sets the ambient light intensity
const RGBAGetAmbient ()
 returns the ambient light intensity
void SetDiffuse (const RGBA &diffuse)
 sets the diffuse light intensity
const RGBAGetDiffuse ()
 returns the diffuse light intensitye
void SetSpecular (const RGBA &specular)
 sets the specular light intensity
const RGBAGetSpecular ()
 returns the specular light intensity

Protected Member Functions

virtual void OnLink ()
 set up RenderServer reference
virtual void OnUnlink ()
 reset RenderServer reference
virtual void DeterminePotentiallyLitTriangles (boost::shared_ptr< StaticMesh > &mesh, std::vector< unsigned int > &triangles)

Protected Attributes

RGBA mDiffuse
 the diffuse light intensity
RGBA mAmbient
 the ambient light intensity
RGBA mSpecular
 the specular light intensity
int mGLLight
 the allocated OpenGL light constant
float mRadius
unsigned int mVP
unsigned int mFP
salt::Vector3f mOldPos
 position used to invalidate the cache
salt::Matrix mMeshOldTransform
 mesh transform used to invalidate the cache
bool mCacheFlushed
 state of the cache
std::vector< unsigned int > mTriangles
std::vector< oxygen::IndexBuffermCachedIndices
boost::shared_ptr< OpenGLServermOpenGLServer
 reference to the RenderServer

Detailed Description

Definition at line 34 of file light.h.


Constructor & Destructor Documentation

Light::Light  ) 
 

Definition at line 41 of file light.cpp.


Member Function Documentation

void Light::ComputeBoundingBox  )  [virtual]
 

update the bounding box

Reimplemented from oxygen::BaseNode.

Definition at line 169 of file light.cpp.

References salt::AABB3::maxVec, salt::AABB3::minVec, oxygen::BaseNode::mLocalBoundingBox, mRadius, and salt::TVector3< DATATYPE, TYPE >::Set().

Here is the call graph for this function:

void Light::DeterminePotentiallyLitTriangles boost::shared_ptr< StaticMesh > &  mesh,
std::vector< unsigned int > &  triangles
[protected, virtual]
 

Definition at line 228 of file light.cpp.

void Light::FlushCache  ) 
 

flush the internal cached geometry

Definition at line 159 of file light.cpp.

References mCachedIndices, and mCacheFlushed.

Referenced by SetRadius().

const RGBA & Light::GetAmbient  ) 
 

returns the ambient light intensity

Definition at line 68 of file light.cpp.

References mAmbient.

const RGBA & Light::GetDiffuse  ) 
 

returns the diffuse light intensitye

Definition at line 78 of file light.cpp.

References mDiffuse.

float Light::GetRadius  )  const
 

gets the light radius

Definition at line 52 of file light.cpp.

References mRadius.

const RGBA & Light::GetSpecular  ) 
 

returns the specular light intensity

Definition at line 88 of file light.cpp.

References mSpecular.

void Light::OnLink  )  [protected, virtual]
 

set up RenderServer reference

Reimplemented from zeitgeist::Leaf.

Definition at line 175 of file light.cpp.

References zeitgeist::Object::GetCore(), zeitgeist::Object::GetLog(), mFP, mGLLight, mOpenGLServer, and mVP.

Here is the call graph for this function:

void Light::OnUnlink  )  [protected, virtual]
 

reset RenderServer reference

Reimplemented from zeitgeist::Leaf.

Definition at line 214 of file light.cpp.

References mGLLight, and mOpenGLServer.

void Light::Prepare  )  [virtual]
 

Enable render settings of this light.

Definition at line 93 of file light.cpp.

References oxygen::BaseNode::GetWorldTransform(), mAmbient, mDiffuse, mGLLight, and salt::Matrix::Pos().

Here is the call graph for this function:

void Light::RenderLitMesh boost::shared_ptr< StaticMesh mesh  ) 
 

draw lit triangles of mesh

Definition at line 127 of file light.cpp.

void Light::SetAmbient const RGBA ambient  ) 
 

sets the ambient light intensity

Definition at line 63 of file light.cpp.

References mAmbient.

void Light::SetDiffuse const RGBA diffuse  ) 
 

sets the diffuse light intensity

Definition at line 73 of file light.cpp.

References mDiffuse.

void Light::SetRadius float  radius  ) 
 

sets the light radius

Definition at line 57 of file light.cpp.

References FlushCache(), and mRadius.

Here is the call graph for this function:

void Light::SetSpecular const RGBA specular  ) 
 

sets the specular light intensity

Definition at line 83 of file light.cpp.

References mSpecular.


Member Data Documentation

RGBA kerosin::Light::mAmbient [protected]
 

the ambient light intensity

Definition at line 96 of file light.h.

Referenced by GetAmbient(), Prepare(), and SetAmbient().

std::vector<oxygen::IndexBuffer> kerosin::Light::mCachedIndices [protected]
 

Definition at line 121 of file light.h.

Referenced by FlushCache().

bool kerosin::Light::mCacheFlushed [protected]
 

state of the cache

Definition at line 115 of file light.h.

Referenced by FlushCache().

RGBA kerosin::Light::mDiffuse [protected]
 

the diffuse light intensity

Definition at line 93 of file light.h.

Referenced by GetDiffuse(), Prepare(), and SetDiffuse().

unsigned int kerosin::Light::mFP [protected]
 

Definition at line 106 of file light.h.

Referenced by OnLink().

int kerosin::Light::mGLLight [protected]
 

the allocated OpenGL light constant

Definition at line 102 of file light.h.

Referenced by OnLink(), OnUnlink(), and Prepare().

salt::Matrix kerosin::Light::mMeshOldTransform [protected]
 

mesh transform used to invalidate the cache

Definition at line 112 of file light.h.

salt::Vector3f kerosin::Light::mOldPos [protected]
 

position used to invalidate the cache

Definition at line 109 of file light.h.

boost::shared_ptr<OpenGLServer> kerosin::Light::mOpenGLServer [protected]
 

reference to the RenderServer

Definition at line 124 of file light.h.

Referenced by OnLink(), and OnUnlink().

float kerosin::Light::mRadius [protected]
 

Definition at line 104 of file light.h.

Referenced by ComputeBoundingBox(), GetRadius(), and SetRadius().

RGBA kerosin::Light::mSpecular [protected]
 

the specular light intensity

Definition at line 99 of file light.h.

Referenced by GetSpecular(), and SetSpecular().

std::vector<unsigned int> kerosin::Light::mTriangles [protected]
 

Definition at line 118 of file light.h.

unsigned int kerosin::Light::mVP [protected]
 

Definition at line 105 of file light.h.

Referenced by OnLink().


The documentation for this class was generated from the following files:
Generated on Thu Apr 6 15:43:39 2006 for rcssserver3d by  doxygen 1.4.4