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  LightStateCache
 
class  LightStateAttribute
 
class  CollectLightCallback
 
class  LightManagerUpdateCallback
 
class  DisableLight
 
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  MorphGeometry
 Vertex morphing implementation. More...
 
class  CollectLowestTransformsVisitor
 
struct  LessGeometry
 
struct  LessGeometryPrimitiveType
 
class  MergeArrayVisitor
 
class  BaseOptimizerVisitor
 
class  Optimizer
 
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  RigGeometry
 Mesh skinning implementation. More...
 
class  PositionAttitudeTransformSerializer
 
class  SkeletonSerializer
 
class  RigGeometrySerializer
 
class  MorphGeometrySerializer
 
class  LightManagerSerializer
 
class  CameraRelativeTransformSerializer
 
class  GeometrySerializer
 
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  FindByClassVisitor
 
class  DisableFreezeOnCullVisitor
 
class  NodeMapVisitor
 Maps names to nodes. More...
 
class  RemoveVisitor
 Base class for visitors that remove nodes from a scene graph. Subclasses need to fill the mToRemove vector. To use, node->accept(removeVisitor); removeVisitor.remove();. More...
 
class  CleanObjectRootVisitor
 
class  RemoveTriBipVisitor
 
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

std::string getActorSkeleton (bool firstPerson, bool isFemale, bool isBeast, bool isWerewolf)
 
void mergeUserData (osg::UserDataContainer *source, osg::Object *target)
 
osg::ref_ptr< osg::Node > attach (osg::ref_ptr< osg::Node > toAttach, osg::Node *master, const std::string &filter, osg::Group *attachNode)
 
LightStateCachegetLightStateCache (unsigned int contextid)
 
LightManagerfindLightManager (const osg::NodePath &path)
 
template<class T >
void hash_combine (std::size_t &seed, const T &v)
 
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...
 
unsigned int getSize (const osg::Array *a)
 Shortcut to get size of an array, even if pointer is NULL. More...
 
bool isArrayCompatible (unsigned int numVertice1, unsigned int numVertice2, const osg::Array *compare1, const osg::Array *compare2)
 When merging geometries, tests if two arrays can be merged, regarding to their number of components, and the number of vertices. More...
 
bool isAbleToMerge (const osg::Geometry &g1, const osg::Geometry &g2)
 Return true only if both geometries have same array type and if arrays (such as TexCoords) are compatible (i.e. both empty or both filled) 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)
 
template<class Cls >
static osg::Object * createInstanceFunc ()
 
osgDB::ObjectWrapper * makeDummySerializer (const std::string &classname)
 
void registerSerializers ()
 Register osg node serializers for certain SceneUtil classes if not already done so. More...
 
void transformBoundingSphere (const osg::Matrixf &matrix, osg::BoundingSphere &bsphere)
 
osg::Vec4f colourFromRGB (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)
 
void writeScene (osg::Node *node, const std::string &filename, const std::string &format)
 

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::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,
osg::Group *  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:

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:

template<class Cls >
static osg::Object* SceneUtil::createInstanceFunc ( )
static
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:

std::string SceneUtil::getActorSkeleton ( bool  firstPerson,
bool  isFemale,
bool  isBeast,
bool  isWerewolf 
)

Here is the caller graph for this function:

LightStateCache* SceneUtil::getLightStateCache ( unsigned int  contextid)

Here is the caller graph for this function:

unsigned short SceneUtil::getPathgridNode ( unsigned short  vertexIndex)

Here is the caller graph for this function:

unsigned int SceneUtil::getSize ( const osg::Array *  a)
inline

Shortcut to get size of an array, even if pointer is NULL.

Here is the caller graph for this function:

template<class T >
void SceneUtil::hash_combine ( std::size_t &  seed,
const T v 
)
inline

Here is the caller graph for this function:

bool SceneUtil::isAbleToMerge ( const osg::Geometry &  g1,
const osg::Geometry &  g2 
)

Return true only if both geometries have same array type and if arrays (such as TexCoords) are compatible (i.e. both empty or both filled)

Here is the call graph for this function:

Here is the caller graph for this function:

bool SceneUtil::isArrayCompatible ( unsigned int  numVertice1,
unsigned int  numVertice2,
const osg::Array *  compare1,
const osg::Array *  compare2 
)

When merging geometries, tests if two arrays can be merged, regarding to their number of components, and the number of vertices.

Here is the call graph for this function:

Here is the caller graph for this function:

osgDB::ObjectWrapper* SceneUtil::makeDummySerializer ( const std::string &  classname)

Here is the caller graph for this function:

void SceneUtil::mergeUserData ( osg::UserDataContainer *  source,
osg::Object *  target 
)

Here is the caller graph for this function:

void SceneUtil::registerSerializers ( )

Register osg node serializers for certain SceneUtil classes if not already done so.

Here is the call graph for this function:

Here is the caller graph for this function:

bool SceneUtil::sortLights ( const LightManager::LightSourceViewBound *  left,
const LightManager::LightSourceViewBound *  right 
)

Here is the caller graph for this function:

void SceneUtil::transformBoundingSphere ( const osg::Matrixf &  matrix,
osg::BoundingSphere &  bsphere 
)

Here is the caller graph for this function:

void SceneUtil::writeScene ( osg::Node *  node,
const std::string &  filename,
const std::string &  format 
)

Here is the call graph for this function:

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