Om  1.0.0
A universal framework for multimedia simulation
Public Types | Public Member Functions | List of all members
om::graphics::materials::ConstantUsage Class Reference

A class that specifies how a constant is semantically used for rendering. More...

#include <omGraphicsConstantUsage.h>

Public Types

enum  Enum {
  UNDEFINED, DIFFUSE_COLOR, SPECULAR_COLOR, AMBIENT_COLOR,
  REFLECTIVITY, PHONG_EXPONENT, INDEX_OF_REFRACTION, MODEL_MATRIX,
  INVERSE_MODEL_MATRIX, VIEW_MATRIX, INVERSE_VIEW_MATRIX, MODEL_VIEW_MATRIX,
  PROJECTION_MATRIX, MODEL_VIEW_PROJECTION_MATRIX, MODEL_NORMAL_MATRIX, MODEL_VIEW_NORMAL_MATRIX,
  BONE_MATRIX, DIRECTIONAL_LIGHT_DIRECTION, DIRECTIONAL_LIGHT_VIEW_SPACE_DIRECTION, DIRECTIONAL_LIGHT_VIEW_SPACE_HALF_VECTOR,
  DIRECTIONAL_LIGHT_COLOR, DIRECTIONAL_LIGHT_AMBIENT, DIRECTIONAL_LIGHT_SHADOW_MATRIX, DIRECTIONAL_LIGHT_CSM_MATRIX_0,
  DIRECTIONAL_LIGHT_CSM_MATRIX_1 = DIRECTIONAL_LIGHT_CSM_MATRIX_0 + 1, DIRECTIONAL_LIGHT_CSM_MATRIX_2 = DIRECTIONAL_LIGHT_CSM_MATRIX_0 + 2, DIRECTIONAL_LIGHT_CSM_MATRIX_3 = DIRECTIONAL_LIGHT_CSM_MATRIX_0 + 3, DIRECTIONAL_LIGHT_CSM_MATRIX_4 = DIRECTIONAL_LIGHT_CSM_MATRIX_0 + 4,
  DIRECTIONAL_LIGHT_CSM_MATRIX_5 = DIRECTIONAL_LIGHT_CSM_MATRIX_0 + 5, DIRECTIONAL_LIGHT_CSM_MATRIX_6 = DIRECTIONAL_LIGHT_CSM_MATRIX_0 + 6, DIRECTIONAL_LIGHT_CSM_MATRIX_7 = DIRECTIONAL_LIGHT_CSM_MATRIX_0 + 7, DIRECTIONAL_LIGHT_SHADOW_MAP_SIZE,
  POINT_LIGHT_POSITION, POINT_LIGHT_VIEW_SPACE_POSITION, POINT_LIGHT_COLOR, POINT_LIGHT_AMBIENT,
  POINT_LIGHT_ATTENUATION, POINT_LIGHT_SHADOW_CUBE_PROJECTION_MATRIX, SPOT_LIGHT_POSITION, SPOT_LIGHT_VIEW_SPACE_POSITION,
  SPOT_LIGHT_DIRECTION, SPOT_LIGHT_VIEW_SPACE_DIRECTION, SPOT_LIGHT_CUTOFF, SPOT_LIGHT_COSINE_CUTOFF,
  SPOT_LIGHT_FALLOFF, SPOT_LIGHT_COSINE_FALLOFF, SPOT_LIGHT_EXPONENT, SPOT_LIGHT_COLOR,
  SPOT_LIGHT_AMBIENT, SPOT_LIGHT_ATTENUATION, SPOT_LIGHT_SHADOW_MATRIX, SPOT_LIGHT_SHADOW_MAP_SIZE,
  SHADOW_DEPTH_BIAS, GUI_BACKGROUND_COLOR, GUI_BORDER_COLOR, GUI_BORDER_RADIUS,
  GUI_BORDER_WIDTH, GUI_IMAGE_COLOR, GUI_TEXT_COLOR, GUI_TEXT_OUTLINE_COLOR,
  GUI_SELECTION_COLOR, GUI_SHADOW_COLOR, GUI_SHADOW_VECTOR, GUI_PIXEL_SIZE,
  SOUND_REFLECTIVITY, SOUND_SCATTERING, SOUND_TRANSMISSION
}
 

Public Member Functions

 ConstantUsage (Enum newUsage)
 Create a new constant usage with the specified constant usage enum value. More...
 
 ConstantUsage (Enum newUsage, Index newIndex)
 Create a new constant usage with the specified usage enum value and index. More...
 
 operator Enum () const
 Convert this constant usage to an enum value. More...
 
Bool operator== (const ConstantUsage &other) const
 Return whether or not this constant usage is the same as another. More...
 
Bool operator== (ConstantUsage::Enum other) const
 Return whether or not this constant usage is the same as another. More...
 
Bool operator!= (const ConstantUsage &other) const
 Return whether or not this constant usage is different than another. More...
 
Bool operator!= (ConstantUsage::Enum other) const
 Return whether or not this constant usage is different than another. More...
 
Bool isValidType (const AttributeType &type) const
 Return whether or not the specified attribute type is a valid type for this usage. More...
 
AttributeType getDefaultType () const
 Return the default attribute type to use for this constant usage. More...
 
Index getIndex () const
 Return an index for the constant usage. More...
 
void setIndex (Index newIndex)
 Return an index for the constant usage. More...
 
String toString () const
 Return a string representation of the constant usage. More...
 
 operator String () const
 Convert this constant usage into a string representation. More...
 
Hash getHashCode () const
 Return a hash code for this constant usage. More...
 

Detailed Description

A class that specifies how a constant is semantically used for rendering.

Each instance allows the user to specify an enum value indicating the type of usage and also an integral index for that usage. This allows the user to specify multiple light-position usages, for instance.

Member Enumeration Documentation

Enumerator
UNDEFINED 

An undefined constant usage.

DIFFUSE_COLOR 

The 3 or 4 component diffuse color of a material surface.

SPECULAR_COLOR 

The 3 or 4 component specular color of a material surface.

AMBIENT_COLOR 

The 3 or 4 component ambient color of a material surface.

REFLECTIVITY 

A scalar value between 0 and 1 that indicates how bright the material's specular highlight should be.

PHONG_EXPONENT 

The scalar floating-point phong exponent for a material.

INDEX_OF_REFRACTION 

The index of refraction of a material.

MODEL_MATRIX 

The 4x4 transformation matrix from object space to world space.

INVERSE_MODEL_MATRIX 

The 4x4 transformation matrix from object space to world space.

VIEW_MATRIX 

The 4x4 transformation matrix from view to world space.

INVERSE_VIEW_MATRIX 

The 4x4 transformation matrix from world to view space.

MODEL_VIEW_MATRIX 

The 4x4 transformation matrix from object to world to view space.

PROJECTION_MATRIX 

The 4x4 projection matrix for the current view.

MODEL_VIEW_PROJECTION_MATRIX 

The modelview matrix multiplied by the projection matrix (P*Mv).

MODEL_NORMAL_MATRIX 

The upper-left 3x3 section of the inverse of the transpose of the model matrix.

MODEL_VIEW_NORMAL_MATRIX 

The upper-left 3x3 section of the inverse of the transpose of the model view matrix.

BONE_MATRIX 

The 4x4 transformation matrix from bone to model-space.

DIRECTIONAL_LIGHT_DIRECTION 

The 3d vector specifying the direction to a directional light in world space.

DIRECTIONAL_LIGHT_VIEW_SPACE_DIRECTION 

The 3d vector specifying the direction to a directional light in view space.

DIRECTIONAL_LIGHT_VIEW_SPACE_HALF_VECTOR 

The 3d vector specifying the direction of maximum highlights for a directional light in view space.

DIRECTIONAL_LIGHT_COLOR 

The 3 or 4 component color of a directional light source.

DIRECTIONAL_LIGHT_AMBIENT 

The scalar ambient contribution of a directional light source.

DIRECTIONAL_LIGHT_SHADOW_MATRIX 

The 4x4 matrix transforming view-space positions into shadow map texture coordinate space for a directional light.

DIRECTIONAL_LIGHT_CSM_MATRIX_0 

The 4x4 matrix transforming view-space positions into texture coordinates for a directional light shadow map cascade.

DIRECTIONAL_LIGHT_CSM_MATRIX_1 
DIRECTIONAL_LIGHT_CSM_MATRIX_2 
DIRECTIONAL_LIGHT_CSM_MATRIX_3 
DIRECTIONAL_LIGHT_CSM_MATRIX_4 
DIRECTIONAL_LIGHT_CSM_MATRIX_5 
DIRECTIONAL_LIGHT_CSM_MATRIX_6 
DIRECTIONAL_LIGHT_CSM_MATRIX_7 
DIRECTIONAL_LIGHT_SHADOW_MAP_SIZE 

A 2d vector specifying the horizontal and vertical resolution for a directional light shadow map.

POINT_LIGHT_POSITION 

The 3d or 4d vector specifying the position of a point light in world space.

POINT_LIGHT_VIEW_SPACE_POSITION 

The 3d or 4d vector specifying the position of a point light in view space.

POINT_LIGHT_COLOR 

The 3 or 4 component color of a point light source.

POINT_LIGHT_AMBIENT 

The scalar ambient contribution of a point light source.

POINT_LIGHT_ATTENUATION 

The 3-component attenuation (constant,linear,quadratic) of a point light source.

POINT_LIGHT_SHADOW_CUBE_PROJECTION_MATRIX 

The 4x4 projection matrix for each of the faces of a point light cube shadow map.

SPOT_LIGHT_POSITION 

The 3d or 4d vector specifying the position of a spot light in world space.

SPOT_LIGHT_VIEW_SPACE_POSITION 

The 3d or 4d vector specifying the position of a spot light in view space.

SPOT_LIGHT_DIRECTION 

The 3d vector specifying the direction of a spot light in world space.

SPOT_LIGHT_VIEW_SPACE_DIRECTION 

The 3d vector specifying the direction of a light in view space.

SPOT_LIGHT_CUTOFF 

The scalar spot cutoff angle in radians of a spot light.

SPOT_LIGHT_COSINE_CUTOFF 

The cosine of the scalar spot cutoff angle of a spot light.

SPOT_LIGHT_FALLOFF 

The the scalar spot falloff angle of a spot light.

SPOT_LIGHT_COSINE_FALLOFF 

The cosine of the scalar spot falloff angle of a spot light.

SPOT_LIGHT_EXPONENT 

The scalar falloff of the spot light from the light's direction.

SPOT_LIGHT_COLOR 

The 3 or 4 component color of a spot light source.

SPOT_LIGHT_AMBIENT 

The scalar ambient contribution of a point light source.

SPOT_LIGHT_ATTENUATION 

The 3-component attenuation (constant,linear,quadratic) of a spot light source.

SPOT_LIGHT_SHADOW_MATRIX 

The 4x4 matrix transforming view-space positions into shadow map texture coordinate space for a spot light.

SPOT_LIGHT_SHADOW_MAP_SIZE 

A 2d vector specifying the horizontal and vertical resolution for a spot light shadow map.

SHADOW_DEPTH_BIAS 

A factor by which the depth should be scaled when rendering a shadow map.

GUI_BACKGROUND_COLOR 

The 3 or 4 component background color for a GUI object.

GUI_BORDER_COLOR 

The 3 or 4 component border color for a GUI object.

GUI_BORDER_RADIUS 

The scalar radius of the border bevels for a GUI object.

GUI_BORDER_WIDTH 

The scalar width of the border line for a GUI object.

GUI_IMAGE_COLOR 

The 3 or 4 component color that is used to shade (multiply) images displayed in a GUI.

GUI_TEXT_COLOR 

The 3 or 4 component color to use for rendering text in a GUI.

GUI_TEXT_OUTLINE_COLOR 

The 3 or 4 component color to use for rendering text outlines in a GUI.

GUI_SELECTION_COLOR 

The 3 or 4 component color to use for rendering selected areas in a GUI.

GUI_SHADOW_COLOR 

The 3 or 4 component color to use for rendering shadows in a GUI.

GUI_SHADOW_VECTOR 

A 2D or 3D vector that indicates the shadow offset direction and distance.

GUI_PIXEL_SIZE 

The size of a rendered pixel in the local coordinate space of a GUI object.

SOUND_REFLECTIVITY 

The fraction of sound that hits a surface that is reflected, per frequency.

SOUND_SCATTERING 

The fraction of reflected sound that hits a surface that is scattered, per frequency.

SOUND_TRANSMISSION 

The fraction of sound that is not reflected that is transmitted through the material, per frequency.

Constructor & Destructor Documentation

om::graphics::materials::ConstantUsage::ConstantUsage ( Enum  newUsage)
inline

Create a new constant usage with the specified constant usage enum value.

om::graphics::materials::ConstantUsage::ConstantUsage ( Enum  newUsage,
Index  newIndex 
)
inline

Create a new constant usage with the specified usage enum value and index.

Member Function Documentation

om::graphics::materials::ConstantUsage::operator Enum ( ) const
inline

Convert this constant usage to an enum value.

Bool om::graphics::materials::ConstantUsage::operator== ( const ConstantUsage other) const
inline

Return whether or not this constant usage is the same as another.

Bool om::graphics::materials::ConstantUsage::operator== ( ConstantUsage::Enum  other) const
inline

Return whether or not this constant usage is the same as another.

This operator does not compare any usage index, just the usage type.

Bool om::graphics::materials::ConstantUsage::operator!= ( const ConstantUsage other) const
inline

Return whether or not this constant usage is different than another.

Bool om::graphics::materials::ConstantUsage::operator!= ( ConstantUsage::Enum  other) const
inline

Return whether or not this constant usage is different than another.

This operator does not compare any usage index, just the usage type.

Bool om::graphics::materials::ConstantUsage::isValidType ( const AttributeType type) const

Return whether or not the specified attribute type is a valid type for this usage.

AttributeType om::graphics::materials::ConstantUsage::getDefaultType ( ) const

Return the default attribute type to use for this constant usage.

Index om::graphics::materials::ConstantUsage::getIndex ( ) const
inline

Return an index for the constant usage.

This value allows the user to keep track of multiple distinct usages separately (i.e. for multiple lights) that have the same usage type.

void om::graphics::materials::ConstantUsage::setIndex ( Index  newIndex)
inline

Return an index for the constant usage.

This value allows the user to keep track of multiple distinct usages separately (i.e. for multiple lights) that have the same usage type.

String om::graphics::materials::ConstantUsage::toString ( ) const

Return a string representation of the constant usage.

om::graphics::materials::ConstantUsage::operator String ( ) const
inline

Convert this constant usage into a string representation.

Hash om::graphics::materials::ConstantUsage::getHashCode ( ) const
inline

Return a hash code for this constant usage.


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