3ds Max C++ API Reference
IGameObject Class Referenceabstract

Simple wrapper for 3ds Max objects. More...

#include <IGameObject.h>

+ Inheritance diagram for IGameObject:

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. More...
 
IGAMEEXPORT void GetBoundingBox (Box3 &bb)
 The bounding box of the object. More...
 
IGAMEEXPORT bool IsRenderable ()
 Check if object renderable. More...
 
virtual ObjectTypes GetIGameType ()=0
 The IGame object type. More...
 
IGAMEEXPORT ObjectGetMaxObject ()
 Access to the actual 3ds Max object. More...
 
IGAMEEXPORT MaxType GetMaxType ()
 The 3ds Max object type. More...
 
IGAMEEXPORT int GetNumModifiers ()
 The number of modifiers active on the object. More...
 
IGAMEEXPORT IGameModifierGetIGameModifier (int index)
 Access to IGame modifier. More...
 
IGAMEEXPORT IGameObject (INode *node)
 The IGameObject constructor. More...
 
IGAMEEXPORT bool CastShadows ()
 Check if Object casts shadows. More...
 
IGAMEEXPORT bool IsObjectSkinned ()
 Check if object skinned. More...
 
IGAMEEXPORT IGameSkinGetIGameSkin ()
 Access to the Skin interface. More...
 
IGAMEEXPORT bool IsObjectXRef ()
 Check if XRef object. More...
 
IGAMEEXPORT GMatrix GetIGameObjectTM ()
 Access to the ObjectTM. More...
 
virtual bool InitializeData ()
 Extract the 3ds Max data into IGame data. More...
 
virtual ~IGameObject ()=0
 
- Public Member Functions inherited from IExportEntity
virtual ~IExportEntity ()
 Destructor. More...
 
virtual IPropertyContainerGetIPropertyContainer ()
 Retrieve the Property Container. More...
 
virtual bool IsEntitySupported ()
 Is the Entity directly supported. More...
 
virtual const MCHARGetClassName ()=0
 Retrieves the name of the entity class. More...
 

Protected Member Functions

void SetNode (INode *n)
 

Protected Attributes

INodegameNode
 
ObjectgameObject
 

Additional Inherited Members

- Static Public Member Functions inherited from MaxHeapOperators
static UtilExport voidoperator new (size_t size)
 Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e)
 Standard new operator used to allocate objects if there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate objects that takes the type of memory, filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport void operator delete (void *ptr)
 Standard delete operator used to deallocate an object If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an object If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an object that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator. More...
 
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator. More...
 
static UtilExport voidaligned_malloc (size_t size, size_t alignment)
 Allocates memory on a specified alignment boundary. More...
 
static UtilExport voidaligned_realloc (void *ptr, size_t size, size_t alignment)
 Reallocates memory on a specified alignment boundary. More...
 
static UtilExport void aligned_free (void *ptr)
 Frees a block of memory that was allocated with aligned_malloc/aligned_realloc. More...
 

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

Member Enumeration Documentation

◆ ObjectTypes

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.

66  {
68  IGAME_LIGHT,
69  IGAME_MESH,
70  IGAME_SPLINE,
71  IGAME_CAMERA,
72  IGAME_HELPER,
73  IGAME_BONE,
75  IGAME_XREF
76  };
@ IGAME_UNKNOWN
An unknown object.
Definition: IGameObject.h:67
@ IGAME_LIGHT
A Light Object.
Definition: IGameObject.h:68
@ IGAME_HELPER
A Helper Object.
Definition: IGameObject.h:72
@ IGAME_CAMERA
A Camera Object.
Definition: IGameObject.h:71
@ IGAME_XREF
A XRef Object.
Definition: IGameObject.h:75
@ IGAME_SPLINE
A Spline Object.
Definition: IGameObject.h:70
@ IGAME_BONE
A Bone Object.
Definition: IGameObject.h:73
@ IGAME_IKCHAIN
An IK Chain Object.
Definition: IGameObject.h:74
@ IGAME_MESH
A Mesh Object.
Definition: IGameObject.h:69

◆ MaxType

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.

81  {
89  };
@ IGAME_MAX_CAMERA
A Camera Object.
Definition: IGameObject.h:86
@ IGAME_MAX_LIGHT
A Light Object.
Definition: IGameObject.h:85
@ IGAME_MAX_SHAPE
A Shape Object.
Definition: IGameObject.h:84
@ IGAME_MAX_BONE
A Bone Object.
Definition: IGameObject.h:87
@ IGAME_MAX_GEOM
A Geom Object.
Definition: IGameObject.h:83
@ IGAME_MAX_UNKNOWN
An unknown object.
Definition: IGameObject.h:82
@ IGAME_MAX_HELPER
A Helper Object.
Definition: IGameObject.h:88

Constructor & Destructor Documentation

◆ IGameObject() [1/2]

Default constructor.

◆ IGameObject() [2/2]

The IGameObject constructor.

Parameters
*nodeThe 3ds Max node to initialise

◆ ~IGameObject()

virtual ~IGameObject ( )
pure virtual

Member Function Documentation

◆ SetNode()

void SetNode ( INode n)
protected

◆ GetBoundingBox()

IGAMEEXPORT void GetBoundingBox ( Box3 bb)

The bounding box of the object.

Parameters
bbThe Box3 to receive the value

◆ IsRenderable()

IGAMEEXPORT bool IsRenderable ( )

Check if object renderable.

Returns
TRUE if it is renderable

◆ GetIGameType()

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

◆ GetMaxObject()

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

◆ GetMaxType()

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

◆ GetNumModifiers()

IGAMEEXPORT int GetNumModifiers ( )

The number of modifiers active on the object.

Returns
The number of modifiers

◆ GetIGameModifier()

IGAMEEXPORT IGameModifier* GetIGameModifier ( int  index)

Access to IGame modifier.

Get a pointer to the IGame representation of the modifier

Parameters
indexThe index of the modifier to return
Returns
A pointer to the IGameModifier

◆ CastShadows()

IGAMEEXPORT bool CastShadows ( )

Check if Object casts shadows.

Returns
TRUE if object casts shadows

◆ IsObjectSkinned()

IGAMEEXPORT bool IsObjectSkinned ( )

Check if object skinned.

Is object skinned with either Physique of Skin

Returns
TRUE if skinned

◆ GetIGameSkin()

IGAMEEXPORT IGameSkin* GetIGameSkin ( )

Access to the Skin interface.

Returns
A pointer to IGameSkin or NULL if not present

◆ IsObjectXRef()

IGAMEEXPORT bool IsObjectXRef ( )

Check if XRef object.

Indentify XRef objects

Returns
TRUE if it is an XRef Object

◆ GetIGameObjectTM()

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.

◆ InitializeData()

virtual bool InitializeData ( )
inlinevirtual

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.
180 {return false;}

Member Data Documentation

◆ gameNode

INode* gameNode
protected

◆ gameObject

Object* gameObject
protected