Public Member Functions | Static Public Member Functions

IRenderMeshCache Class Reference

Search for all occurrences

Detailed Description

This class maintains a list of the meshes and RenderMeshes used per instance. It acts as a factory class.

This is useful for Materials where a single material could be applied to multiple nodes, so a cache is needed so the material can pull the correct mesh data

#include <RTMax.h>

Inheritance diagram for IRenderMeshCache:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual void  SetMeshType (IRenderMesh::MeshType type)=0
  Set the type of the mesh cache to maintain;.
virtual int  SetCachedMNMesh (MNMesh *mnMesh, INode *node, TimeValue time, bool &meshChanged)=0
  Fill up the cache with data from 3ds Max.
virtual int  SetCachedMesh (Mesh *mesh, INode *node, TimeValue time, bool &meshChanged)=0
  Fill up the cache with data from 3ds Max.
virtual int  GetCacheSize ()=0
  Get the number of cached mesh.
virtual IRenderMesh GetActiveRenderMesh (int index)=0
  Get the active render mesh.
virtual INode GetActiveNode (int index)=0
virtual Mesh GetActiveMesh (int index)=0
virtual void  SetDirectXVersion (UINT version)=0
virtual  ~IRenderMeshCache ()
  default destructor
virtual void  Release ()=0
  Used to release any data stored by the cache.
virtual void  DeleteRenderMeshCache (INode *node)=0
  Used to delete the cache for a specific node.

Static Public Member Functions

static DllExport IRenderMeshCache GetRenderMeshCache ()
  Exported function to access the IRenderMeshCache interface.

Constructor & Destructor Documentation

virtual ~IRenderMeshCache ( ) [inline, virtual]

default destructor

{}

Member Function Documentation

static DllExport IRenderMeshCache* GetRenderMeshCache ( ) [static]

Exported function to access the IRenderMeshCache interface.

virtual void SetMeshType ( IRenderMesh::MeshType  type ) [pure virtual]

Set the type of the mesh cache to maintain;.

Parameters:
type Set the type of object to hold. This can be either a mesh or a quad.
virtual int SetCachedMNMesh ( MNMesh mnMesh,
INode node,
TimeValue  time,
bool &  meshChanged 
) [pure virtual]

Fill up the cache with data from 3ds Max.

This method needs to be called when the node has actually changed. In 3ds Max 8 and before you could call this method at any time and the method would attempt to cache and maintain the data. However this would not work correctly with a MNMesh type object. Now the method expects to only update itself when the object changes. This is easily achieved by only calling this method when IStdDualVSCallback::InitValid() is called. To simply get the cache position for the node you can call this method with a NULL mnMesh pointer.

Parameters:
*mnMesh The MNMesh to store in the cache. If this is NULL the system will return the cache entry only
*node The node to store in the cache
time The time to use in any evaluations
&meshChanged If the mesh is different to that in the cache, this specifies the case.
Returns:
The position in the cache of the mesh/node combo
virtual int SetCachedMesh ( Mesh mesh,
INode node,
TimeValue  time,
bool &  meshChanged 
) [pure virtual]

Fill up the cache with data from 3ds Max.

This method needs to be called when the node has actually changed. In 3ds Max 8 and before you could call this method at any time and the method would attempt to cache and maintain the data. However this would not work correctly with a MNMesh type object. Now the method expects to only update itself when the object changes. This is easily achieved by only calling this method when IStdDualVSCallback::InitValid() is called. To simply get the cache position for the node you can call this method with a NULL mesh pointer.

Parameters:
*mesh The mesh to store in the cache. If this is NULL the system will return the cache entry only
*node The node to store in the cache
time The time to use in any evaluations
&meshChanged If the mesh is different to that in the cache, this specifies the case.
Returns:
The position in the cache of the mesh/node combo
virtual int GetCacheSize ( ) [pure virtual]

Get the number of cached mesh.

Returns:
The number of cached mesh
virtual IRenderMesh* GetActiveRenderMesh ( int  index ) [pure virtual]

Get the active render mesh.

Parameters:
index The index of the mesh to retrieve
Returns:
The IRenderMesh based on the index provided
virtual INode* GetActiveNode ( int  index ) [pure virtual]
Parameters:
index Get the node for the current cached object
Returns:
The INode for the current cache
virtual Mesh* GetActiveMesh ( int  index ) [pure virtual]
Parameters:
index Get the mesh for the current cached object
Returns:
The INode for the current cache
virtual void SetDirectXVersion ( UINT  version ) [pure virtual]
virtual void Release ( ) [pure virtual]

Used to release any data stored by the cache.

virtual void DeleteRenderMeshCache ( INode node ) [pure virtual]

Used to delete the cache for a specific node.


IRenderMeshCache IRenderMeshCache IRenderMeshCache IRenderMeshCache IRenderMeshCache IRenderMeshCache IRenderMeshCache IRenderMeshCache IRenderMeshCache IRenderMeshCache
IRenderMeshCache IRenderMeshCache IRenderMeshCache IRenderMeshCache IRenderMeshCache IRenderMeshCache IRenderMeshCache IRenderMeshCache IRenderMeshCache IRenderMeshCache