#include <glfxscene.h>
Inheritance diagram for GLFX::Scene::DefaultSceneBuilder:
Public Member Functions | |
bool | Initialize (EffectManager *fxMgr) |
bool | Finalize () |
int | CreateNode (const char *nodeName, int type) |
int | CreateMaterial (const char *materialName) |
int | CreateAnimation (const char *animName) |
void | SetNodeParentByName (int nodeId, const char *parentName) |
void | SetNodeTM (int nodeId, const float *tm) |
void | SetMeshParameters (int nodeId, GLenum primitiveType, unsigned long vertexCount, unsigned long indexCount, unsigned long primitiveGroupCount) |
bool | SetMeshVertexData (int nodeId, unsigned long type, unsigned long dim, const float *data) |
bool | SetMeshFaceIndices (int nodeId, const unsigned long *data) |
void | SetMeshPrimitiveGroup (int nodeId, unsigned long groupId, unsigned long start, unsigned long count) |
void | SetMeshMaterial (int nodeId, unsigned long groupId, int materialId) |
void | SetLightColor (int nodeId, const float *color) |
void | SetLightAttenuation (int nodeId, float attnStart, float attnEnd) |
void | SetCameraFieldOfViewX (int nodeId, float fovx) |
void | SetMaterialAmbientColor (int materialId, const float *color) |
void | SetMaterialDiffuseColor (int materialId, const float *color) |
void | SetMaterialSpecularColor (int materialId, const float *color) |
void | SetMaterialSpecularLevel (int materialId, float level) |
void | SetMaterialTransparency (int materialId, float transparency) |
void | SetMaterialDiffuseMap (int materialId, const char *name) |
void | SetMaterialGlossMap (int materialId, const char *name) |
void | SetMaterialGlowMap (int materialId, const char *name) |
void | SetMaterialBumpMap (int materialId, const char *name) |
void | SetAnimationParameters (int animId, float startTime, float frequency, unsigned long frameCount) |
void | SetAnimationNodeKeyframes (int animId, int nodeId, unsigned long type, float *data) |
EffectManager * | GetEffectManager () |
Node * | GetRootNode () |
AnimationSet * | GetAnimationSet () |
Protected Member Functions | |
virtual Node * | AllocNode (int type) |
virtual void | DeleteNode (Node *node) |
virtual IMesh * | CreateMesh (GLenum primitiveType, unsigned long vertexCount, unsigned long indexCount, unsigned long primitiveGroupCount) |
virtual bool | IsMeshNode (Node *node) |
virtual bool | IsLightNode (Node *node) |
virtual bool | IsCameraNode (Node *node) |
virtual Material * | AllocMaterial () |
virtual Animation * | AllocAnimation () |
virtual void | DeleteAnimation (Animation *anim) |
virtual AnimationSet * | AllocAnimationSet () |
virtual void | DeleteAnimationSet (AnimationSet *animSet) |
Classes | |
struct | NodeAnim |
struct | NodeInfo |
bool GLFX::Scene::DefaultSceneBuilder::Initialize | ( | EffectManager * | fxMgr | ) | [virtual] |
Initialize scene builder.
fxMgr | pointer to EffectManager |
Implements GLFX::ISceneBuilder.
bool GLFX::Scene::DefaultSceneBuilder::Finalize | ( | ) | [virtual] |
Finalize scene building.
After this method finishes the scene should be returned to user by some custom method.
Implements GLFX::ISceneBuilder.
int GLFX::Scene::DefaultSceneBuilder::CreateNode | ( | const char * | nodeName, | |
int | type | |||
) | [virtual] |
Create a node.
nodeName | name of node | |
type | node type, on of: NODE_SIMPLE, NODE_STATIC_MESH, NODE_LIGHT NODE_CAMERA |
Implements GLFX::ISceneBuilder.
int GLFX::Scene::DefaultSceneBuilder::CreateMaterial | ( | const char * | materialName | ) | [virtual] |
Create a material.
materialName | name of material |
Implements GLFX::ISceneBuilder.
int GLFX::Scene::DefaultSceneBuilder::CreateAnimation | ( | const char * | animName | ) | [virtual] |
Create named animation.
animName | name of animation |
Implements GLFX::ISceneBuilder.
void GLFX::Scene::DefaultSceneBuilder::SetNodeParentByName | ( | int | nodeId, | |
const char * | parentName | |||
) | [virtual] |
Sets node parent.
This method is used to refer to parent by name. This is useful, when the input file doesn't require a parent node to be defined before it's children.
nodeId | node id | |
parentName | name of parent node |
Implements GLFX::ISceneBuilder.
void GLFX::Scene::DefaultSceneBuilder::SetNodeTM | ( | int | nodeId, | |
const float * | tm | |||
) | [virtual] |
Sets node transform matrix.
nodeId | node id | |
tm | 16 float values representing rows of a 4x4 matrix. |
Implements GLFX::ISceneBuilder.
void GLFX::Scene::DefaultSceneBuilder::SetMeshParameters | ( | int | nodeId, | |
GLenum | primitiveType, | |||
unsigned long | vertexCount, | |||
unsigned long | indexCount, | |||
unsigned long | primitiveGroupCount | |||
) | [virtual] |
Sets mesh parameters: vertex, index and primitve group count.
nodeId | node id | |
primitiveType | OpenGL primitive type, like GL_TRIANGLES. | |
vertexCount | number of vertices | |
indexCount | number of indices | |
primitiveGroupCount | number of primitive groups |
Implements GLFX::ISceneBuilder.
bool GLFX::Scene::DefaultSceneBuilder::SetMeshVertexData | ( | int | nodeId, | |
unsigned long | type, | |||
unsigned long | dim, | |||
const float * | data | |||
) | [virtual] |
Sets mesh vertex data.
nodeId | node id | |
type | data type, one of: VERT_POSITION, VERT_NORMAL, VERT_COLOR, VERT_TEXTURE0, VERT_TEXTURE1, VERT_TEXTURE2, VERT_TEXTURE3, VERT_TEXTURE4, VERT_TEXTURE5, VERT_TEXTURE6, VERT_TEXTURE7. Note that not all types may be supported by a given implementation. In such case this method will return false. However this is not an error. | |
dim | data dimension | |
data | pointer to data |
Implements GLFX::ISceneBuilder.
bool GLFX::Scene::DefaultSceneBuilder::SetMeshFaceIndices | ( | int | nodeId, | |
const unsigned long * | data | |||
) | [virtual] |
Sets mesh index data.
nodeId | node id | |
data | vertex to indices |
Implements GLFX::ISceneBuilder.
void GLFX::Scene::DefaultSceneBuilder::SetMeshPrimitiveGroup | ( | int | nodeId, | |
unsigned long | groupId, | |||
unsigned long | start, | |||
unsigned long | count | |||
) | [virtual] |
Sets primitive group parameters.
nodeId | node id | |
groupId | number of primitive group to be modified | |
start | first element of this group | |
count | number of elements in this group |
Implements GLFX::ISceneBuilder.
void GLFX::Scene::DefaultSceneBuilder::SetMeshMaterial | ( | int | nodeId, | |
unsigned long | groupId, | |||
int | materialId | |||
) | [virtual] |
Sets mesh material.
nodeId | node id | |
groupId | primitive group id | |
materialId | material id |
Implements GLFX::ISceneBuilder.
void GLFX::Scene::DefaultSceneBuilder::SetLightColor | ( | int | nodeId, | |
const float * | color | |||
) | [virtual] |
Sets node light color.
nodeId | node id | |
color | 4-float light color value (red, green, blue and alpha) |
Implements GLFX::ISceneBuilder.
void GLFX::Scene::DefaultSceneBuilder::SetLightAttenuation | ( | int | nodeId, | |
float | attnStart, | |||
float | attnEnd | |||
) | [virtual] |
Sets light attenuation distance.
nodeId | light node id | |
attnStart | near attenuation distance. If this value is 0 near attenuation is disabled. | |
attnEnd | far attenuation distance. If this value is 0 far attenuation is disabled. |
Implements GLFX::ISceneBuilder.
void GLFX::Scene::DefaultSceneBuilder::SetCameraFieldOfViewX | ( | int | nodeId, | |
float | fovx | |||
) | [virtual] |
Sets camera horizontal field of view.
nodeId | node id | |
fovx | field-of-view in degrees |
Implements GLFX::ISceneBuilder.
void GLFX::Scene::DefaultSceneBuilder::SetMaterialAmbientColor | ( | int | materialId, | |
const float * | color | |||
) | [virtual] |
Sets material amibent color.
materialId | material id | |
color | 4-float color value (red, green, blue and alpha) |
Implements GLFX::ISceneBuilder.
void GLFX::Scene::DefaultSceneBuilder::SetMaterialDiffuseColor | ( | int | materialId, | |
const float * | color | |||
) | [virtual] |
Sets material diffuse color.
materialId | material id | |
color | 4-float color value (red, green, blue and alpha) |
Implements GLFX::ISceneBuilder.
void GLFX::Scene::DefaultSceneBuilder::SetMaterialSpecularColor | ( | int | materialId, | |
const float * | color | |||
) | [virtual] |
Sets material specular color.
materialId | material id | |
color | 4-float color value (red, green, blue and alpha) |
Implements GLFX::ISceneBuilder.
void GLFX::Scene::DefaultSceneBuilder::SetMaterialSpecularLevel | ( | int | materialId, | |
float | level | |||
) | [virtual] |
Sets material specular level (exponent).
materialId | material id | |
level | specular level |
Implements GLFX::ISceneBuilder.
void GLFX::Scene::DefaultSceneBuilder::SetMaterialTransparency | ( | int | materialId, | |
float | transparency | |||
) | [virtual] |
Sets material transparency.
materialId | material id | |
transparency | transparency level: set to 0 for totally opaque materials, 1 totally transprent or any value in between |
Implements GLFX::ISceneBuilder.
void GLFX::Scene::DefaultSceneBuilder::SetMaterialDiffuseMap | ( | int | materialId, | |
const char * | name | |||
) | [virtual] |
Sets material diffuse texture.
materialId | material id | |
name | texture file name |
Implements GLFX::ISceneBuilder.
void GLFX::Scene::DefaultSceneBuilder::SetMaterialGlossMap | ( | int | materialId, | |
const char * | name | |||
) | [virtual] |
Sets material gloss (specular) texture.
materialId | material id | |
name | texture file name |
Implements GLFX::ISceneBuilder.
void GLFX::Scene::DefaultSceneBuilder::SetMaterialGlowMap | ( | int | materialId, | |
const char * | name | |||
) | [virtual] |
Sets material glow (self-illumination) texture.
materialId | material id | |
name | texture file name |
Implements GLFX::ISceneBuilder.
void GLFX::Scene::DefaultSceneBuilder::SetMaterialBumpMap | ( | int | materialId, | |
const char * | name | |||
) | [virtual] |
Sets material bump (normal) texture.
materialId | material id | |
name | texture file name |
Implements GLFX::ISceneBuilder.
void GLFX::Scene::DefaultSceneBuilder::SetAnimationParameters | ( | int | animId, | |
float | startTime, | |||
float | frequency, | |||
unsigned long | frameCount | |||
) | [virtual] |
Sets animation parameters.
animId | animation id | |
startTime | time of first frame (in seconds) | |
frequency | frame rate (in 1/second) | |
frameCount | number of frames in animation |
Implements GLFX::ISceneBuilder.
void GLFX::Scene::DefaultSceneBuilder::SetAnimationNodeKeyframes | ( | int | animId, | |
int | nodeId, | |||
unsigned long | type, | |||
float * | data | |||
) | [virtual] |
Sets node animation track.
animId | animation id | |
nodeId | node id of animated node | |
type | track type, one of ANIM_POSITION, ANIM_ROTATION or ANIM_SCALE. | |
data | animation track data. Array of n-dimensional tuples of floats where n is 3 (ANIM_POSITION, ANIM_SCALE) or 4 (ANIM_ROTATION). Number of tuples is equal to frame number. Each tuple specifies transformation for a single frame. |
Implements GLFX::ISceneBuilder.
EffectManager* GLFX::Scene::DefaultSceneBuilder::GetEffectManager | ( | ) |
Node* GLFX::Scene::DefaultSceneBuilder::GetRootNode | ( | ) |
Gets created scene.
AnimationSet* GLFX::Scene::DefaultSceneBuilder::GetAnimationSet | ( | ) |
Gets created animation set.
virtual Node* GLFX::Scene::DefaultSceneBuilder::AllocNode | ( | int | type | ) | [inline, protected, virtual] |
Create a node of given type.
This method may be overriden to provide custom nodes.
type | node type |
virtual void GLFX::Scene::DefaultSceneBuilder::DeleteNode | ( | Node * | node | ) | [inline, protected, virtual] |
Delete node.
node | node to be deleted |
virtual IMesh* GLFX::Scene::DefaultSceneBuilder::CreateMesh | ( | GLenum | primitiveType, | |
unsigned long | vertexCount, | |||
unsigned long | indexCount, | |||
unsigned long | primitiveGroupCount | |||
) | [protected, virtual] |
Create mesh.
This method may be overriden to provide custom mesh.
primitiveType | OpenGL primitive type | |
vertexCount | number of vertices | |
indexCount | number of indices | |
primitiveGroupCount | number of groups of primitives |
virtual bool GLFX::Scene::DefaultSceneBuilder::IsMeshNode | ( | Node * | node | ) | [protected, virtual] |
Check if given node is mesh node.
virtual bool GLFX::Scene::DefaultSceneBuilder::IsLightNode | ( | Node * | node | ) | [protected, virtual] |
Check if given node is light node.
virtual bool GLFX::Scene::DefaultSceneBuilder::IsCameraNode | ( | Node * | node | ) | [protected, virtual] |
Check if given node is camera node.
virtual Material* GLFX::Scene::DefaultSceneBuilder::AllocMaterial | ( | ) | [inline, protected, virtual] |
Allocate material.
This method may be overriden to provide custom materials.
virtual Animation* GLFX::Scene::DefaultSceneBuilder::AllocAnimation | ( | ) | [inline, protected, virtual] |
Allocate animation.
This method may be overriden to provide custom animation.
virtual void GLFX::Scene::DefaultSceneBuilder::DeleteAnimation | ( | Animation * | anim | ) | [inline, protected, virtual] |
Delete animation.
anim | animation to be deleted. |
virtual AnimationSet* GLFX::Scene::DefaultSceneBuilder::AllocAnimationSet | ( | ) | [inline, protected, virtual] |
Allocate animation set.
This method may be overriden to provide custom animation set type.
virtual void GLFX::Scene::DefaultSceneBuilder::DeleteAnimationSet | ( | AnimationSet * | animSet | ) | [inline, protected, virtual] |
Delete animation set.
animSet | animation set to be deleted. |