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 |
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.
| 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.
| 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
| point | The point within the volume in local coordinates. | |
| filter | The resulting filtered color. | |
| glow | The resulting glow value. |
1.6.3