Class GeomObject

3DS Max Plug-In SDK

Class GeomObject

See Also: Class Object, Class Mesh.

class GeomObject : public Object

Description:

This is the base class for the creation of Geometric Object plug-ins. This class represents an object that has geometry and is renderable.

Methods:

Prototype:

virtual int IsInstanceDependent()

Remarks:

Implemented by the Plug-In.

If an object creates different meshes depending on the particular instance (view-dependent) it should return nonzero; otherwise 0.

Default Implementation:

{ return 0; }

Prototype:

virtual Mesh* GetRenderMesh(TimeValue t, INode *inode, View& view, BOOL& needDelete);

Remarks:

Implemented by the Plug-In.

This method should be implemented by all renderable GeomObjects. It provides a mesh representation of the object for use by the renderer. Primitives that already have a mesh cached can just return a pointer to it (and set needDelete to FALSE).

In release 3.0 and later, any implementations of this method which take a long time should periodically call View::CheckForRenderAbort() to see if the user has canceled the render. If canceled, the function can either return NULL, or return a non null pointer with the appropriate value for needDelete. (If needDelete is TRUE a non-null mesh will be deleted.)

Parameters:

TimeValue t

The time to get the mesh.

INode *inode

The node in the scene.

View& view

If the renderer calls this method it will pass the view information here. See Class View.

BOOL& needDelete

Set to TRUE if the renderer should delete the mesh, FALSE otherwise.

Return Value:

A pointer to the mesh object.

Prototype:

virtual PatchMesh* GetRenderPatchMesh(TimeValue, INode *inode, View& view, BOOL& needDelete);

Remarks:

Implemented by the Plug-In.

This method provides a patch mesh representation of the object for use by the renderer. If this method returns NULL, then GetRenderMesh() will be called.

Parameters:

TimeValue t

The time to get the patch mesh.

INode *inode

The node in the scene.

View& view

If the renderer calls this method it will pass the view information here. See Class View.

BOOL& needDelete

Set to TRUE if the renderer should delete the patch mesh, FALSE otherwise.

Return Value:

A pointer to the patch mesh. See Class PatchMesh.

Prototype:

virtual int NumberOfRenderMeshes();

Remarks:

This method is available in release 4.0 and later only.

Implemented by the Plug-In.

Objects may supply multiple render meshes ( e.g. particle systems). If this method returns a positive number, then GetMultipleRenderMesh and GetMultipleRenderMeshTM will be called for each mesh, instead of calling GetRenderMesh.

Return Value:

The number of render meshes, or 0 to indicate that multiple meshes aren’t supported.

Default Implementation:

{ return 0; }

Prototype:

virtual Mesh* GetMultipleRenderMesh(TimeValue t, INode *inode, View& view, BOOL& needDelete, int meshNumber);

Remarks:

This method is available in release 4.0 and later only.

Implemented by the Plug-In.

For multiple render meshes, this method must be implemented. set needDelete to TRUE if the render should delete the mesh, FALSE otherwise.

Parameters:

TimeValue t

The time at which to obtain the mesh.

INode *inode

The pointer to the node.

View& view

A reference to the view.

BOOL& needDelete

TRUE if the mesh needs to be deleted, otherwise FALSE.

int meshNumber

Specifies which of the multiplie meshes is being asked for.

Default Implementation:

{ return NULL; }

Prototype:

virtual void GetMultipleRenderMeshTM(TimeValue t, INode *inode, View& view, int meshNumber, Matrix3& meshTM, Interval& meshTMValid);

Remarks:

This method is available in release 4.0 and later only.

Implemented by the Plug-In.

For multiple render meshes, this method must be implemented.

Parameters:

TimeValue t

The time at which to obtain the mesh.

INode *inode

The pointer to the node.

View& view

A reference to the view.

int meshNumber

Specifies which of the multiplie meshes is being asked for.

Matrix3& meshTM

Should be returned with the transform defining the offset of the particular mesh in object space.

Interval& meshTMValid

Should contain the validity interval of meshTM.

Default Implementation:

{ return; }

Prototype:

virtual BOOL CanDoDisplacementMapping();

Remarks:

This method is available in release 2.0 and later only.

Returns TRUE if this object can do displacement mapping; otherwise FALSE.

Default Implementation:

{ return 0; }