Om
1.0.0
A universal framework for multimedia simulation
|
A class that represents a source of light in a scene. More...
#include <omGraphicsLight.h>
Public Types | |
enum | Type { NEVER = 0, DIRECTIONAL = 0, POINT = 1, SPOT = 2, AREA = 3 } |
An enum which represents the type of a light. More... | |
Public Member Functions | |
Light (Type newType=POINT) | |
Create a default white point light with an intensity of 1. More... | |
Light (Type newType, const Color3f &newColor, Real newIntensity) | |
Create a new light with the given type, color, and intensity. More... | |
Type | getType () const |
Return an enum value that indicates the type of this light. More... | |
void | setType (Type newType) |
Set an enum value that indicates the type of this light. More... | |
const Vector3 & | getPosition () const |
Get the position of this spot light in world space. More... | |
void | setPosition (const Vector3 &newPosition) |
Set the position of this spot light in world space. More... | |
const Vector3 & | getDirection () const |
Return the direction that this light is facing if it is not omnidirectional. More... | |
void | setDirection (const Vector3 &newDirection) |
Set the direction that this light is facing if it is not omnidirectional. More... | |
Real | getPower () const |
Return the total radiant power of the light source. More... | |
void | setPower (Real newPower) |
Set the total radiant power of the light source. More... | |
Real | getIntensity () const |
Return the intensity of the light source radiated in any direction. More... | |
void | setIntensity (Real newIntensity) |
Set the intensity of the light source radiated in any direction. More... | |
Real | getAmbient () const |
Return the ambient contribution of the light source relative to its intensity. More... | |
void | setAmbient (Real newAmbient) |
Set the ambient contribution of the light source relative to its intensity. More... | |
const Color3f & | getColor () const |
Return the color of the light source. More... | |
void | setColor (const Color3f &newColor) |
Set the color of the light source. More... | |
Color3f | getColorIntensity () const |
Return the color of the light source scaled by the light source's intensity. More... | |
Real | getAttenuation (Real distance) const |
Calculate and return the attenuation amount at the specified distance. More... | |
Vector3 & | getAttenuation () |
Return a vector indicating how this light is attenuated with distance. More... | |
const Vector3 & | getAttenuation () const |
Return a vector indicating how this light is attenuated with distance. More... | |
void | setAttenuation (const Vector3 &newAttenuation) |
Set a vector indicating how this light is attenuated with distance. More... | |
Real | getSpotCutoff () const |
Get the spot cutoff angle of the light in degrees. More... | |
void | setSpotCutoff (Real newSpotCutoff) |
Set the spot cutoff angle of this light in degrees. More... | |
Real | getSpotExponent () const |
Return the spot exponent for this light. More... | |
void | setSpotExponent (Real newSpotExponent) |
Set the spot exponent for this light. More... | |
Real | getSpotFalloff () const |
Return the spot falloff size of this light. More... | |
void | setSpotFalloff (Real newSpotFallOff) |
Set the spot falloff size of this light. More... | |
Sphere3 | getBoundingSphere (Real cutoffIntensity) const |
Return a bounding sphere for this light's area of effect with the specified cutoff intensity. More... | |
BoundingCone | getBoundingCone (Real cutoffIntensity) const |
Get a bounding cone for this light's area of effect with the specified cutoff intensity. More... | |
virtual void | getRenderables (const RenderRequest &request, const Transform3 &worldTransform, RenderQueue &outputQueue) const |
Process the renderable and add all child renderable objects to the output render queue. More... | |
Public Member Functions inherited from om::graphics::shapes::GraphicsShape | |
ShapeTypeID | getShapeTypeID () const |
Return an integer identifying the sub type of this shape. More... | |
const ShapeType & | getShapeType () const |
Return a reference to an object representing the type of this Shape. More... | |
Sphere3 | getBoundingSphere () const |
Return a bounding sphere for this transformable in its parent coordinate space. More... | |
const AABB3 & | getBoundingBox () const |
Return an axis-aligned bounding box that encompases this entire transformable in its parent coordinate space. More... | |
virtual void | updateBoundingBox () |
Update the shape's bounding box based on its current geometric representation. More... | |
virtual void | intersectRay (GraphicsRay &ray) const |
Trace a ray against this shape and compute the closest intersection. More... | |
virtual void | testRay (GraphicsRay &ray) const |
Trace a ray against this shape and determine if any intersection exist along the ray. More... | |
Public Member Functions inherited from om::graphics::base::Renderable | |
Renderable () | |
Create a new renderable object with the default renderable flags. More... | |
Renderable (const RenderableFlags &newFlags) | |
Create a new renderable object with the specified renderable flags. More... | |
RenderableFlags & | getFlags () |
Return a reference to an object that contains boolean parameters of the renderable. More... | |
const RenderableFlags & | getFlags () const |
Return an object that contains boolean parameters of the renderable. More... | |
void | setFlags (const RenderableFlags &newFlags) |
Set an object that contains boolean parameters of the renderable. More... | |
Bool | flagIsSet (RenderableFlags::Flag flag) const |
Return whether or not the specified boolan flag is set for this renderable. More... | |
Bool | flagsAreSet (const RenderableFlags &otherFlags) const |
Return whether or not all of the specified boolan flags are set for this renderable. More... | |
void | setFlag (RenderableFlags::Flag flag, Bool newIsSet=true) |
Set whether or not the specified boolan flag is set for this renderable. More... | |
Bool | getIsVisible () const |
Get whether or not the renderable and its children are visible in the scene. More... | |
void | setIsVisible (Bool newIsVisible) |
Set whether or not the renderable and its children are visible in the scene. More... | |
Bool | getShadowsEnabled () const |
Return whether or not this renderable can cast shadows. More... | |
void | setShadowsEnabled (Bool newCanCastShadows) |
Set whether or not this renderable can cast shadows. More... | |
Public Member Functions inherited from om::graphics::devices::GraphicsContextObject | |
virtual | ~GraphicsContextObject () |
Destory this graphics context object. More... | |
GraphicsContext * | getContext () const |
Return a pointer to the graphics context this context object is using to do rendering. More... | |
virtual void | setContext (GraphicsContext *newContext) |
Set a pointer to the graphics context this context object should use to do rendering. More... | |
void | clearContext () |
Clear the previous context from this object. More... | |
void | upload () |
Upload this resource's CPU representation to the GPU device. More... | |
virtual void | upload (UploadRequest &request) |
Upload this resource's CPU representation to the GPU device. More... | |
void | download () |
Upload this resource's CPU representation to the GPU device. More... | |
virtual void | download (DownloadRequest &request) |
Download the resource's GPU representation to CPU memory. More... | |
virtual Bool | isUploaded () const |
Return whether or not this graphics resource has been successfully created and uploaded to the device. More... | |
virtual Bool | isDownloaded () const |
Return whether or not this graphics resource has a copy of its data stored in CPU-side memory. More... | |
virtual Bool | isValid () const |
Return whether or not the state of this graphics resource is valid (either on CPU or GPU) and able to be used for rendering. More... | |
Static Public Attributes | |
static const ShapeType | TYPE |
A shape type object that represents the shape type to use for a light. More... | |
Static Public Attributes inherited from om::graphics::shapes::GraphicsShape | |
static const ResourceType | RESOURCE_TYPE |
The resource type for a graphics shape. More... | |
Protected Member Functions | |
Light (const ShapeType *newShapeType) | |
Create a light as a subclass that has the given shape type. More... | |
Protected Member Functions inherited from om::graphics::shapes::GraphicsShape | |
GraphicsShape (const ShapeType *newType) | |
Create a new shape with the specified type. More... | |
void | setBoundingBox (const AABB3 &newBoundingBox) |
Set the local axis-aligned bounding box for this shape. More... | |
Protected Member Functions inherited from om::graphics::devices::GraphicsContextObject | |
GraphicsContextObject () | |
Create a new graphics context object that doesn't have an associated graphics context. More... | |
GraphicsContextObject (GraphicsContext *newContext) | |
Create a new graphics context object that uses the specified context for rendering. More... | |
Additional Inherited Members | |
Protected Attributes inherited from om::graphics::base::Renderable | |
RenderableFlags | flags |
An object containing boolean configuration flags for this renderable. More... | |
Protected Attributes inherited from om::graphics::devices::GraphicsContextObject | |
GraphicsContext * | context |
A pointer to the graphics context this object is using. More... | |
A class that represents a source of light in a scene.
An enum which represents the type of a light.
Create a default white point light with an intensity of 1.
Create a new light with the given type, color, and intensity.
|
protected |
Create a light as a subclass that has the given shape type.
|
inline |
Return an enum value that indicates the type of this light.
|
inline |
Set an enum value that indicates the type of this light.
|
inline |
Get the position of this spot light in world space.
|
inline |
Set the position of this spot light in world space.
|
inline |
Return the direction that this light is facing if it is not omnidirectional.
|
inline |
Set the direction that this light is facing if it is not omnidirectional.
|
inline |
Return the total radiant power of the light source.
An omnidirectional light source is assumed. In that case, the power is equal to the intensity multiplied by 4 pi.
|
inline |
Set the total radiant power of the light source.
An omnidirectional light source is assumed. In that case, the power is equal to the intensity multiplied by 4 pi.
|
inline |
Return the intensity of the light source radiated in any direction.
An omnidirectional light source is assumed. In that case, the intensity radiated in all directions is equal to the power divided by 4 pi.
|
inline |
Set the intensity of the light source radiated in any direction.
An omnidirectional light source is assumed. In that case, the intensity radiated in all directions is equal to the power divided by 4 pi.
|
inline |
Return the ambient contribution of the light source relative to its intensity.
|
inline |
Set the ambient contribution of the light source relative to its intensity.
|
inline |
Return the color of the light source.
|
inline |
Set the color of the light source.
|
inline |
Return the color of the light source scaled by the light source's intensity.
Calculate and return the attenuation amount at the specified distance.
|
inline |
Return a vector indicating how this light is attenuated with distance.
The XYZ components refer to constant, linear, and quadratic attenuation respectively.
|
inline |
Return a vector indicating how this light is attenuated with distance.
The XYZ components refer to constant, linear, and quadratic attenuation respectively.
|
inline |
Set a vector indicating how this light is attenuated with distance.
The XYZ components refer to constant, linear, and quadratic attenuation respectively.
|
inline |
Get the spot cutoff angle of the light in degrees.
This is the maximum angle from the light's direction where light will be produced.
|
inline |
Set the spot cutoff angle of this light in degrees.
This is the maximum angle from the light's direction where light will be produced. The input value is clamped to the valid range of [0,90].
|
inline |
Return the spot exponent for this light.
If this value is 0, it will result in a spot light with uniform light distribution across the spot area. A value greater than 0 will cause the light to be more focused toward the center of the light spot.
|
inline |
Set the spot exponent for this light.
If this value is 0, it will result in a spot light with uniform light distribution across the spot area. A value greater than 0 will cause the light to be more focused toward the center of the light spot.
|
inline |
Return the spot falloff size of this light.
This value is used to create a smooth transition from 100% illuination to 0% illumination outside of the spot light's cutoff angle. This value is multiplied by the cutoff angle to determine how many degrees that falloff spans.
|
inline |
Set the spot falloff size of this light.
This value is used to create a smooth transition from 100% illuination to 0% illumination outside of the spot light's cutoff angle. This value is multiplied by the cutoff angle to determine how many degrees that falloff spans.
The new falloff value is clamped to the range [0,1].
Return a bounding sphere for this light's area of effect with the specified cutoff intensity.
BoundingCone om::graphics::shapes::Light::getBoundingCone | ( | Real | cutoffIntensity | ) | const |
Get a bounding cone for this light's area of effect with the specified cutoff intensity.
|
virtual |
Process the renderable and add all child renderable objects to the output render queue.
Implements om::graphics::base::Renderable.
|
static |
A shape type object that represents the shape type to use for a light.