Public Types | Public Member Functions | Protected Member Functions | Protected Attributes

IGameObject Class Reference

This reference page is linked to from the following overview topics: 3DXI Property Containers, 3DXI Node, 3DXI Objects, 3DXI Splines, 3DXI Modifiers.


Search for all occurrences

Detailed Description

Simple wrapper for 3ds Max objects.

This is heart of the interaction with 3ds Max objects. 3ds Max objects are converted to IGame objects to provide simpler interfaces. Specific support is given to Meshes, Splines, Helper (including bones) and Cameras. Any object that is not supported by IGame directly is supported as a generic object, so that properties can be extracted easily. At the present time IGame only supports Geom Objects that can be converted to a Tri Object.
A note about XRef items. IGame will search out XRef Objects and store them as IGameXrefObject. External file names and proxies can be accessed by casting IGameObject* to IGameXrefObject*
Some of the interfaces returned by IGameObject require that the nodes be parsed by IGame first.

See also:
IGameNode, IGameMesh, IGameLight, IGameCamera, IGameSupportObject
IExportEntity

#include <IGameObject.h>

Inheritance diagram for IGameObject:
Inheritance graph
[legend]

List of all members.

Public Types

enum   ObjectTypes {
  IGAME_UNKNOWN, IGAME_LIGHT, IGAME_MESH, IGAME_SPLINE,
  IGAME_CAMERA, IGAME_HELPER, IGAME_BONE, IGAME_IKCHAIN,
  IGAME_XREF
}
 

Various IGame Object types.

More...
enum   MaxType {
  IGAME_MAX_UNKNOWN, IGAME_MAX_GEOM, IGAME_MAX_SHAPE, IGAME_MAX_LIGHT,
  IGAME_MAX_CAMERA, IGAME_MAX_BONE, IGAME_MAX_HELPER
}
 

Various 3ds Max Object types.

More...

Public Member Functions

  IGameObject ()
  Default constructor.
IGAMEEXPORT void  GetBoundingBox (Box3 &bb)
  The bounding box of the object.
IGAMEEXPORT bool  IsRenderable ()
  Check if object renderable.
virtual ObjectTypes  GetIGameType ()=0
  The IGame object type.
IGAMEEXPORT Object GetMaxObject ()
  Access to the actual 3ds Max object.
IGAMEEXPORT MaxType  GetMaxType ()
  The 3ds Max object type.
IGAMEEXPORT int  GetNumModifiers ()
  The number of modifiers active on the object.
IGAMEEXPORT IGameModifier GetIGameModifier (int index)
  Access to IGame modifier.
IGAMEEXPORT  IGameObject (INode *node)
  The IGameObject constructor.
IGAMEEXPORT bool  CastShadows ()
  Check if Object casts shadows.
IGAMEEXPORT bool  IsObjectSkinned ()
  Check if object skinned.
IGAMEEXPORT IGameSkin GetIGameSkin ()
  Access to the Skin interface.
IGAMEEXPORT bool  IsObjectXRef ()
  Check if XRef object.
IGAMEEXPORT GMatrix  GetIGameObjectTM ()
  Access to the ObjectTM.
virtual bool  InitializeData ()
  Extract the 3ds Max data into IGame data.
virtual  ~IGameObject ()=0

Protected Member Functions

void  SetNode (INode *n)

Protected Attributes

INode gameNode
Object gameObject

Member Enumeration Documentation

Various IGame Object types.

These are the objects supported by IGame

Enumerator:
IGAME_UNKNOWN 

An unknown object.

IGAME_LIGHT 

A Light Object.

IGAME_MESH 

A Mesh Object.

IGAME_SPLINE 

A Spline Object.

IGAME_CAMERA 

A Camera Object.

IGAME_HELPER 

A Helper Object.

IGAME_BONE 

A Bone Object.

IGAME_IKCHAIN 

An IK Chain Object.

IGAME_XREF 

A XRef Object.

enum MaxType

Various 3ds Max Object types.

These are 3ds Max object - Developers can use this to cast the Object pointer to one of the relevent 3ds Max classes

Enumerator:
IGAME_MAX_UNKNOWN 

An unknown object.

IGAME_MAX_GEOM 

A Geom Object.

IGAME_MAX_SHAPE 

A Shape Object.

IGAME_MAX_LIGHT 

A Light Object.

IGAME_MAX_CAMERA 

A Camera Object.

IGAME_MAX_BONE 

A Bone Object.

IGAME_MAX_HELPER 

A Helper Object.


Constructor & Destructor Documentation

Default constructor.

IGAMEEXPORT IGameObject ( INode node )

The IGameObject constructor.

Parameters:
*node The 3ds Max node to initialise
virtual ~IGameObject ( ) [pure virtual]

Member Function Documentation

void SetNode ( INode n ) [protected]
IGAMEEXPORT void GetBoundingBox ( Box3 bb )

The bounding box of the object.

Parameters:
bb The Box3 to receive the value
IGAMEEXPORT bool IsRenderable ( )

Check if object renderable.

Returns:
TRUE if it is renderable
virtual ObjectTypes GetIGameType ( ) [pure virtual]

The IGame object type.

Return the Type of IGameObject it represents

Returns:
The object type. Returned value corresponds to IGameObject::ObjectTypes Enum
IGAMEEXPORT Object* GetMaxObject ( )

Access to the actual 3ds Max object.

Access to the actual 3ds Max object, if further direct access needed

Returns:
A pointer to a max Object class
IGAMEEXPORT MaxType GetMaxType ( )

The 3ds Max object type.

This lets the developer know what type of object - Light, Geom, Helper etc... This is different from the IGame types, as these may group more than one type of 3ds Max object together. The information can be used to cast Object returned from IGameObject::GetMaxObject to the appropriate class.

Returns:
The type of max object. This is defined as the IGameObject::MaxType enum
IGAMEEXPORT int GetNumModifiers ( )

The number of modifiers active on the object.

Returns:
The number of modifiers
IGAMEEXPORT IGameModifier* GetIGameModifier ( int  index )

Access to IGame modifier.

Get a pointer to the IGame representation of the modifier

Parameters:
index The index of the modifier to return
Returns:
A pointer to the IGameModifier
IGAMEEXPORT bool CastShadows ( )

Check if Object casts shadows.

Returns:
TRUE if object casts shadows
IGAMEEXPORT bool IsObjectSkinned ( )

Check if object skinned.

Is object skinned with either Physique of Skin

Returns:
TRUE if skinned
IGAMEEXPORT IGameSkin* GetIGameSkin ( )

Access to the Skin interface.

Returns:
A pointer to IGameSkin or NULL if not present
IGAMEEXPORT bool IsObjectXRef ( )

Check if XRef object.

Indentify XRef objects

Returns:
TRUE if it is an XRef Object
IGAMEEXPORT GMatrix GetIGameObjectTM ( )

Access to the ObjectTM.

Get the ObjectTM. This is the matrix needed to calculate world space

Returns:
A matrix containing the Object TM. Used to calculate world space.
virtual bool InitializeData ( ) [inline, virtual]

Extract the 3ds Max data into IGame data.

Some extraction processes are time and memory consuming. This method allows the developer to specify when they want the data to be converted - this prevents any unwanted data being converted. This is important for IGameMesh class - if you are just after parameter data, you don't want the whole vertex array being sorted. Calling this tells the object that you want the data be converted.

Returns:
It will return FALSE when data has not been converted, this object should not be exported. Usually this is due to a standin or in the case of a GeomObject, it can't be converted to a Tri Object.
{return false;}

Member Data Documentation

INode* gameNode [protected]
Object* gameObject [protected]

IGameObject IGameObject IGameObject IGameObject IGameObject IGameObject IGameObject IGameObject IGameObject IGameObject
IGameObject IGameObject IGameObject IGameObject IGameObject IGameObject IGameObject IGameObject IGameObject IGameObject