GLFX::Scene::DefaultSceneBuilder Class Reference

#include <glfxscene.h>

Inheritance diagram for GLFX::Scene::DefaultSceneBuilder:

GLFX::ISceneBuilder List of all members.

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)
EffectManagerGetEffectManager ()
NodeGetRootNode ()
AnimationSetGetAnimationSet ()

Protected Member Functions

virtual NodeAllocNode (int type)
virtual void DeleteNode (Node *node)
virtual IMeshCreateMesh (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 MaterialAllocMaterial ()
virtual AnimationAllocAnimation ()
virtual void DeleteAnimation (Animation *anim)
virtual AnimationSetAllocAnimationSet ()
virtual void DeleteAnimationSet (AnimationSet *animSet)

Classes

struct  NodeAnim
struct  NodeInfo

Member Function Documentation

bool GLFX::Scene::DefaultSceneBuilder::Initialize ( EffectManager fxMgr  )  [virtual]

Initialize scene builder.

Parameters:
fxMgr pointer to EffectManager
Returns:
true if successful

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.

Returns:
true if successful

Implements GLFX::ISceneBuilder.

int GLFX::Scene::DefaultSceneBuilder::CreateNode ( const char *  nodeName,
int  type 
) [virtual]

Create a node.

Parameters:
nodeName name of node
type node type, on of: NODE_SIMPLE, NODE_STATIC_MESH, NODE_LIGHT NODE_CAMERA
Returns:
node identifier. -1 is returned on error. The node id is used in subsequent methods to refer to this node.

Implements GLFX::ISceneBuilder.

int GLFX::Scene::DefaultSceneBuilder::CreateMaterial ( const char *  materialName  )  [virtual]

Create a material.

Parameters:
materialName name of material
Returns:
material identifier. -1 is returned on error. The material id is used in subsequent methods to refer to this material.

Implements GLFX::ISceneBuilder.

int GLFX::Scene::DefaultSceneBuilder::CreateAnimation ( const char *  animName  )  [virtual]

Create named animation.

Parameters:
animName name of animation
Returns:
animation id

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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
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
Returns:
true if successful. This method returns false if the specified vertex data cannot be added. However this does not indicate an error, ISceneBuilder will continue undisturbed.

Implements GLFX::ISceneBuilder.

bool GLFX::Scene::DefaultSceneBuilder::SetMeshFaceIndices ( int  nodeId,
const unsigned long *  data 
) [virtual]

Sets mesh index data.

Parameters:
nodeId node id
data vertex to indices
Returns:
false if index buffer is not supported.

Implements GLFX::ISceneBuilder.

void GLFX::Scene::DefaultSceneBuilder::SetMeshPrimitiveGroup ( int  nodeId,
unsigned long  groupId,
unsigned long  start,
unsigned long  count 
) [virtual]

Sets primitive group parameters.

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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
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).

Parameters:
materialId material id
level specular level

Implements GLFX::ISceneBuilder.

void GLFX::Scene::DefaultSceneBuilder::SetMaterialTransparency ( int  materialId,
float  transparency 
) [virtual]

Sets material transparency.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

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.

Parameters:
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 (  ) 

Gets EffectManager.

Returns:
effect manager

Node* GLFX::Scene::DefaultSceneBuilder::GetRootNode (  ) 

Gets created scene.

Returns:
scene root

AnimationSet* GLFX::Scene::DefaultSceneBuilder::GetAnimationSet (  ) 

Gets created animation set.

Returns:
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.

Parameters:
type node type
Returns:
node

virtual void GLFX::Scene::DefaultSceneBuilder::DeleteNode ( Node node  )  [inline, protected, virtual]

Delete node.

Parameters:
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.

Parameters:
primitiveType OpenGL primitive type
vertexCount number of vertices
indexCount number of indices
primitiveGroupCount number of groups of primitives
Returns:
mesh

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.

Returns:
material

virtual Animation* GLFX::Scene::DefaultSceneBuilder::AllocAnimation (  )  [inline, protected, virtual]

Allocate animation.

This method may be overriden to provide custom animation.

Returns:
animation

virtual void GLFX::Scene::DefaultSceneBuilder::DeleteAnimation ( Animation anim  )  [inline, protected, virtual]

Delete animation.

Parameters:
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.

Returns:
animation set

virtual void GLFX::Scene::DefaultSceneBuilder::DeleteAnimationSet ( AnimationSet animSet  )  [inline, protected, virtual]

Delete animation set.

Parameters:
animSet animation set to be deleted.


The documentation for this class was generated from the following file:
SourceForge.net Logo