#include <sceneserver.h>
Inheritance diagram for oxygen::SceneServer:
Public Member Functions | |
SceneServer () | |
~SceneServer () | |
boost::shared_ptr< Scene > | CreateScene (const std::string &location) |
creates a new scene hierarchy at a specific location, new hierarchy is also made current | |
bool | SetActiveScene (const std::string &location) |
sets the active scene | |
boost::shared_ptr< Scene > | GetActiveScene () |
returns a reference to the current active scene | |
void | Update (float deltaTime) |
updates the state of the current active scene (deltaTime is in seconds) | |
bool | ImportScene (const std::string &fileName, boost::shared_ptr< BaseNode > root, boost::shared_ptr< zeitgeist::ParameterList > parameter) |
imports a scene from a file below the given BaseNode | |
bool | InitSceneImporter (const std::string &importerName) |
creates an instance of | |
Static Public Member Functions | |
static int | GetTransformMark () |
returns the current label for modified transform nodes | |
Protected Member Functions | |
void | UpdateCache () |
gets missing references | |
void | ResetCache () |
resets all cached references | |
virtual void | OnUnlink () |
resets all cached references | |
void | ReparentTransformChildren (boost::shared_ptr< Transform > node) |
reparents all children of node to the parent of node; Their local transform matrix is multiplied with the local transform matrix of node | |
void | RemoveTransformPaths (boost::shared_ptr< zeitgeist::Leaf > root) |
recursively reparents all transform nodes whose only children are also transform node | |
Private Attributes | |
boost::shared_ptr< Scene > | mActiveScene |
the current active scene | |
boost::shared_ptr< Space > | mActiveSpace |
cached reference to the Space node below the active scene | |
boost::shared_ptr< World > | mActiveWorld |
cached reference to the World node below the active scene | |
Static Private Attributes | |
static int | mTransformMark = 0 |
modified transform nodes are labeled with this value, the value is incremented each cycle to avoid a resetting |
Each subtree begins with a Scene node. The scene server knows which scene node is currently active and updates that node (and its corresponding subtree).
Definition at line 57 of file sceneserver.h.
|
Definition at line 43 of file sceneserver.cpp. |
|
Definition at line 47 of file sceneserver.cpp. |
|
creates a new scene hierarchy at a specific location, new hierarchy is also made current
Definition at line 51 of file sceneserver.cpp. References zeitgeist::Object::GetCore(), mActiveScene, and ResetCache(). Here is the call graph for this function: ![]() |
|
returns a reference to the current active scene
Definition at line 74 of file sceneserver.h. |
|
returns the current label for modified transform nodes
Definition at line 117 of file sceneserver.cpp. References mTransformMark. Referenced by oxygen::Transform::SetLocalPos(), oxygen::Transform::SetLocalRotation(), oxygen::Transform::SetLocalTransform(), and oxygen::Transform::SetWorldTransform(). |
|
imports a scene from a file below the given BaseNode
|
|
creates an instance of
Definition at line 328 of file sceneserver.cpp. References zeitgeist::Node::AddChildReference(), zeitgeist::Object::GetCore(), and zeitgeist::Object::GetLog(). Here is the call graph for this function: ![]() |
|
resets all cached references
Reimplemented from zeitgeist::Leaf. Definition at line 112 of file sceneserver.cpp. References ResetCache(). Here is the call graph for this function: ![]() |
|
recursively reparents all transform nodes whose only children are also transform node
|
|
reparents all children of node to the parent of node; Their local transform matrix is multiplied with the local transform matrix of node
|
|
resets all cached references
Definition at line 82 of file sceneserver.cpp. References mActiveScene, mActiveSpace, and mActiveWorld. Referenced by CreateScene(), OnUnlink(), SetActiveScene(), and UpdateCache(). |
|
sets the active scene
Definition at line 67 of file sceneserver.cpp. References zeitgeist::Object::GetCore(), mActiveScene, and ResetCache(). Here is the call graph for this function: ![]() |
|
updates the state of the current active scene (deltaTime is in seconds) We do not make the distinction between 'controllers' and 'scene graph nodes'. This design forces us to perform several update passes through the hierarchy. Nevertheless, the more homogenuous structure is worth it. An example Hierarchy: scene |- transform |- body | |- quakecontroller | |- camera The following passes are performed: 1st pass: PrePhysicsUpdate(deltaTime) The first update pass is responsible for updating the internal state of an object. For example, the quakecontroller has received input from the main application in terms of state changes like StrafeLeft, or Forward. As the controller is physics driven, it has to translate these commands to actual forces, which act on the body. This is done during this pass. After the first pass pyhsics simulation and collision are calculated using ODE. 2nd pass: PostPhysicsUpdate() This pass can be used to affect other nodes. For example, 'Body' has undergone physics simulation and collision detection. It has reached its final 'simulated' position, which has to be passed to the parent Transform node. 3rd pass: UpdateHierarchy() As the second pass affects the position of objects, we have to recalculate the transformation hierarchy before we can display the scene. Definition at line 160 of file sceneserver.cpp. References mActiveScene, mActiveSpace, mActiveWorld, mTransformMark, and UpdateCache(). Here is the call graph for this function: ![]() |
|
gets missing references
Definition at line 89 of file sceneserver.cpp. References mActiveScene, mActiveSpace, mActiveWorld, and ResetCache(). Referenced by Update(). Here is the call graph for this function: ![]() |
|
the current active scene
Definition at line 120 of file sceneserver.h. Referenced by CreateScene(), ResetCache(), SetActiveScene(), Update(), and UpdateCache(). |
|
cached reference to the Space node below the active scene
Definition at line 123 of file sceneserver.h. Referenced by ResetCache(), Update(), and UpdateCache(). |
|
cached reference to the World node below the active scene
Definition at line 126 of file sceneserver.h. Referenced by ResetCache(), Update(), and UpdateCache(). |
|
modified transform nodes are labeled with this value, the value is incremented each cycle to avoid a resetting
Definition at line 131 of file sceneserver.h. Referenced by GetTransformMark(), and Update(). |