OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Classes | Functions | Variables
SceneUtil Namespace Reference

Classes

class  CopyRigVisitor
 
class  CopyOp
 
class  ControllerSource
 
class  FrameTimeSource
 
class  ControllerFunction
 
class  Controller
 
class  ControllerVisitor
 Pure virtual base class - visit() all controllers that are attached as UpdateCallbacks in a scene graph. More...
 
class  AssignControllerSourcesVisitor
 
class  FindMaxControllerLengthVisitor
 Finds the maximum of all controller functions in the given scene graph. More...
 
class  LightController
 Controller class to handle a pulsing and/or flickering light. More...
 
class  LightStateAttribute
 
class  CollectLightCallback
 
class  LightManagerUpdateCallback
 
class  LightSource
 
class  LightManager
 Decorator node implementing the rendering of any number of LightSources that can be anywhere in the subgraph. More...
 
class  LightListCallback
 
class  PositionAttitudeTransform
 A customized version of osg::PositionAttitudeTransform optimized for speed. Uses single precision values. Also removed _pivotPoint which we don't need. More...
 
class  UpdateRigBounds
 
class  UpdateRigGeometry
 
class  DummyComputeBoundCallback
 
class  RigGeometry
 Mesh skinning implementation. More...
 
class  InitBoneCacheVisitor
 
class  Bone
 Defines a Bone hierarchy, used for updating of skeleton-space bone matrices. More...
 
class  Skeleton
 Handles the bone matrices for any number of child RigGeometries. More...
 
class  StateSetUpdater
 Implements efficient per-frame updating of StateSets. More...
 
class  CompositeStateSetUpdater
 A variant of the StateSetController that can be made up of multiple controllers all controlling the same target. More...
 
class  UnrefWorkItem
 
class  UnrefQueue
 Handles unreferencing of objects through the WorkQueue. Typical use scenario would be the main thread pushing objects that are no longer needed, and the background thread deleting them. More...
 
class  FindByNameVisitor
 
class  DisableFreezeOnCullVisitor
 
class  WorkItem
 
class  WorkQueue
 A work queue that users can push work items onto, to be completed by one or more background threads. More...
 
class  WorkThread
 Internally used by WorkQueue. More...
 

Functions

osg::ref_ptr< osg::Node > attach (osg::ref_ptr< osg::Node > toAttach, osg::Node *master, const std::string &filter, const std::string &attachNode)
 
LightManagerfindLightManager (const osg::NodePath &path)
 
bool sortLights (const LightManager::LightSourceViewBound *left, const LightManager::LightSourceViewBound *right)
 
void configureLight (osg::Light *light, float radius, bool isExterior, bool outQuadInLin, bool useQuadratic, float quadraticValue, float quadraticRadiusMult, bool useLinear, float linearRadiusMult, float linearValue)
 
void addLight (osg::Group *node, const ESM::Light *esmLight, unsigned int partsysMask, unsigned int lightMask, bool isExterior, bool outQuadInLin, bool useQuadratic, float quadraticValue, float quadraticRadiusMult, bool useLinear, float linearRadiusMult, float linearValue)
 Convert an ESM::Light to a SceneUtil::LightSource, and add it to a sub graph. More...
 
osg::ref_ptr< LightSourcecreateLightSource (const ESM::Light *esmLight, unsigned int lightMask, bool isExterior, bool outQuadInLin, bool useQuadratic, float quadraticValue, float quadraticRadiusMult, bool useLinear, float linearRadiusMult, float linearValue, const osg::Vec4f &ambient=osg::Vec4f(0, 0, 0, 1))
 Convert an ESM::Light to a SceneUtil::LightSource, and return it. More...
 
osg::ref_ptr< osg::Geometry > createPathgridGeometry (const ESM::Pathgrid &pathgrid)
 
osg::ref_ptr< osg::Geometry > createPathgridSelectedWireframe (const ESM::Pathgrid &pathgrid, const std::vector< unsigned short > &selected)
 
unsigned short getPathgridNode (unsigned short vertexIndex)
 
void accumulateMatrix (const osg::Matrixf &invBindMatrix, const osg::Matrixf &matrix, float weight, osg::Matrixf &result)
 
void transformBoundingSphere (const osg::Matrixf &matrix, osg::BoundingSphere &bsphere)
 
osg::Vec4f colourFromRGB (unsigned int clr)
 
osg::Vec4f colourFromRGBA (unsigned int clr)
 
osg::ref_ptr< osg::Geometry > createWaterGeometry (float size, int segments, float textureRepeats)
 
osg::ref_ptr< osg::StateSet > createSimpleWaterStateSet (float alpha, int renderBin)
 

Variables

static int sLightId = 0
 
const unsigned short DiamondVertexCount = 6
 
const unsigned short DiamondIndexCount = 24
 
const unsigned short DiamondWireframeIndexCount = 24
 
const unsigned short DiamondConnectorVertexCount = 4
 
const unsigned short DiamondTotalVertexCount = DiamondVertexCount + DiamondConnectorVertexCount
 
const float DiamondWireframeScalar = 1.1f
 
const osg::Vec3f DiamondPoints [DiamondVertexCount]
 
const unsigned short DiamondIndices [DiamondIndexCount]
 
const unsigned short DiamondWireframeIndices [DiamondWireframeIndexCount]
 
const unsigned short DiamondConnectorVertices [DiamondConnectorVertexCount]
 
const osg::Vec4f DiamondColors [DiamondVertexCount]
 
const osg::Vec4f DiamondEdgeColor = osg::Vec4f(0.5f, 1.f, 1.f, 1.f)
 
const osg::Vec4f DiamondWireColor = osg::Vec4f(0.72f, 0.f, 0.96f, 1.f)
 
const osg::Vec4f DiamondFocusWireColor = osg::Vec4f(0.91f, 0.66f, 1.f, 1.f)
 
const float DiamondHalfHeight = 40.f
 
const float DiamondHalfWidth = 16.f
 

Function Documentation

void SceneUtil::accumulateMatrix ( const osg::Matrixf &  invBindMatrix,
const osg::Matrixf &  matrix,
float  weight,
osg::Matrixf &  result 
)

Here is the caller graph for this function:

void SceneUtil::addLight ( osg::Group *  node,
const ESM::Light esmLight,
unsigned int  partsysMask,
unsigned int  lightMask,
bool  isExterior,
bool  outQuadInLin,
bool  useQuadratic,
float  quadraticValue,
float  quadraticRadiusMult,
bool  useLinear,
float  linearRadiusMult,
float  linearValue 
)

Convert an ESM::Light to a SceneUtil::LightSource, and add it to a sub graph.

Note
If the sub graph contains a node named "AttachLight" (case insensitive), then the light is added to that. Otherwise, the light is added in the center of the node's bounds.
Parameters
nodeThe sub graph to add a light to
esmLightThe light definition coming from the game files containing radius, color, flicker, etc.
partsysMaskNode mask to ignore when computing the sub graph's bounding box.
lightMaskMask to assign to the newly created LightSource.
isExteriorIs the light outside? May be used for deciding which attenuation settings to use.
Attenuation parameters come from the game INI file.

Here is the call graph for this function:

Here is the caller graph for this function:

osg::ref_ptr< osg::Node > SceneUtil::attach ( osg::ref_ptr< osg::Node >  toAttach,
osg::Node *  master,
const std::string &  filter,
const std::string &  attachNode 
)

Attach parts of the toAttach scenegraph to the master scenegraph, using the specified filter and attachment node. If the toAttach scene graph contains skinned objects, we will attach only those (filtered by the filter). Otherwise, just attach all of the toAttach scenegraph to the attachment node on the master scenegraph, with no filtering.

Note
The master scene graph is expected to include a skeleton.
Returns
A newly created node that is directly attached to the master scene graph

Here is the call graph for this function:

Here is the caller graph for this function:

osg::Vec4f SceneUtil::colourFromRGB ( unsigned int  clr)

Here is the caller graph for this function:

osg::Vec4f SceneUtil::colourFromRGBA ( unsigned int  clr)
void SceneUtil::configureLight ( osg::Light *  light,
float  radius,
bool  isExterior,
bool  outQuadInLin,
bool  useQuadratic,
float  quadraticValue,
float  quadraticRadiusMult,
bool  useLinear,
float  linearRadiusMult,
float  linearValue 
)

Here is the caller graph for this function:

osg::ref_ptr< LightSource > SceneUtil::createLightSource ( const ESM::Light esmLight,
unsigned int  lightMask,
bool  isExterior,
bool  outQuadInLin,
bool  useQuadratic,
float  quadraticValue,
float  quadraticRadiusMult,
bool  useLinear,
float  linearRadiusMult,
float  linearValue,
const osg::Vec4f &  ambient = osg::Vec4f(0, 0, 0, 1) 
)

Convert an ESM::Light to a SceneUtil::LightSource, and return it.

Parameters
esmLightThe light definition coming from the game files containing radius, color, flicker, etc.
lightMaskMask to assign to the newly created LightSource.
isExteriorIs the light outside? May be used for deciding which attenuation settings to use.
ambientAmbient component of the light.
Attenuation parameters come from the game INI file.

Here is the call graph for this function:

Here is the caller graph for this function:

osg::ref_ptr< osg::Geometry > SceneUtil::createPathgridGeometry ( const ESM::Pathgrid pathgrid)

Here is the caller graph for this function:

osg::ref_ptr< osg::Geometry > SceneUtil::createPathgridSelectedWireframe ( const ESM::Pathgrid pathgrid,
const std::vector< unsigned short > &  selected 
)

Here is the caller graph for this function:

osg::ref_ptr< osg::StateSet > SceneUtil::createSimpleWaterStateSet ( float  alpha,
int  renderBin 
)

Here is the caller graph for this function:

osg::ref_ptr< osg::Geometry > SceneUtil::createWaterGeometry ( float  size,
int  segments,
float  textureRepeats 
)

Here is the caller graph for this function:

LightManager* SceneUtil::findLightManager ( const osg::NodePath &  path)

Here is the caller graph for this function:

unsigned short SceneUtil::getPathgridNode ( unsigned short  vertexIndex)

Here is the caller graph for this function:

bool SceneUtil::sortLights ( const LightManager::LightSourceViewBound *  left,
const LightManager::LightSourceViewBound *  right 
)
void SceneUtil::transformBoundingSphere ( const osg::Matrixf &  matrix,
osg::BoundingSphere &  bsphere 
)

Here is the caller graph for this function:

Variable Documentation

const osg::Vec4f SceneUtil::DiamondColors[DiamondVertexCount]
Initial value:
=
{
osg::Vec4f(0.f, 0.f, 1.f, 1.f),
osg::Vec4f(0.f, .05f, .95f, 1.f),
osg::Vec4f(0.f, .1f, .95f, 1.f),
osg::Vec4f(0.f, .15f, .95f, 1.f),
osg::Vec4f(0.f, .2f, .95f, 1.f),
osg::Vec4f(0.f, .25f, 9.f, 1.f)
}
const unsigned short SceneUtil::DiamondConnectorVertexCount = 4
const unsigned short SceneUtil::DiamondConnectorVertices[DiamondConnectorVertexCount]
Initial value:
=
{
1, 2, 3, 4
}
const osg::Vec4f SceneUtil::DiamondEdgeColor = osg::Vec4f(0.5f, 1.f, 1.f, 1.f)
const osg::Vec4f SceneUtil::DiamondFocusWireColor = osg::Vec4f(0.91f, 0.66f, 1.f, 1.f)
const float SceneUtil::DiamondHalfHeight = 40.f
const float SceneUtil::DiamondHalfWidth = 16.f
const unsigned short SceneUtil::DiamondIndexCount = 24
const unsigned short SceneUtil::DiamondIndices[DiamondIndexCount]
Initial value:
=
{
0, 2, 1,
0, 1, 3,
0, 3, 4,
0, 4, 2,
5, 1, 2,
5, 3, 1,
5, 4, 3,
5, 2, 4
}
const osg::Vec3f SceneUtil::DiamondPoints[DiamondVertexCount]
Initial value:
=
{
osg::Vec3f( 0.f, 0.f, DiamondHalfHeight * 2.f),
osg::Vec3f( 0.f, 0.f, 0.f)
}
const float DiamondHalfHeight
Definition: pathgridutil.hpp:14
const float DiamondHalfWidth
Definition: pathgridutil.hpp:15
const unsigned short SceneUtil::DiamondTotalVertexCount = DiamondVertexCount + DiamondConnectorVertexCount
const unsigned short SceneUtil::DiamondVertexCount = 6
const osg::Vec4f SceneUtil::DiamondWireColor = osg::Vec4f(0.72f, 0.f, 0.96f, 1.f)
const unsigned short SceneUtil::DiamondWireframeIndexCount = 24
const unsigned short SceneUtil::DiamondWireframeIndices[DiamondWireframeIndexCount]
Initial value:
=
{
0, 1,
0, 2,
0, 3,
0, 4,
1, 2,
2, 4,
4, 3,
3, 1,
5, 1,
5, 2,
5, 3,
5, 4
}
const float SceneUtil::DiamondWireframeScalar = 1.1f
int SceneUtil::sLightId = 0
static