I3DShInstance Struct Reference
[Shell Interfaces]

Inheritance diagram for I3DShInstance:
IMCUnknown

List of all members.

Public Types

enum  EInstanceKind {
  kPrimitiveInstance = 1, kSceneInstance = 2, kCameraInstance = 3, kLightInstance = 4,
  kInstanceKind_Max = 0x7fffffff
}
 

These are the constants returned from GetInstanceKind().

More...
enum  EInstanceType { kStandardInstance = 0x0000, kSubInstance = 0x0001, kSubInstanceWithUniformScaling = 0x0002 }

Public Member Functions

virtual MCCOMErr MCCOMAPI Get3DObject (I3DShObject **object)=0
virtual MCCOMErr MCCOMAPI Set3DObject (I3DShObject *object)=0
virtual MCCOMErr MCCOMAPI SetShader (I3DShMasterShader *masterShader)=0
virtual MCCOMErr MCCOMAPI GetShader (I3DShMasterShader **masterShader)=0
virtual boolean MCCOMAPI UsesDefaultShader ()=0
virtual uint32 MCCOMAPI GetUVSpaceCount ()=0
virtual MCCOMErr MCCOMAPI GetUVSpace (uint32 uvSpaceID, UVSpaceInfo *uvSpaceInfo)=0
virtual MCCOMErr MCCOMAPI GetUVSpaceShader (uint32 uvSpaceID, I3DShMasterShader **masterShader)=0
virtual MCCOMErr MCCOMAPI SetUVSpaceShader (uint32 uvSpaceID, I3DShMasterShader *masterShader)=0
virtual MCCOMErr MCCOMAPI GetShadingFlags (ShadingFlags &theFlags)=0
virtual MCCOMErr MCCOMAPI DoShade (ShadingOut &shadingOut, ShadingIn &shadingIn)=0
virtual boolean MCCOMAPI CanBeTransparent (int32 shadingDomainIndex)=0
virtual void MCCOMAPI GetShaderApproximation (ShadingOut &shadingOut, ShadingIn &shadingIn)=0
virtual MCCOMErr MCCOMAPI GetBump (TVector3 &result, ShadingIn &shadingIn)=0
virtual MCCOMErr MCCOMAPI GetMainColors (TMCColorRGBA &color1, TMCColorRGBA &color2)=0
virtual MCCOMErr MCCOMAPI ShaderModified ()=0
virtual MCCOMErr MCCOMAPI GetFlatennedTexturesSync (uint32 uvSpaceID, UVMaps &maps, boolean wantsProgress, TMCRealRect *range=nil) const =0
virtual MCCOMErr MCCOMAPI GetFlatennedTexturesAsync (uint32 uvSpaceID, UVMaps &maps, TextureAvailableProc proc, void *privData, TMCRealRect *range=nil) const =0
virtual boolean MCCOMAPI GetRecommendedTextureSize (uint32 uvSpaceID, uint32 channelIndex, uint32 &width, uint32 &height) const =0
 Calculate the intrinsic appropriate texture size.
virtual void MCCOMAPI GetRelevantTextureBucketCache (uint32 uvSpaceID, uint32 channelIndex, boolean allowMultiplierModification, IShTextureMapBucketCache **outTextureMapFile) const =0
 Get the texture map file associated to the specified shading domain.
virtual MCCOMErr MCCOMAPI FlushFlatennedTextureCaches ()=0
virtual MCCOMErr MCCOMAPI SetShadingFromMaps (uint32 uvSpaceID, UVMaps &maps, MapParams *mapParams, TMCRealRect *range=nil)=0
virtual void MCCOMAPI GetBoundingBox (TBBox3D &bbox, ETreeDeformBBoxModes deformMode, boolean rendering=true)=0
virtual void MCCOMAPI GetFacetBoundingBox (TBBox3D &bbox, ETreeDeformBBoxModes deformMode, const TMatrix33 &mappingTransform, void *listener, uint32 matrixChangedPhase)=0
virtual MCCOMErr MCCOMAPI Dehydrate (int16 level)=0
virtual boolean MCCOMAPI RayHit (RayHitParameters &param)=0
virtual boolean MCCOMAPI RayHitFacet (RayHitParameters &params, uint32 facetIndex, real lod)=0
virtual MCCOMErr MCCOMAPI GetDeformed3DObject (I3DShObject **object)=0
virtual MCCOMErr MCCOMAPI GetURL (TMCString &name, int16 &kind)=0
virtual MCCOMErr MCCOMAPI SetURL (const TMCString &name, int16 kind)=0
virtual int32 MCCOMAPI GetClassSignature ()=0
virtual int32 MCCOMAPI GetInstanceKind ()=0
virtual int32 MCCOMAPI GetInstanceType ()=0
virtual boolean MCCOMAPI IsVolumeInstance ()=0
virtual boolean MCCOMAPI UsesShaders () const =0
virtual FacetMesh *MCCOMAPI GetFacetMesh (real lod)=0
virtual FacetMesh *MCCOMAPI GetRenderingFacetMesh ()=0
virtual MCCOMErr MCCOMAPI GetIndex (int32 &index)=0
virtual boolean MCCOMAPI CastsShadow ()=0
virtual boolean MCCOMAPI ReceivesShadow ()=0
virtual MCCOMErr MCCOMAPI GetReflectionFeature (I3DExReflectionFeature **reflectionFeature)=0
virtual MCCOMErr MCCOMAPI GetRefractionFeature (I3DExRefractionFeature **refractionFeature)=0
virtual MCCOMErr MCCOMAPI SetReflectionFeature (I3DShReflectionFeature *feature, ECloneMode cloneMode)=0
virtual MCCOMErr MCCOMAPI SetReflectionFeatureByID (int32 kindID)=0
virtual MCCOMErr MCCOMAPI GetReflectionFeature (I3DShReflectionFeature **reflectionFeature)=0
virtual MCCOMErr MCCOMAPI SetRefractionFeature (I3DShRefractionFeature *feature, ECloneMode cloneMode)=0
virtual MCCOMErr MCCOMAPI SetRefractionFeatureByID (int32 kindID)=0
virtual MCCOMErr MCCOMAPI GetRefractionFeature (I3DShRefractionFeature **refractionFeature)=0
virtual MCCOMErr MCCOMAPI SetBackfaceMode (EBackfaceMode BackfaceMode)=0
virtual EBackfaceMode MCCOMAPI GetBackfaceMode ()=0
virtual I3DShTreeElement *MCCOMAPI GetTreeElement ()=0
virtual void MCCOMAPI SetTemporaryCache (IMCUnknown *cache)=0
virtual const IMCUnknown *MCCOMAPI GetTemporaryCache ()=0
virtual void MCCOMAPI LockRenderingCaches (TRenderingCacheLock &lock)=0
virtual void MCCOMAPI SetRenderingCache (const IDType cacheType, TInstanceRenderingCache *cache)=0
virtual
TInstanceRenderingCache
*MCCOMAPI 
GetRenderingCache (IDType cacheType, uint32 instanceIndex)=0
virtual void MCCOMAPI DeleteRenderingCaches ()=0
virtual boolean IsGenerator () const =0
virtual void MCCOMAPI SetOverrideRenderable (TInstanceRenderable *inOverrideRenderable)=0
 Sets a renderable that overrides the default instance renderable.
virtual TInstanceRenderable
*MCCOMAPI 
GetOverrideRenderable ()=0
 Gets the renderable currently overriding the default instance renderable (usually null).
virtual void MCCOMAPI ShadeAndLight2 (LightingDetail &result, const LightingContext &lightingContext, TAbsorptionFunction *absorptionFunction)=0
virtual ELODParamType MCCOMAPI GetLODParamType () const =0

Detailed Description

I3DShInstance represents a copy of a primitive located at a certain position in space, with a certain orientation and scaling and a given shader.

Instances always support the following interfaces : I3DShTreeElement, I3DShShadableTree, ISelectableObject


Member Enumeration Documentation

These are the constants returned from GetInstanceKind().

Enumerator:
kPrimitiveInstance 
kSceneInstance 
kCameraInstance 
kLightInstance 
kInstanceKind_Max 
Enumerator:
kStandardInstance 
kSubInstance 
kSubInstanceWithUniformScaling 

Member Function Documentation

virtual boolean MCCOMAPI I3DShInstance::CanBeTransparent ( int32  shadingDomainIndex  )  [pure virtual]

Returns true if the current shading domain can contain transparent areas or alpha channel different from 1.

Parameters:
shadingDomainIndex The index of the shading domain
virtual boolean MCCOMAPI I3DShInstance::CastsShadow (  )  [pure virtual]

Returns the texture coordinates of a 3D point on the surface of the instance.

Parameters:
res True if the points is on the instance
theVertex The position of the point in 3D.
theUV The texture coordinates. Returns true if the instance is casting shadows on other objects.
virtual MCCOMErr MCCOMAPI I3DShInstance::Dehydrate ( int16  level  )  [pure virtual]
Deprecated:
Do not use !
virtual void MCCOMAPI I3DShInstance::DeleteRenderingCaches (  )  [pure virtual]

Delete all the rendering caches (at the end of a frame)

virtual MCCOMErr MCCOMAPI I3DShInstance::DoShade ( ShadingOut shadingOut,
ShadingIn shadingIn 
) [pure virtual]

Returns the shading of a point located on this instance.

Parameters:
shadingOut The returned shading information.
shadingIn The information about the point.
virtual MCCOMErr MCCOMAPI I3DShInstance::FlushFlatennedTextureCaches (  )  [pure virtual]

Delete the caches of the flattened textures.

virtual MCCOMErr MCCOMAPI I3DShInstance::Get3DObject ( I3DShObject **  object  )  [pure virtual]

Returns a pointer to the Master Object that stores the geometry associated with this instance.

Note that you should call GetDeformed3DObject() if you want to have the geometry of the instance once the deformers have been applied.

Parameters:
object A pointer to the master object.
virtual EBackfaceMode MCCOMAPI I3DShInstance::GetBackfaceMode (  )  [pure virtual]

Returns the backface culling mode (see EBackfaceMode).

virtual void MCCOMAPI I3DShInstance::GetBoundingBox ( TBBox3D bbox,
ETreeDeformBBoxModes  deformMode,
boolean  rendering = true 
) [pure virtual]

Returns the bounding box of the instance in local coordinates.

Parameters:
bbox The bounding box that is returned.
deformMode The way the deformers are applied for this calculation (see ETreeDeformBBoxModes)
rendering True if you want a bounding box for rendering (see also GetRenderingFacetMesh())
virtual MCCOMErr MCCOMAPI I3DShInstance::GetBump ( TVector3 result,
ShadingIn shadingIn 
) [pure virtual]

Not implemented.

virtual int32 MCCOMAPI I3DShInstance::GetClassSignature (  )  [pure virtual]

Returns the Class ID of the external object that is associated with the instance. For a primitive it is the class ID of the external primitive, for a light it is the class ID of the light source, for a camera it is the class ID of the camera.

virtual MCCOMErr MCCOMAPI I3DShInstance::GetDeformed3DObject ( I3DShObject **  object  )  [pure virtual]

Returns a master object that stores the geometry of the instance once the deformer have been applied.

Parameters:
object The deformed object.
virtual void MCCOMAPI I3DShInstance::GetFacetBoundingBox ( TBBox3D bbox,
ETreeDeformBBoxModes  deformMode,
const TMatrix33 mappingTransform,
void *  listener,
uint32  matrixChangedPhase 
) [pure virtual]

The bounding box calculated here fit exactly the facets of the object in a given direction. The FacetBounding boxes are cached inside the Object because it can take a long time to calculate. We added a listener here to accelerate the Get. So we don't have to compare mappingTransform (TMatrix33) in the look-up table. A last hit is provide inside the GetFacetBoundingBox method to make the Get on same listener very fast. Each time the BoudingBox of the object changed , the list is flushed. Each time you ask with a new mappingTransform, increment the matrixChangedPhase

Parameters:
bbox The bouding box that is calculated
deformMode The way the deformers are applied for this calculation (see ETreeDeformBBoxModes)
mappingTransform The transform of the bounding box
listener A listener
matrixChangedPhase Each time you ask with a new mappingTransform, increment the matrixChangedPhase.
virtual FacetMesh* MCCOMAPI I3DShInstance::GetFacetMesh ( real  lod  )  [pure virtual]

Returns the facet mesh of the instance for a given level of details.

Parameters:
lod The level of details requested.
virtual MCCOMErr MCCOMAPI I3DShInstance::GetFlatennedTexturesAsync ( uint32  uvSpaceID,
UVMaps maps,
TextureAvailableProc  proc,
void *  privData,
TMCRealRect range = nil 
) const [pure virtual]

Same as GetFlatennedTexturesSync() but the calculation is done in a thread and the maps are only returned once they have been calculated.

virtual MCCOMErr MCCOMAPI I3DShInstance::GetFlatennedTexturesSync ( uint32  uvSpaceID,
UVMaps maps,
boolean  wantsProgress,
TMCRealRect range = nil 
) const [pure virtual]

Calculates a set of texture maps that approximates the shading on the instance.

Parameters:
uvSpaceID The shading domain index.
maps The maps that are returned.
wantsProgress True if a progress bar should be displayed during the calculation.
range The UV range. If nil the default is [0,1]x[0,1]. The range is different only on old raydream objects.
virtual MCCOMErr MCCOMAPI I3DShInstance::GetIndex ( int32 &  index  )  [pure virtual]

Returns the index of the instance in the master group that contains it. This is the index that is stored in the instance index GBuffer.

Parameters:
index The index of the instance.
virtual int32 MCCOMAPI I3DShInstance::GetInstanceKind (  )  [pure virtual]

Returns the instance Kind (see EInstanceKind).

virtual int32 MCCOMAPI I3DShInstance::GetInstanceType (  )  [pure virtual]

Returns the instance type (see EInstanceType).

virtual ELODParamType MCCOMAPI I3DShInstance::GetLODParamType (  )  const [pure virtual]
Returns:
The type of information used to calculate the appropriate LOD
virtual MCCOMErr MCCOMAPI I3DShInstance::GetMainColors ( TMCColorRGBA color1,
TMCColorRGBA color2 
) [pure virtual]

Return an approximation of the shading.

virtual TInstanceRenderable* MCCOMAPI I3DShInstance::GetOverrideRenderable (  )  [pure virtual]

Gets the renderable currently overriding the default instance renderable (usually null).

virtual boolean MCCOMAPI I3DShInstance::GetRecommendedTextureSize ( uint32  uvSpaceID,
uint32  channelIndex,
uint32 width,
uint32 height 
) const [pure virtual]

Calculate the intrinsic appropriate texture size.

virtual MCCOMErr MCCOMAPI I3DShInstance::GetReflectionFeature ( I3DShReflectionFeature **  reflectionFeature  )  [pure virtual]

Returns a pointer to the reflection feature of this instance.

Parameters:
reflectionFeature The reflection feature.
virtual MCCOMErr MCCOMAPI I3DShInstance::GetReflectionFeature ( I3DExReflectionFeature **  reflectionFeature  )  [pure virtual]

Returns a pointer to the reflection feature of this instance.

Parameters:
reflectionFeature The reflection feature.
virtual MCCOMErr MCCOMAPI I3DShInstance::GetRefractionFeature ( I3DShRefractionFeature **  refractionFeature  )  [pure virtual]

Returns a pointer to the refraction feature of this instance.

Parameters:
refractionFeature The refraction feature.
virtual MCCOMErr MCCOMAPI I3DShInstance::GetRefractionFeature ( I3DExRefractionFeature **  refractionFeature  )  [pure virtual]

Returns a pointer to the refraction feature of this instance.

Parameters:
refractionFeature The refraction feature.
virtual void MCCOMAPI I3DShInstance::GetRelevantTextureBucketCache ( uint32  uvSpaceID,
uint32  channelIndex,
boolean  allowMultiplierModification,
IShTextureMapBucketCache **  outTextureMapFile 
) const [pure virtual]

Get the texture map file associated to the specified shading domain.

virtual TInstanceRenderingCache* MCCOMAPI I3DShInstance::GetRenderingCache ( IDType  cacheType,
uint32  instanceIndex 
) [pure virtual]

Retrieves a pointer to a rendering cache. Note that you will need to be in a critical section (see LockRenderingCaches()) to make sure that the cache does not exist already. However you can still call this function without being in a critical section to get the cache

Parameters:
cacheType The type of the cache.
instanceIndex 
virtual FacetMesh* MCCOMAPI I3DShInstance::GetRenderingFacetMesh (  )  [pure virtual]

Returns the facet mesh used for the final rendering

virtual MCCOMErr MCCOMAPI I3DShInstance::GetShader ( I3DShMasterShader **  masterShader  )  [pure virtual]

Returns the master shader.

Parameters:
masterShader The master shader
virtual void MCCOMAPI I3DShInstance::GetShaderApproximation ( ShadingOut shadingOut,
ShadingIn shadingIn 
) [pure virtual]

Returns the shading of a point located on this instance.

Parameters:
shadingOut The returned shading information.
shadingIn The information about the point.
virtual MCCOMErr MCCOMAPI I3DShInstance::GetShadingFlags ( ShadingFlags theFlags  )  [pure virtual]

Returns the flags of the master shader.

Parameters:
theFlags The flags of the shader.
virtual const IMCUnknown* MCCOMAPI I3DShInstance::GetTemporaryCache (  )  [pure virtual]

Returns a pointer to the temporary cache store with SetTemporaryCache

virtual I3DShTreeElement* MCCOMAPI I3DShInstance::GetTreeElement (  )  [pure virtual]

Returns a pointer to the I3DShTreeElement interface.

virtual MCCOMErr MCCOMAPI I3DShInstance::GetURL ( TMCString name,
int16 kind 
) [pure virtual]

Returns the URL associated with the instance.

virtual MCCOMErr MCCOMAPI I3DShInstance::GetUVSpace ( uint32  uvSpaceID,
UVSpaceInfo uvSpaceInfo 
) [pure virtual]

Return the description of a given shading domaine.

Parameters:
uvSpaceID The index of the shading domaine.
uvSpaceInfo The information that is returned.
virtual uint32 MCCOMAPI I3DShInstance::GetUVSpaceCount (  )  [pure virtual]

Returns the number of shading domaine on the instance.

virtual MCCOMErr MCCOMAPI I3DShInstance::GetUVSpaceShader ( uint32  uvSpaceID,
I3DShMasterShader **  masterShader 
) [pure virtual]

Return the master shader of a given shading domaine.

Parameters:
uvSpaceID The index of the shading domaine.
masterShader The master shader.
virtual boolean I3DShInstance::IsGenerator (  )  const [pure virtual]

Return true if this an instance of a generator and therefore could generate other instances.

virtual boolean MCCOMAPI I3DShInstance::IsVolumeInstance (  )  [pure virtual]

Returns true if the instance is a volume primitive.

virtual void MCCOMAPI I3DShInstance::LockRenderingCaches ( TRenderingCacheLock lock  )  [pure virtual]

Enable/Disable the displacement mapping for this instance

Parameters:
value True if the displacement mapping is enabled. Takes a lock on the rendering caches. You should call this function before you start to build a new cache.

The destructor of TRenderingCacheLock will release the lock. So you should destroy the lock once you have set the cache on the instance.

virtual boolean MCCOMAPI I3DShInstance::RayHit ( RayHitParameters param  )  [pure virtual]

Calculates the intersection of a Ray and the instance. (The ray should be in local coordinates of the instance.

Parameters:
param The parameters of the raytracing.
virtual boolean MCCOMAPI I3DShInstance::RayHitFacet ( RayHitParameters params,
uint32  facetIndex,
real  lod 
) [pure virtual]

calculates the intersection between a ray and a triangle of a primitive. Note that if the primitive is self-Raytracable, the facetIndex is ignored and the intersection is calculated with the whole primitive.

Parameters:
params the raytracing parameters (ray, hit...)
facetIndex the index of the facet to intersect
lod the lod of the primitive from which the facet is coming from
virtual boolean MCCOMAPI I3DShInstance::ReceivesShadow (  )  [pure virtual]

Returns true if other objects can cast shadows on this object.

virtual MCCOMErr MCCOMAPI I3DShInstance::Set3DObject ( I3DShObject object  )  [pure virtual]

Sets the Master Object that stores the geometry associated with this instance.

Parameters:
object A pointer to the master object.
virtual MCCOMErr MCCOMAPI I3DShInstance::SetBackfaceMode ( EBackfaceMode  BackfaceMode  )  [pure virtual]

Sets the backface culling mode (see EBackfaceMode).

Parameters:
BackfaceMode The backface culling mode (see EBackfaceMode).
virtual void MCCOMAPI I3DShInstance::SetOverrideRenderable ( TInstanceRenderable inOverrideRenderable  )  [pure virtual]

Sets a renderable that overrides the default instance renderable.

virtual MCCOMErr MCCOMAPI I3DShInstance::SetReflectionFeature ( I3DShReflectionFeature feature,
ECloneMode  cloneMode 
) [pure virtual]

Sets reflection feature of this instance.

Parameters:
feature The reflection feature.
cloneMode The clone mode (see ECloneMode).
virtual MCCOMErr MCCOMAPI I3DShInstance::SetReflectionFeatureByID ( int32  kindID  )  [pure virtual]

Sets type of reflection feature of this instance.

Parameters:
kindID The class ID of the reflection feature.
virtual MCCOMErr MCCOMAPI I3DShInstance::SetRefractionFeature ( I3DShRefractionFeature feature,
ECloneMode  cloneMode 
) [pure virtual]

Sets refraction feature of this instance.

Parameters:
feature The refraction feature.
cloneMode The clone mode (see ECloneMode).
virtual MCCOMErr MCCOMAPI I3DShInstance::SetRefractionFeatureByID ( int32  kindID  )  [pure virtual]

Sets type of refraction feature of this instance.

Parameters:
kindID The class ID of the refraction feature.
virtual void MCCOMAPI I3DShInstance::SetRenderingCache ( const IDType  cacheType,
TInstanceRenderingCache cache 
) [pure virtual]

Stores a rendering cache on the instance. Note that this caches are detroyed when the rendering is finished.

Make sure you call LockRenderingCaches() before calculating your cache.

Parameters:
cacheType The type of the cache.
cache A pointer to the cache itself
virtual MCCOMErr MCCOMAPI I3DShInstance::SetShader ( I3DShMasterShader masterShader  )  [pure virtual]

Sets the master shader that is applied to the instance.

Parameters:
masterShader The master shader
virtual MCCOMErr MCCOMAPI I3DShInstance::SetShadingFromMaps ( uint32  uvSpaceID,
UVMaps maps,
MapParams mapParams,
TMCRealRect range = nil 
) [pure virtual]

Undocumented.

virtual void MCCOMAPI I3DShInstance::SetTemporaryCache ( IMCUnknown cache  )  [pure virtual]

Sets a temporary cache on the instance (example when calculating a postrenderer per instance such as Aura3D)

Parameters:
cache A pointer to a cache. Null if you want to delete the cache
virtual MCCOMErr MCCOMAPI I3DShInstance::SetURL ( const TMCString name,
int16  kind 
) [pure virtual]

Sets the URL associated with the instance.

virtual MCCOMErr MCCOMAPI I3DShInstance::SetUVSpaceShader ( uint32  uvSpaceID,
I3DShMasterShader masterShader 
) [pure virtual]

Set the master shader of a given shading domaine.

Parameters:
uvSpaceID The index of the shading domaine.
masterShader The master shader.
virtual void MCCOMAPI I3DShInstance::ShadeAndLight2 ( LightingDetail result,
const LightingContext lightingContext,
TAbsorptionFunction absorptionFunction 
) [pure virtual]

Calculate the lighting and shading of a point located on this instance.

Parameters:
result The resulting color and lighting info
lightingContext All the info about the point to light and the lighting of the scene
virtual MCCOMErr MCCOMAPI I3DShInstance::ShaderModified (  )  [pure virtual]

Notify the instance that its shader has been modified.

virtual boolean MCCOMAPI I3DShInstance::UsesDefaultShader (  )  [pure virtual]

Returns true if the instance has the default shader applied to it.

virtual boolean MCCOMAPI I3DShInstance::UsesShaders (  )  const [pure virtual]

Returns true if the instance uses the shaders that are applyed to it.


The documentation for this struct was generated from the following file:
Generated on Mon Apr 26 22:47:40 2010 for Carrara SDK Doc by  doxygen 1.6.3