VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Friends
makVrv::DtLight Class Reference

Class for generic lights This holds per-light data such as range, attenuation factors, colors, etc.

Public Member Functions

 DtLight (DtLightManager *lightManager)
 
virtual ~DtLight ()
 
DtLightoperator= (const DtLight &rhs)
 
virtual void setPosition (const Vector3_64 &vPosition)
 
virtual const Vector3_64position (void) const
 
virtual void setDirection (const Vector3_64 &vDirection)
 
virtual const Vector3_64direction (void) const
 
virtual LightGroup lightGroup () const
 
virtual void setLightGroup (LightGroup group)
 
virtual const
AxisAlignedBoundingBox_64
worldAABB (void) const
 
virtual bool isInitted () const
 
virtual void setLightSourceTypeId (unsigned int lightSourceTypeId)
 
virtual unsigned int lightSourceTypeId () const
 
virtual void printDetails (void) const
 
virtual void setUserValue (float64 val)
 
virtual float64 userValue (void) const
 
virtual void setOn (bool bOn)
 
virtual bool isOn (void) const
 
virtual void setLightType (LightType lightType)
 
virtual LightType lightType (void) const
 
virtual void setSensorMask (unsigned int sensorMask)
 
virtual unsigned int sensorMask () const
 
virtual void setAmbientColor (const DtColorValue &color)
 
virtual void setDiffuseColor (const DtColorValue &color)
 
virtual void setSpecularColor (const DtColorValue &color)
 
virtual const DtColorValueambientColor (void) const
 
virtual const DtColorValuediffuseColor (void) const
 
virtual const DtColorValuespecularColor (void) const
 
virtual void setRange (float32 fRange)
 
virtual float32 range (void) const
 
virtual float32 squaredRange (void) const
 
virtual void setAttenuation (float32 fConstant, float32 fLinear, float32 fQuadratic)
 
virtual float32 constantAttenuation (void) const
 
virtual float32 linearAttenuation (void) const
 
virtual float32 quadraticAttenuation (void) const
 
virtual void getAttenuation (float32 attenuations[3]) const
 
virtual void setSpotLightParameters (const DtDegrees &fInnerAngleDegrees, const DtDegrees &fOuterAngleDegrees, float32 fFalloff)
 
virtual void setSpotLightAngles (const DtDegrees &fInnerAngleDegrees, const DtDegrees &fOuterAngleDegrees)
 
virtual void spotLightAngles (DtDegrees &fInnerAngleDegrees, DtDegrees &fOuterAngleDegrees)
 
virtual DtDegrees innerAngle (void) const
 
virtual DtDegrees outerAngle (void) const
 
virtual float32 falloff (void) const
 
virtual void setReserved (bool val)
 
virtual bool reserved (void) const
 
virtual void setOctreeNode (void *pUserData)
 
virtual void * octreeNode () const
 

Protected Member Functions

virtual void getArbitraryBasisVectors (Vector3_64 &vBasis0, Vector3_64 &vBasis1) const
 
virtual void getArbitraryBasisPoints (float distance, std::array< Vector3_64, 4 > &point) const
 
virtual float getAngleFactor () const
 
virtual Vector3_64 getSpotCenter () const
 
virtual void UpdateBounds (void)
 

Protected Attributes

LightType myLightType
 
unsigned int mySensorMask
 
DtColorValue myAmbientColor
 
DtColorValue myDiffuseColor
 
DtColorValue mySpecularColor
 
Vector3_64 myVecPosition
 
Vector3_64 myVecDirection
 
float32 myfRange
 
float32 myfSquaredRange
 
float32 myfConstantAttenuation
 
float32 myfLinearAttenuation
 
float32 myfQuadraticAttenuation
 
DtDegrees myfInnerAngle
 
DtDegrees myfOuterAngle
 
float32 myfFallOff
 
bool mybIsOn
 
bool mybIsInitted
 
bool myIsReserved = false
 
void * myOctreeNode
 
AxisAlignedBoundingBox_64 myWorldAABB
 
LightGroup myLightGroup
 
DtLightManagermyLightManager
 
unsigned int myLightSourceTypeId
 
float64 myUserValue
 

Private Member Functions

 DtLight ()=delete
 
 DtLight (const DtLight &rhs)=delete
 

Friends

class DtLightScreenSpaceData
 

Constructor & Destructor Documentation

makVrv::DtLight::DtLight ( DtLightManager lightManager)

CTOR.

virtual makVrv::DtLight::~DtLight ( )
virtual

DTOR.

makVrv::DtLight::DtLight ( )
privatedelete

not allowed

makVrv::DtLight::DtLight ( const DtLight rhs)
privatedelete

not allowed

Member Function Documentation

DtLight& makVrv::DtLight::operator= ( const DtLight rhs)

assignment

virtual void makVrv::DtLight::setOn ( bool  bOn)
virtual

Turn light on or off.

virtual bool makVrv::DtLight::isOn ( void  ) const
virtual

Turn light on or off.

virtual void makVrv::DtLight::setLightType ( LightType  lightType)
virtual

Turn light on or off This is separate so as to enable pooling of lights so that a previous light of type x in the pool can be picked up and used as a light of a different type y, or the same type for that matter.

virtual LightType makVrv::DtLight::lightType ( void  ) const
virtual

Turn light on or off This is separate so as to enable pooling of lights so that a previous light of type x in the pool can be picked up and used as a light of a different type y, or the same type for that matter.

virtual void makVrv::DtLight::setSensorMask ( unsigned int  sensorMask)
virtual

set/get the sensor bit mask. Controls which sensor modes this light source is visible in. bit 0 is visual, bit 1 is NVG, bit 2 is MWIR, bit 3 is LWIR. if the bit is set then the light source is applied in that sensor mode else it is not. see the getLightIntersectionData function in setupLightSourceIntersectionData.cs.glsl for the check

virtual unsigned int makVrv::DtLight::sensorMask ( ) const
virtual

set/get the sensor bit mask. Controls which sensor modes this light source is visible in. bit 0 is visual, bit 1 is NVG, bit 2 is MWIR, bit 3 is LWIR. if the bit is set then the light source is applied in that sensor mode else it is not. see the getLightIntersectionData function in setupLightSourceIntersectionData.cs.glsl for the check

virtual void makVrv::DtLight::setAmbientColor ( const DtColorValue color)
virtual

Set ambient, diffuse, specular properties.

virtual void makVrv::DtLight::setDiffuseColor ( const DtColorValue color)
virtual

Set ambient, diffuse, specular properties.

virtual void makVrv::DtLight::setSpecularColor ( const DtColorValue color)
virtual

Set ambient, diffuse, specular properties.

virtual const DtColorValue& makVrv::DtLight::ambientColor ( void  ) const
virtual

Get ambient, diffuse, specular properties.

virtual const DtColorValue& makVrv::DtLight::diffuseColor ( void  ) const
virtual

Get ambient, diffuse, specular properties.

virtual const DtColorValue& makVrv::DtLight::specularColor ( void  ) const
virtual

Get ambient, diffuse, specular properties.

virtual void makVrv::DtLight::setPosition ( const Vector3_64 vPosition)
virtual

Only relevant to Point and Spot Lights.

virtual const Vector3_64& makVrv::DtLight::position ( void  ) const
virtual
virtual void makVrv::DtLight::setDirection ( const Vector3_64 vDirection)
virtual

Only relevant to Directional and Spot Lights.

virtual const Vector3_64& makVrv::DtLight::direction ( void  ) const
virtual
virtual void makVrv::DtLight::setRange ( float32  fRange)
virtual

Range and Squared Range.

virtual float32 makVrv::DtLight::range ( void  ) const
virtual

Range and Squared Range.

virtual float32 makVrv::DtLight::squaredRange ( void  ) const
virtual

Range and Squared Range.

virtual void makVrv::DtLight::setAttenuation ( float32  fConstant,
float32  fLinear,
float32  fQuadratic 
)
virtual

Attenuation properties.

virtual float32 makVrv::DtLight::constantAttenuation ( void  ) const
virtual

Attenuation properties.

virtual float32 makVrv::DtLight::linearAttenuation ( void  ) const
virtual

Attenuation properties.

virtual float32 makVrv::DtLight::quadraticAttenuation ( void  ) const
virtual

Attenuation properties.

virtual void makVrv::DtLight::getAttenuation ( float32  attenuations[3]) const
virtual

Attenuation properties.

virtual void makVrv::DtLight::setSpotLightParameters ( const DtDegrees fInnerAngleDegrees,
const DtDegrees fOuterAngleDegrees,
float32  fFalloff 
)
virtual

Spot Light properties.

virtual void makVrv::DtLight::setSpotLightAngles ( const DtDegrees fInnerAngleDegrees,
const DtDegrees fOuterAngleDegrees 
)
virtual

Spot Light properties.

virtual void makVrv::DtLight::spotLightAngles ( DtDegrees fInnerAngleDegrees,
DtDegrees fOuterAngleDegrees 
)
virtual

Spot Light properties.

virtual DtDegrees makVrv::DtLight::innerAngle ( void  ) const
virtual

Spot Light properties.

virtual DtDegrees makVrv::DtLight::outerAngle ( void  ) const
virtual

Spot Light properties.

virtual float32 makVrv::DtLight::falloff ( void  ) const
virtual

Spot Light properties.

virtual void makVrv::DtLight::setReserved ( bool  val)
virtual

reserved?

virtual bool makVrv::DtLight::reserved ( void  ) const
virtual

reserved?

virtual void makVrv::DtLight::setOctreeNode ( void *  pUserData)
virtual

octree Data

virtual void* makVrv::DtLight::octreeNode ( ) const
virtual

octree Data

virtual LightGroup makVrv::DtLight::lightGroup ( ) const
virtual

Which group is this light under (prop, terrain, none)

virtual void makVrv::DtLight::setLightGroup ( LightGroup  group)
virtual

Set the group this light belongs to (props, terrain, none)

virtual const AxisAlignedBoundingBox_64& makVrv::DtLight::worldAABB ( void  ) const
virtual

Get the world AABB.

virtual bool makVrv::DtLight::isInitted ( ) const
virtual

initialized?

virtual void makVrv::DtLight::setLightSourceTypeId ( unsigned int  lightSourceTypeId)
virtual

set the light source type id which is used by the light manager to know what type of light source this is.

virtual unsigned int makVrv::DtLight::lightSourceTypeId ( ) const
virtual

get the light source type id

virtual void makVrv::DtLight::printDetails ( void  ) const
virtual

print details

virtual void makVrv::DtLight::setUserValue ( float64  val)
virtual

arbitrary value on this light (like user data)

virtual float64 makVrv::DtLight::userValue ( void  ) const
virtual

arbitrary value on this light (like user data)

virtual void makVrv::DtLight::getArbitraryBasisVectors ( Vector3_64 vBasis0,
Vector3_64 vBasis1 
) const
protectedvirtual

Calculate two arbitrary basis vectors for the light direction.

virtual void makVrv::DtLight::getArbitraryBasisPoints ( float  distance,
std::array< Vector3_64, 4 > &  point 
) const
protectedvirtual

Calculate basis points along arbitrary basis vectors with given distance.

virtual float makVrv::DtLight::getAngleFactor ( ) const
protectedvirtual

Calculate angle multiplicative factor (see comment in C++)

virtual Vector3_64 makVrv::DtLight::getSpotCenter ( ) const
protectedvirtual

Return the center of the distant side of the spotlight cone.

virtual void makVrv::DtLight::UpdateBounds ( void  )
protectedvirtual

update bounds

Friends And Related Function Documentation

friend class DtLightScreenSpaceData
friend

Member Data Documentation

LightType makVrv::DtLight::myLightType
protected
unsigned int makVrv::DtLight::mySensorMask
protected
DtColorValue makVrv::DtLight::myAmbientColor
protected
DtColorValue makVrv::DtLight::myDiffuseColor
protected
DtColorValue makVrv::DtLight::mySpecularColor
protected
Vector3_64 makVrv::DtLight::myVecPosition
protected

Applicable only to point lights and spot lights.

Vector3_64 makVrv::DtLight::myVecDirection
protected

Applicable only to directional lights.

float32 makVrv::DtLight::myfRange
protected
float32 makVrv::DtLight::myfSquaredRange
protected
float32 makVrv::DtLight::myfConstantAttenuation
protected
float32 makVrv::DtLight::myfLinearAttenuation
protected
float32 makVrv::DtLight::myfQuadraticAttenuation
protected
DtDegrees makVrv::DtLight::myfInnerAngle
protected

Angle of a spotlight's inner cone - that is, the fully illuminated spotlight cone.

DtDegrees makVrv::DtLight::myfOuterAngle
protected

Angle defining the outer edge of the spotlight's outer cone. Points outside this cone are not lit by the spotlight. This value must be between 0 and pi.

float32 makVrv::DtLight::myfFallOff
protected

Decrease in illumination between a spotlight's inner cone and the outer edge of the outer cone.

bool makVrv::DtLight::mybIsOn
protected
bool makVrv::DtLight::mybIsInitted
protected

init bit to keep track if it's really safe to add to the octtree

bool makVrv::DtLight::myIsReserved = false
protected

Is this a reserved light?

void* makVrv::DtLight::myOctreeNode
protected
AxisAlignedBoundingBox_64 makVrv::DtLight::myWorldAABB
protected
LightGroup makVrv::DtLight::myLightGroup
protected

For switching on and off lights Is this light node under the DtOsgRenderer::propsRoot or under DtOsgRenderer::terrainRoot.

DtLightManager* makVrv::DtLight::myLightManager
protected
unsigned int makVrv::DtLight::myLightSourceTypeId
protected
float64 makVrv::DtLight::myUserValue
protected

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

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)