Public Member Functions

IGameScene Class Reference

This reference page is linked to from the following overview topics: 3DXI Initialization, 3DXI Scene, 3DXI Node.


Search for all occurrences

Detailed Description

Main scene access.

IGameScene is the main entry point for an exporter. It contains the initialisation routines and access to the nodes and materials of the scene. The user can ask IGame to enumerate the whole scene, selected nodes or single nodes, with or with out hierarchy.

#include <IGame.h>

Inheritance diagram for IGameScene:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual  ~IGameScene ()
  Destructor.
virtual void  SetPropertyFile (const MCHAR *fileName)=0
  Set the Property File to use.
virtual bool  InitialiseIGame (bool selected=false)=0
  Initialise IGame.
virtual bool  InitialiseIGame (INode *root, bool Hierarchy=true)=0
  Initialise IGame with a specific node.
virtual bool  InitialiseIGame (Tab< INode * > nodes, bool Hierarchy=true)=0
  Initialise IGame with a specific set of nodes.
virtual MCHAR *  GetSceneFileName ()=0
  Get the active filename.
virtual void  SetStaticFrame (int frameNum)=0
  Set the static frame.
virtual TimeValue  GetSceneStartTime ()=0
  Get the start of the animation range.
virtual TimeValue  GetSceneEndTime ()=0
  Get the end of the animation range.
virtual int  GetSceneTicks ()=0
  Get the number of ticks per frame.
virtual int  GetTopLevelNodeCount ()=0
  All node access is provides by parent nodes.
virtual int  GetTotalNodeCount ()=0
  Get the complete number of nodes.
virtual IGameNode GetTopLevelNode (int index)=0
  Get the actual toplevel node.
virtual int  GetRootMaterialCount ()=0
  Get the total number of parent materials.
virtual IGameMaterial GetRootMaterial (int index)=0
  Access to the Root Material.
virtual IGameNode GetIGameNode (INode *node)=0
  Access the IGameNode from the supplied INode.
virtual IGameNode GetIGameNode (ULONG NodeID)=0
  Access the IGameNode from the supplied Node ID.
virtual Tab< IGameNode * >  GetIGameNodeByType (IGameObject::ObjectTypes Type)=0
  Access the set IGameNodes from the specified IGame Type.
virtual IGameMaterial GetIGameMaterial (Mtl *mat)=0
  Access the IGameMaterial from the supplied Mtl.
virtual IGameTextureMap GetIGameTextureMap (Texmap *texMap)=0
  Access the IGameTextureMap from the supplied Texmap.
virtual void  ReleaseIGame ()=0
  Releases IGame and free all associated memory.

Constructor & Destructor Documentation

virtual ~IGameScene ( ) [inline, virtual]

Destructor.

{;}

Member Function Documentation

virtual void SetPropertyFile ( const MCHAR *  fileName ) [pure virtual]

Set the Property File to use.

You can define the name of the file to use, including full path, that IGame uses to parse for the supported parameters. This means that you could have multiple configs depending on the various games in development. You must call this before you call InitialiseIGame(). By default the the filename will be the maxroot/plugcfg/IGameProp.XML.

Parameters:
fileName The name of the property file to use inthis session.
virtual bool InitialiseIGame ( bool  selected = false ) [pure virtual]

Initialise IGame.

IGame can be initialised specifying whether to search for selected nodes only

Parameters:
selected True if selected are searched for - default false
Returns:
True if the scene was enumerated - A Possible reason for failure is that the Parameter IGameProp.XML file was not found or not parsed correctly
virtual bool InitialiseIGame ( INode root,
bool  Hierarchy = true 
) [pure virtual]

Initialise IGame with a specific node.

Developer can specify a single node to parse.

Parameters:
root The actual node to parse
Hierarchy lets IGame know to initialise the children of the node
Returns:
True if the scene was enumerated - A Possible reason for failure is that the Parameter IGameProp.XML file was not found or parsed correctly
virtual bool InitialiseIGame ( Tab< INode * >  nodes,
bool  Hierarchy = true 
) [pure virtual]

Initialise IGame with a specific set of nodes.

Developer can specify a set of nodes to parse. This could be implemented by creating a Tab using the 3ds Max sdk. Look at Interface::GetSelNodes() and Interface::GetSelNodeCount().

Parameters:
nodes The actual tab containing the nodes to parse
Hierarchy lets IGame know to initialise the children of the node
Returns:
True if the scene was enumerated - A Possible reason for failure is that the Parameter IGameProp.XML file was not found or parsed correctly
virtual MCHAR* GetSceneFileName ( ) [pure virtual]

Get the active filename.

Returns:
The current filename
virtual void SetStaticFrame ( int  frameNum ) [pure virtual]

Set the static frame.

Specify the frame to use for Time access functions

Parameters:
frameNum The static frame to use - Internally this will be converted to Ticks
virtual TimeValue GetSceneStartTime ( ) [pure virtual]

Get the start of the animation range.

This provides the animation start time in ticks

Returns:
The start time in ticks
virtual TimeValue GetSceneEndTime ( ) [pure virtual]

Get the end of the animation range.

This provides the animation end time in ticks

Returns:
The end time in ticks
virtual int GetSceneTicks ( ) [pure virtual]

Get the number of ticks per frame.

Returns:
The number of ticks per frame
virtual int GetTopLevelNodeCount ( ) [pure virtual]

All node access is provides by parent nodes.

This does not include the Root node as in 3ds Max. This method can be used to traverse the scene

Returns:
The number of parent nodes
virtual int GetTotalNodeCount ( ) [pure virtual]

Get the complete number of nodes.

The is useful for implementing a progress bar in the exporter

Returns:
The total node count
virtual IGameNode* GetTopLevelNode ( int  index ) [pure virtual]

Get the actual toplevel node.

A Top level node is a node at the top of the Hierarchy, i.e it has no Parent.

Parameters:
index The index into the the toplevel parent list
Returns:
A pointer to a IGameNode
See also:
IGameNode
virtual int GetRootMaterialCount ( ) [pure virtual]

Get the total number of parent materials.

This does not include sub materials - just the number of actual material containers

Returns:
The total number of parent materials
virtual IGameMaterial* GetRootMaterial ( int  index ) [pure virtual]

Access to the Root Material.

This is the parent material that is stored on the Node. The material will host any sub materials and access is provided by the IGameMaterial interface.

Parameters:
index The root material to access
Returns:
A Pointer to an IGameMaterial
See also:
IGameMaterial
virtual IGameNode* GetIGameNode ( INode node ) [pure virtual]

Access the IGameNode from the supplied INode.

Some IGame methods provide access to INode lists. You can use this method to retrieve the IGameNode equivelent IGame must be initialised first, as the node must be in the Database

Parameters:
node The 3ds Max node to find
Returns:
A pointer to IGameNode, NULL if not found
virtual IGameNode* GetIGameNode ( ULONG  NodeID ) [pure virtual]

Access the IGameNode from the supplied Node ID.

You can use this method to retrieve the IGameNode based on a Node ID IGame must be initialised first, as the node must be in the Database

Parameters:
NodeID The Node ID to find
Returns:
A pointer to IGameNode, or NULL if not found
virtual Tab<IGameNode*> GetIGameNodeByType ( IGameObject::ObjectTypes  Type ) [pure virtual]

Access the set IGameNodes from the specified IGame Type.

You can use this method to retrieve the IGameNode based on IGameObject::ObjectTypes. IGame must be initialised first, as the node must be in the Database

Parameters:
Type The IGameObject::ObjectTypes to find
Returns:
A Tab of IGameNodes. The developer should check the Count() method to see if any were found
virtual IGameMaterial* GetIGameMaterial ( Mtl mat ) [pure virtual]

Access the IGameMaterial from the supplied Mtl.

You can use this method to retrieve the IGameMaterial equivelent IGame must be initialised first, Material doesn't have to be part of database

Parameters:
mat The 3ds Max Material
Returns:
A pointer to IGameMaterial
virtual IGameTextureMap* GetIGameTextureMap ( Texmap texMap ) [pure virtual]

Access the IGameTextureMap from the supplied Texmap.

You can use this method to retrieve the IGameTextureMap equivelent IGame must be initialised first, Texture doesn't have to be part of database

Parameters:
texMap The 3ds Max Texture Map
Returns:
A pointer to IGameTextureMap
virtual void ReleaseIGame ( ) [pure virtual]

Releases IGame and free all associated memory.

This must be called after you have finished with IGame. It makes sure all data is freed and general clean up is performed. Without calling this there is the risk of corrupting memory, and causing incorrect data to returned the next time IGame is run


IGameScene IGameScene IGameScene IGameScene IGameScene IGameScene IGameScene IGameScene IGameScene IGameScene
IGameScene IGameScene IGameScene IGameScene IGameScene IGameScene IGameScene IGameScene IGameScene IGameScene