Torque 3D - Script Manual: DecalData Class Reference

TorqueScript

Main   Class List   Namespace List   Online

DecalData Class Reference
[DecalsSpecial Effects]

A datablock describing an individual decal. More...

Inheritance diagram for DecalData:

List of all members.

Public Member Functions

void postApply ()
 Recompute the imagemap sub-texture rectangles for this DecalData.

Public Attributes

Rendering

float clippingAngle
 The angle in degrees used to clip geometry that faces away from the decal projection direction.
float fadeEndPixelSize
 LOD value - size in pixels at which decals of this type are fully faded out.
float fadeStartPixelSize
 LOD value - size in pixels at which decals of this type begin to fade out.
char renderPriority
 Default renderPriority for decals of this type (determines draw order when decals overlap).
Decal

int fadeTime
 Time (in milliseconds) over which to fade out the decal before deleting it at the end of its lifetime.
int lifeSpan
 Time (in milliseconds) before this decal will be automatically deleted.
string Material
 Material to use for this decal.
float size
 Width and height of the decal in meters before scale is applied.
Texturing

int frame
 Index of the texture rectangle within the imagemap to use for this decal.
bool randomize
 If true, a random frame from the imagemap is selected for each instance of the decal.
int texCols
 Number of columns in the supplied imagemap.
int texRows
 Number of rows in the supplied imagemap.
int textureCoordCount
 Number of individual frames in the imagemap (maximum 16).
RectF textureCoords [16]
 An array of RectFs (topleft.x topleft.y extent.x extent.y) representing the UV coordinates for each frame in the imagemap.

Detailed Description

A datablock describing an individual decal.

The textures defined by the decal Material can be divided into multiple rectangular sub-textures as shown below, with a different sub-texture selected by all decals using the same DecalData (via frame) or each decal instance (via randomize).

decal_example.png

Example of a Decal imagemap

Example:
datablock DecalData(BulletHoleDecal)
{
   material = "DECAL_BulletHole";
   size = "5.0";
   lifeSpan = "50000";
   randomize = "1";
   texRows = "2";
   texCols = "2";
   clippingAngle = "60";
};
See also:
Decals

Member Function Documentation

void DecalData::postApply (  ) 

Recompute the imagemap sub-texture rectangles for this DecalData.

Example:
// Inform the decal object to reload its imagemap and frame data.
%decalData.texRows = 4;
%decalData.postApply();

Member Data Documentation

The angle in degrees used to clip geometry that faces away from the decal projection direction.

LOD value - size in pixels at which decals of this type are fully faded out.

This should be a smaller value than fadeStartPixelSize.

LOD value - size in pixels at which decals of this type begin to fade out.

This should be a larger value than fadeEndPixelSize. However, you may also set this to a negative value to disable lod-based fading.

Time (in milliseconds) over which to fade out the decal before deleting it at the end of its lifetime.

See also:
lifeSpan

Index of the texture rectangle within the imagemap to use for this decal.

Time (in milliseconds) before this decal will be automatically deleted.

Material to use for this decal.

If true, a random frame from the imagemap is selected for each instance of the decal.

Default renderPriority for decals of this type (determines draw order when decals overlap).

Width and height of the decal in meters before scale is applied.

Number of columns in the supplied imagemap.

Use texRows and texCols if the imagemap frames are arranged in a grid; use textureCoords to manually specify UV coordinates for irregular sized frames.

Number of rows in the supplied imagemap.

Use texRows and texCols if the imagemap frames are arranged in a grid; use textureCoords to manually specify UV coordinates for irregular sized frames.

Number of individual frames in the imagemap (maximum 16).

An array of RectFs (topleft.x topleft.y extent.x extent.y) representing the UV coordinates for each frame in the imagemap.

Note:
This field should only be set if the imagemap frames are irregular in size. Otherwise use the texRows and texCols fields and the UV coordinates will be calculated automatically.


Copyright © GarageGames, LLC. All Rights Reserved.