C4 Engine

Facebook Twitter YouTube IndieDB

struct MarkingData

Defined in:  C4Markings.h
The MarkingData structure defines the parameters of a surface marking effect.
Constructor

MarkingData(unsigned_int32 flags = 0, MarkingList *list = nullptr);

MarkingData(const Vector2D& scale, const Vector2D& offset, unsigned_int32 flags = 0, MarkingList *list = nullptr);

Parameters
flags The marking effect flags.
list A pointer to the MarkingList object into which each MarkingEffect is inserted.
scale A scale to apply to the (s, t) texture coordinates used by the marking.
offset An offset to apply to the (s, t) texture coordinates used by the marking.
Data Members
unsigned_int32      markingFlags; The marking effect flags. This is set to zero by the MarkingData constructors.
MarkingList         *markingList; A pointer to a MarkingList (or a subclass) to which marking effects are added.
Point3D             center; The world-space center of the surface marking.
Vector3D            normal; The world-space normal direction of the surface marking. This vector must have unit length.
Vector3D            tangent; The world-space tangent direction of the surface marking. (This determines texture orientation.) This vector does not have to be unit length.
float               radius; The radius of the surface marking.
Range<float>        clip; The range of depths, with respect to the center and normal direction, to which the marking is clipped if the kMarkingClipRange flag is specified. If kMarkingClipRange is not specified, then the range is [−rr], where r is the radius of the marking.
Vector2D            texcoordScale; The (s, t) scale to apply to the texture coordinates of the marking. This is set to (1, 1) by the default constructor.
Vector2D            texcoordOffset; The (s, t) offset to apply to the texture coordinates of the marking. This is set to (0, 0) by the default constructor.
const char      *textureName; A pointer to the name of the texture map used by the surface marking. This occupies the same space as materialObject and should not be specified if the kMarkingLight is set in the markingFlags field.
MaterialObject  *materialObject; A pointer to the material object used by the surface marking. This occupies the same space as textureName and should only be specified if the kMarkingLight is set in the markingFlags field.
ColorRGBA           color; The marking color. Ignored if a material object containing a DiffuseAttribute is specified.
int32               lifeTime; The time for which the surface marking is rendered. If this is set to -1, then the marking is rendered for exactly one frame.
Description
The MarkingData structure holds information that is passed to the constructor for the MarkingEffect class. The markingFlags member can currently be zero or the following value.
kMarkingLight The marking receives full lighting.
kMarkingBlendLight Alpha blending is applied to a lighted marking (valid only if the kMarkingLight flag is set).
kMarkingDepthWrite The marking writes to the depth buffer (valid only if the kMarkingLight flag is set).
kMarkingTwoSided The marking is rendered two-sided (valid only if the kMarkingLight flag is not set).
kMarkingClipRange The minimum and maximum depths to which the marking is clipped are given by the clip field of the MarkingData structure.
If the list parameter is not nullptr, then each MarkingEffect node created during a call to the MarkingEffect::New function is added to the MarkingList object (which can be a subclass of MarkingList). If the scale and offset parameters are specified, then the texcoordScale and texcoordOffset members of the MarkingData structure are initialized to those values. Otherwise, the scale is initialized to (1, 1), and the offset is initialized to (0, 0) so that the entire texture map is used by the marking.
See Also

MarkingEffect