120
Chapter 10: Scene Graph Engines
csTransformEng Fields
csTransformEng has the following fields:
void setTransformType(TransformTypeEnum transformType);
TransformTypeEnum getTransformType();
csMFInt* count() const;
csMFInt* index() const;
csMFMatrix4f* matrix() const;
transformType() specifies the input data type. If the transformType() value is
• POINT—the input is interpreted as points with a homogeneous value of 1.0.
• VECTOR—the input is interpreted as vectors with a homogeneous value of 0.0
which are transformed by the inverse transpose of the matrices in matrix().
matrix() is an array of matrix values. For each weight, abs(count()) coordinates are
multiplied by the weight and stored in the output array.
count() is an array of integer values. Each value represents the number of input values
which will be morphed based on the corresponding matrix value. If the value of count()
is positive, the next coordinate is chosen by dereferencing and incrementing the input
array pointer. If the value of count() is negative, the index of the next coordinate is chosen
by dereferencing and incrementing the index array pointer, and that index is used to
choose the coordinate from the input array.
Example 10-2 creates a sample csTransformEng3f.
Example 10-2 Creating a csTransformEng3f
// Build transform engine
SkelCoords = new csTransformEng3f;
SkelCoords->setTransformType(csTransformEng3f::POINT);
SkelCoords->input()->setRange(0, NumRings*RingVerts, coords);
This transformation engine positions and orients the rings on the worm in worm.cxx.