# IVolumePrimitive Struct Reference
[External Interfaces]

Inheritance diagram for IVolumePrimitive:

List of all members.

## Public Member Functions
virtual MCCOMErr MCCOMAPI | GetVolumeDensity (const TVector3 &point, TMCColorRGBA &filter, TMCColorRGBA &glow)=0
virtual MCCOMErr MCCOMAPI | GetVolumeAttenuation (const TVector3 &from, const TVector3 &to, TMCColorRGBA &attenuation, TColorRGBLinearEffect *linearEffect, boolean isShadowCasting, boolean oldShadowFiltering)=0

## Detailed Description

Rather than defining geometry, a primitive can also describe a volume. This is achieved by inheriting from IVolumePrimitive as well as I3DExGeometricPrimitive (or TBasicPrimitive).

There are two methods for implementing a volume primitive. IVolumePrimitive::GetVolumedensity provides a filter color and a glow color for each point of the volume primitive. IVolumePrimitive::GetVolumeAttenuation calculates the color from a ray.

## Member Function Documentation

virtual MCCOMErr MCCOMAPI IVolumePrimitive::GetVolumeAttenuation | ( | const TVector3 & | from,
|  | const TVector3 & | to,
|  | TMCColorRGBA & | attenuation,
|  | TColorRGBLinearEffect * | linearEffect,
|  | boolean | isShadowCasting,
|  | boolean | oldShadowFiltering |
| ) |  |  | `[pure virtual]`

Called by the shell to get a color from a ray going thru a volume primitive.

Parameters:

  | from | The intersection of the ray with the back of the volume primitive. This is where the calculation begins.
  | to | The intersection of the ray with the front of the volume primitive. This is where the calculation ends.
  | attenuation | The color behind the object is given. The resulting color is returned.
  | isShadowCasting | True if the ray is used to calculate shadows (object -> light source)

virtual MCCOMErr MCCOMAPI IVolumePrimitive::GetVolumeDensity | ( | const TVector3 & | point,
|  | TMCColorRGBA & | filter,
|  | TMCColorRGBA & | glow |
| ) |  |  | `[pure virtual]`

Called during rendering to calculate a color from a ray going thru the volume primitive. The shell calls this method to get a filtered color and a glow color for many points on the ray. It begins with a base color from an object or background color behind the volumetric primitive to calculate the color within the volume:

Volume Color = (base color * filtered color) + glow

Parameters:

  | point | The point within the volume in local coordinates.
  | filter | The resulting filtered color.
  | glow | The resulting glow value.

The documentation for this struct was generated from the following file:

- I3dExPrimitive.h