mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-15 08:34:40 +00:00
Rename all member variables to follow the style guidelines (prefixed with the 'm') - ColladaUtils (struct AnimChannels, struct AnimData, struct AnimatedElement)
This commit is contained in:
parent
9ccf5baf94
commit
40037b8b51
6 changed files with 82 additions and 82 deletions
|
|
@ -99,7 +99,7 @@ ColladaAppNode::ColladaAppNode(const domNode* node, ColladaAppNode* parent)
|
||||||
case COLLADA_TYPE::MATRIX:
|
case COLLADA_TYPE::MATRIX:
|
||||||
case COLLADA_TYPE::LOOKAT:
|
case COLLADA_TYPE::LOOKAT:
|
||||||
nodeTransforms.increment();
|
nodeTransforms.increment();
|
||||||
nodeTransforms.last().element = node->getContents()[iChild];
|
nodeTransforms.last().mElement = node->getContents()[iChild];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -232,7 +232,7 @@ MatrixF ColladaAppNode::getTransform(F32 time)
|
||||||
MatrixF mat(true);
|
MatrixF mat(true);
|
||||||
|
|
||||||
// Convert the transform element to a MatrixF
|
// Convert the transform element to a MatrixF
|
||||||
switch (nodeTransforms[iTxfm].element->getElementType()) {
|
switch (nodeTransforms[iTxfm].mElement->getElementType()) {
|
||||||
case COLLADA_TYPE::TRANSLATE: mat = vecToMatrixF<domTranslate>(nodeTransforms[iTxfm].getValue(time)); break;
|
case COLLADA_TYPE::TRANSLATE: mat = vecToMatrixF<domTranslate>(nodeTransforms[iTxfm].getValue(time)); break;
|
||||||
case COLLADA_TYPE::SCALE: mat = vecToMatrixF<domScale>(nodeTransforms[iTxfm].getValue(time)); break;
|
case COLLADA_TYPE::SCALE: mat = vecToMatrixF<domScale>(nodeTransforms[iTxfm].getValue(time)); break;
|
||||||
case COLLADA_TYPE::ROTATE: mat = vecToMatrixF<domRotate>(nodeTransforms[iTxfm].getValue(time)); break;
|
case COLLADA_TYPE::ROTATE: mat = vecToMatrixF<domRotate>(nodeTransforms[iTxfm].getValue(time)); break;
|
||||||
|
|
|
||||||
|
|
@ -88,7 +88,7 @@ void ColladaAppSequence::setAnimationActive(const domAnimation* anim, bool activ
|
||||||
domChannel* channel = anim->getChannel_array()[iChannel];
|
domChannel* channel = anim->getChannel_array()[iChannel];
|
||||||
AnimData* animData = reinterpret_cast<AnimData*>(channel->getUserData());
|
AnimData* animData = reinterpret_cast<AnimData*>(channel->getUserData());
|
||||||
if (animData)
|
if (animData)
|
||||||
animData->enabled = active;
|
animData->mEnabled = active;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Recurse into child animations
|
// Recurse into child animations
|
||||||
|
|
|
||||||
|
|
@ -108,9 +108,9 @@ protected:
|
||||||
/// Get the value of the named animated parameter (use defaultVal if parameter not found)
|
/// Get the value of the named animated parameter (use defaultVal if parameter not found)
|
||||||
template<typename T> void get(const char* name, AnimatedElement<T>& value, T defaultVal)
|
template<typename T> void get(const char* name, AnimatedElement<T>& value, T defaultVal)
|
||||||
{
|
{
|
||||||
value.defaultVal = defaultVal;
|
value.mDefaultVal = defaultVal;
|
||||||
if (const domAny* param = findParam(name))
|
if (const domAny* param = findParam(name))
|
||||||
value.element = param;
|
value.mElement = param;
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
|
|
@ -160,14 +160,14 @@ void ColladaShapeLoader::processAnimation(const domAnimation* anim, F32& maxEndT
|
||||||
// @todo:don't care about the input param names for now. Could
|
// @todo:don't care about the input param names for now. Could
|
||||||
// validate against the target type....
|
// validate against the target type....
|
||||||
if (dStrEqual(input->getSemantic(), "INPUT")) {
|
if (dStrEqual(input->getSemantic(), "INPUT")) {
|
||||||
data.input.initFromSource(source);
|
data.mInput.initFromSource(source);
|
||||||
// Adjust the maximum sequence end time
|
// Adjust the maximum sequence end time
|
||||||
maxEndTime = getMax(maxEndTime, data.input.getFloatValue((S32)data.input.size()-1));
|
maxEndTime = getMax(maxEndTime, data.mInput.getFloatValue((S32)data.mInput.size()-1));
|
||||||
|
|
||||||
// Detect the frame rate (minimum time between keyframes)
|
// Detect the frame rate (minimum time between keyframes)
|
||||||
for (S32 iFrame = 1; iFrame < data.input.size(); iFrame++)
|
for (S32 iFrame = 1; iFrame < data.mInput.size(); iFrame++)
|
||||||
{
|
{
|
||||||
F32 delta = data.input.getFloatValue( iFrame ) - data.input.getFloatValue( iFrame-1 );
|
F32 delta = data.mInput.getFloatValue( iFrame ) - data.mInput.getFloatValue( iFrame-1 );
|
||||||
if ( delta < 0 )
|
if ( delta < 0 )
|
||||||
{
|
{
|
||||||
daeErrorHandler::get()->handleError(avar("<animation> INPUT '%s' "
|
daeErrorHandler::get()->handleError(avar("<animation> INPUT '%s' "
|
||||||
|
|
@ -178,13 +178,13 @@ void ColladaShapeLoader::processAnimation(const domAnimation* anim, F32& maxEndT
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (dStrEqual(input->getSemantic(), "OUTPUT"))
|
else if (dStrEqual(input->getSemantic(), "OUTPUT"))
|
||||||
data.output.initFromSource(source);
|
data.mOutput.initFromSource(source);
|
||||||
else if (dStrEqual(input->getSemantic(), "IN_TANGENT"))
|
else if (dStrEqual(input->getSemantic(), "IN_TANGENT"))
|
||||||
data.inTangent.initFromSource(source);
|
data.mInTangent.initFromSource(source);
|
||||||
else if (dStrEqual(input->getSemantic(), "OUT_TANGENT"))
|
else if (dStrEqual(input->getSemantic(), "OUT_TANGENT"))
|
||||||
data.outTangent.initFromSource(source);
|
data.mOutTangent.initFromSource(source);
|
||||||
else if (dStrEqual(input->getSemantic(), "INTERPOLATION"))
|
else if (dStrEqual(input->getSemantic(), "INTERPOLATION"))
|
||||||
data.interpolation.initFromSource(source);
|
data.mInterpolation.initFromSource(source);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set initial value for visibility targets that were added automatically (in colladaUtils.cpp
|
// Set initial value for visibility targets that were added automatically (in colladaUtils.cpp
|
||||||
|
|
@ -192,11 +192,11 @@ void ColladaShapeLoader::processAnimation(const domAnimation* anim, F32& maxEndT
|
||||||
{
|
{
|
||||||
domAny* visTarget = daeSafeCast<domAny>(target);
|
domAny* visTarget = daeSafeCast<domAny>(target);
|
||||||
if (visTarget && dStrEqual(visTarget->getValue(), ""))
|
if (visTarget && dStrEqual(visTarget->getValue(), ""))
|
||||||
visTarget->setValue(avar("%g", data.output.getFloatValue(0)));
|
visTarget->setValue(avar("%g", data.mOutput.getFloatValue(0)));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ignore empty animations
|
// Ignore empty animations
|
||||||
if (data.input.size() == 0) {
|
if (data.mInput.size() == 0) {
|
||||||
channel->setUserData(0);
|
channel->setUserData(0);
|
||||||
delete targetChannels->last();
|
delete targetChannels->last();
|
||||||
targetChannels->pop_back();
|
targetChannels->pop_back();
|
||||||
|
|
|
||||||
|
|
@ -248,27 +248,27 @@ BasePrimitive* BasePrimitive::get(const daeElement* element)
|
||||||
void AnimData::parseTargetString(const char* target, S32 fullCount, const char* elements[])
|
void AnimData::parseTargetString(const char* target, S32 fullCount, const char* elements[])
|
||||||
{
|
{
|
||||||
// Assume targeting all elements at offset 0
|
// Assume targeting all elements at offset 0
|
||||||
targetValueCount = fullCount;
|
mTargetValueCount = fullCount;
|
||||||
targetValueOffset = 0;
|
mTargetValueOffset = 0;
|
||||||
|
|
||||||
// Check for array syntax: (n) or (n)(m)
|
// Check for array syntax: (n) or (n)(m)
|
||||||
if (const char* p = dStrchr(target, '(')) {
|
if (const char* p = dStrchr(target, '(')) {
|
||||||
S32 indN, indM;
|
S32 indN, indM;
|
||||||
if (dSscanf(p, "(%d)(%d)", &indN, &indM) == 2) {
|
if (dSscanf(p, "(%d)(%d)", &indN, &indM) == 2) {
|
||||||
targetValueOffset = (indN * 4) + indM; // @todo: 4x4 matrix only
|
mTargetValueOffset = (indN * 4) + indM; // @todo: 4x4 matrix only
|
||||||
targetValueCount = 1;
|
mTargetValueCount = 1;
|
||||||
}
|
}
|
||||||
else if (dSscanf(p, "(%d)", &indN) == 1) {
|
else if (dSscanf(p, "(%d)", &indN) == 1) {
|
||||||
targetValueOffset = indN;
|
mTargetValueOffset = indN;
|
||||||
targetValueCount = 1;
|
mTargetValueCount = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (const char* p = dStrrchr(target, '.')) {
|
else if (const char* p = dStrrchr(target, '.')) {
|
||||||
// Check for named elements
|
// Check for named elements
|
||||||
for (S32 iElem = 0; elements[iElem][0] != 0; iElem++) {
|
for (S32 iElem = 0; elements[iElem][0] != 0; iElem++) {
|
||||||
if (!dStrcmp(p, elements[iElem])) {
|
if (!dStrcmp(p, elements[iElem])) {
|
||||||
targetValueOffset = iElem;
|
mTargetValueOffset = iElem;
|
||||||
targetValueCount = 1;
|
mTargetValueCount = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -327,47 +327,47 @@ F32 AnimData::invertParamCubic(F32 param, F32 x0, F32 x1, F32 x2, F32 x3) const
|
||||||
void AnimData::interpValue(F32 t, U32 offset, double* value) const
|
void AnimData::interpValue(F32 t, U32 offset, double* value) const
|
||||||
{
|
{
|
||||||
// handle degenerate animation data
|
// handle degenerate animation data
|
||||||
if (input.size() == 0)
|
if (mInput.size() == 0)
|
||||||
{
|
{
|
||||||
*value = 0.0f;
|
*value = 0.0f;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (input.size() == 1)
|
else if (mInput.size() == 1)
|
||||||
{
|
{
|
||||||
*value = output.getStringArrayData(0)[offset];
|
*value = mOutput.getStringArrayData(0)[offset];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// clamp time to valid range
|
// clamp time to valid range
|
||||||
F32 curveStart = input.getFloatValue(0);
|
F32 curveStart = mInput.getFloatValue(0);
|
||||||
F32 curveEnd = input.getFloatValue(input.size()-1);
|
F32 curveEnd = mInput.getFloatValue(mInput.size()-1);
|
||||||
t = mClampF(t, curveStart, curveEnd);
|
t = mClampF(t, curveStart, curveEnd);
|
||||||
|
|
||||||
// find the index of the input keyframe BEFORE 't'
|
// find the index of the input keyframe BEFORE 't'
|
||||||
S32 index;
|
S32 index;
|
||||||
for (index = 0; index < input.size()-2; index++) {
|
for (index = 0; index < mInput.size()-2; index++) {
|
||||||
if (input.getFloatValue(index + 1) > t)
|
if (mInput.getFloatValue(index + 1) > t)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// get the data for the two control points either side of 't'
|
// get the data for the two control points either side of 't'
|
||||||
Point2F v0;
|
Point2F v0;
|
||||||
v0.x = input.getFloatValue(index);
|
v0.x = mInput.getFloatValue(index);
|
||||||
v0.y = output.getStringArrayData(index)[offset];
|
v0.y = mOutput.getStringArrayData(index)[offset];
|
||||||
|
|
||||||
Point2F v3;
|
Point2F v3;
|
||||||
v3.x = input.getFloatValue(index + 1);
|
v3.x = mInput.getFloatValue(index + 1);
|
||||||
v3.y = output.getStringArrayData(index + 1)[offset];
|
v3.y = mOutput.getStringArrayData(index + 1)[offset];
|
||||||
|
|
||||||
// If spline interpolation is specified but the tangents are not available,
|
// If spline interpolation is specified but the tangents are not available,
|
||||||
// default to LINEAR.
|
// default to LINEAR.
|
||||||
const char* interp_method = interpolation.getStringValue(index);
|
const char* interp_method = mInterpolation.getStringValue(index);
|
||||||
if (dStrEqual(interp_method, "BEZIER") ||
|
if (dStrEqual(interp_method, "BEZIER") ||
|
||||||
dStrEqual(interp_method, "HERMITE") ||
|
dStrEqual(interp_method, "HERMITE") ||
|
||||||
dStrEqual(interp_method, "CARDINAL")) {
|
dStrEqual(interp_method, "CARDINAL")) {
|
||||||
|
|
||||||
const double* inArray = inTangent.getStringArrayData(index + 1);
|
const double* inArray = mInTangent.getStringArrayData(index + 1);
|
||||||
const double* outArray = outTangent.getStringArrayData(index);
|
const double* outArray = mOutTangent.getStringArrayData(index);
|
||||||
if (!inArray || !outArray)
|
if (!inArray || !outArray)
|
||||||
interp_method = "LINEAR";
|
interp_method = "LINEAR";
|
||||||
}
|
}
|
||||||
|
|
@ -398,17 +398,17 @@ void AnimData::interpValue(F32 t, U32 offset, double* value) const
|
||||||
v2 = v3;
|
v2 = v3;
|
||||||
|
|
||||||
if (index > 0) {
|
if (index > 0) {
|
||||||
v0.x = input.getFloatValue(index-1);
|
v0.x = mInput.getFloatValue(index-1);
|
||||||
v0.y = output.getStringArrayData(index-1)[offset];
|
v0.y = mOutput.getStringArrayData(index-1)[offset];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// mirror P1 through P0
|
// mirror P1 through P0
|
||||||
v0 = v1 + (v1 - v2);
|
v0 = v1 + (v1 - v2);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (index < (input.size()-2)) {
|
if (index < (mInput.size()-2)) {
|
||||||
v3.x = input.getFloatValue(index+2);
|
v3.x = mInput.getFloatValue(index+2);
|
||||||
v3.y = output.getStringArrayData(index+2)[offset];
|
v3.y = mOutput.getStringArrayData(index+2)[offset];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// mirror P0 through P1
|
// mirror P0 through P1
|
||||||
|
|
@ -416,10 +416,10 @@ void AnimData::interpValue(F32 t, U32 offset, double* value) const
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
const double* inArray = inTangent.getStringArrayData(index + 1);
|
const double* inArray = mInTangent.getStringArrayData(index + 1);
|
||||||
const double* outArray = outTangent.getStringArrayData(index);
|
const double* outArray = mOutTangent.getStringArrayData(index);
|
||||||
|
|
||||||
if (output.stride() == inTangent.stride()) {
|
if (mOutput.stride() == mInTangent.stride()) {
|
||||||
// This degenerate form (1D control points) does 2 things wrong:
|
// This degenerate form (1D control points) does 2 things wrong:
|
||||||
// 1) it does not specify the key (time) value
|
// 1) it does not specify the key (time) value
|
||||||
// 2) the control point is specified as a tangent for both bezier and hermite
|
// 2) the control point is specified as a tangent for both bezier and hermite
|
||||||
|
|
@ -458,27 +458,27 @@ void AnimData::interpValue(F32 t, U32 offset, double* value) const
|
||||||
|
|
||||||
void AnimData::interpValue(F32 t, U32 offset, const char** value) const
|
void AnimData::interpValue(F32 t, U32 offset, const char** value) const
|
||||||
{
|
{
|
||||||
if (input.size() == 0)
|
if (mInput.size() == 0)
|
||||||
*value = "";
|
*value = "";
|
||||||
else if (input.size() == 1)
|
else if (mInput.size() == 1)
|
||||||
*value = output.getStringValue(0);
|
*value = mOutput.getStringValue(0);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// clamp time to valid range
|
// clamp time to valid range
|
||||||
F32 curveStart = input.getFloatValue(0);
|
F32 curveStart = mInput.getFloatValue(0);
|
||||||
F32 curveEnd = input.getFloatValue(input.size()-1);
|
F32 curveEnd = mInput.getFloatValue(mInput.size()-1);
|
||||||
t = mClampF(t, curveStart, curveEnd);
|
t = mClampF(t, curveStart, curveEnd);
|
||||||
|
|
||||||
// find the index of the input keyframe BEFORE 't'
|
// find the index of the input keyframe BEFORE 't'
|
||||||
S32 index;
|
S32 index;
|
||||||
for (index = 0; index < input.size()-2; index++) {
|
for (index = 0; index < mInput.size()-2; index++) {
|
||||||
if (input.getFloatValue(index + 1) > t)
|
if (mInput.getFloatValue(index + 1) > t)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// String values only support STEP interpolation, so just get the
|
// String values only support STEP interpolation, so just get the
|
||||||
// value at the input keyframe
|
// value at the input keyframe
|
||||||
*value = output.getStringValue(index);
|
*value = mOutput.getStringValue(index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -678,32 +678,32 @@ template<> inline F32 convert(const char* value) { return convert<double>(value)
|
||||||
/// Collada animation data
|
/// Collada animation data
|
||||||
struct AnimChannels : public Vector<struct AnimData*>
|
struct AnimChannels : public Vector<struct AnimData*>
|
||||||
{
|
{
|
||||||
daeElement *element;
|
daeElement *mElement;
|
||||||
AnimChannels(daeElement* el) : element(el)
|
AnimChannels(daeElement* el) : mElement(el)
|
||||||
{
|
{
|
||||||
element->setUserData(this);
|
mElement->setUserData(this);
|
||||||
}
|
}
|
||||||
~AnimChannels()
|
~AnimChannels()
|
||||||
{
|
{
|
||||||
if (element)
|
if (mElement)
|
||||||
element->setUserData(0);
|
mElement->setUserData(0);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct AnimData
|
struct AnimData
|
||||||
{
|
{
|
||||||
bool enabled; ///!< Used to select animation channels for the current clip
|
bool mEnabled; ///!< Used to select animation channels for the current clip
|
||||||
|
|
||||||
_SourceReader input;
|
_SourceReader mInput;
|
||||||
_SourceReader output;
|
_SourceReader mOutput;
|
||||||
|
|
||||||
_SourceReader inTangent;
|
_SourceReader mInTangent;
|
||||||
_SourceReader outTangent;
|
_SourceReader mOutTangent;
|
||||||
|
|
||||||
_SourceReader interpolation;
|
_SourceReader mInterpolation;
|
||||||
|
|
||||||
U32 targetValueOffset; ///< Offset into the target element (for arrays of values)
|
U32 mTargetValueOffset; ///< Offset into the target element (for arrays of values)
|
||||||
U32 targetValueCount; ///< Number of values animated (from OUTPUT source array)
|
U32 mTargetValueCount; ///< Number of values animated (from OUTPUT source array)
|
||||||
|
|
||||||
/// Get the animation channels for the Collada element (if any)
|
/// Get the animation channels for the Collada element (if any)
|
||||||
static AnimChannels* getAnimChannels(const daeElement* element)
|
static AnimChannels* getAnimChannels(const daeElement* element)
|
||||||
|
|
@ -711,7 +711,7 @@ struct AnimData
|
||||||
return element ? (AnimChannels*)const_cast<daeElement*>(element)->getUserData() : 0;
|
return element ? (AnimChannels*)const_cast<daeElement*>(element)->getUserData() : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
AnimData() : enabled(false) { }
|
AnimData() : mEnabled(false) { }
|
||||||
|
|
||||||
void parseTargetString(const char* target, S32 fullCount, const char* elements[]);
|
void parseTargetString(const char* target, S32 fullCount, const char* elements[]);
|
||||||
|
|
||||||
|
|
@ -735,13 +735,13 @@ struct AnimData
|
||||||
template<class T>
|
template<class T>
|
||||||
struct AnimatedElement
|
struct AnimatedElement
|
||||||
{
|
{
|
||||||
const daeElement* element; ///< The Collada element (can be NULL)
|
const daeElement* mElement; ///< The Collada element (can be NULL)
|
||||||
T defaultVal; ///< Default value (used when element is NULL)
|
T mDefaultVal; ///< Default value (used when element is NULL)
|
||||||
|
|
||||||
AnimatedElement(const daeElement* e=0) : element(e) { }
|
AnimatedElement(const daeElement* e=0) : mElement(e) { }
|
||||||
|
|
||||||
/// Check if the element has any animations channels
|
/// Check if the element has any animations channels
|
||||||
bool isAnimated() { return (AnimData::getAnimChannels(element) != 0); }
|
bool isAnimated() { return (AnimData::getAnimChannels(mElement) != 0); }
|
||||||
bool isAnimated(F32 start, F32 end) { return isAnimated(); }
|
bool isAnimated(F32 start, F32 end) { return isAnimated(); }
|
||||||
|
|
||||||
/// Get the value of the element at the specified time
|
/// Get the value of the element at the specified time
|
||||||
|
|
@ -749,17 +749,17 @@ struct AnimatedElement
|
||||||
{
|
{
|
||||||
// If the element is NULL, just use the default (handy for <extra> profiles which
|
// If the element is NULL, just use the default (handy for <extra> profiles which
|
||||||
// may or may not be present in the document)
|
// may or may not be present in the document)
|
||||||
T value(defaultVal);
|
T value(mDefaultVal);
|
||||||
if (const domAny* param = daeSafeCast<domAny>(const_cast<daeElement*>(element))) {
|
if (const domAny* param = daeSafeCast<domAny>(const_cast<daeElement*>(mElement))) {
|
||||||
// If the element is not animated, just use its current value
|
// If the element is not animated, just use its current value
|
||||||
value = convert<T>(param->getValue());
|
value = convert<T>(param->getValue());
|
||||||
|
|
||||||
// Animate the value
|
// Animate the value
|
||||||
const AnimChannels* channels = AnimData::getAnimChannels(element);
|
const AnimChannels* channels = AnimData::getAnimChannels(mElement);
|
||||||
if (channels && (time >= 0)) {
|
if (channels && (time >= 0)) {
|
||||||
for (S32 iChannel = 0; iChannel < channels->size(); iChannel++) {
|
for (S32 iChannel = 0; iChannel < channels->size(); iChannel++) {
|
||||||
const AnimData* animData = (*channels)[iChannel];
|
const AnimData* animData = (*channels)[iChannel];
|
||||||
if (animData->enabled)
|
if (animData->mEnabled)
|
||||||
animData->interpValue(time, 0, &value);
|
animData->interpValue(time, 0, &value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -779,19 +779,19 @@ template<class T> struct AnimatedElementList : public AnimatedElement<T>
|
||||||
// Get the value of the element list at the specified time
|
// Get the value of the element list at the specified time
|
||||||
T getValue(F32 time)
|
T getValue(F32 time)
|
||||||
{
|
{
|
||||||
T vec(this->defaultVal);
|
T vec(this->mDefaultVal);
|
||||||
if (this->element) {
|
if (this->mElement) {
|
||||||
// Get a copy of the vector
|
// Get a copy of the vector
|
||||||
vec = *(T*)const_cast<daeElement*>(this->element)->getValuePointer();
|
vec = *(T*)const_cast<daeElement*>(this->mElement)->getValuePointer();
|
||||||
|
|
||||||
// Animate the vector
|
// Animate the vector
|
||||||
const AnimChannels* channels = AnimData::getAnimChannels(this->element);
|
const AnimChannels* channels = AnimData::getAnimChannels(this->mElement);
|
||||||
if (channels && (time >= 0)) {
|
if (channels && (time >= 0)) {
|
||||||
for (S32 iChannel = 0; iChannel < channels->size(); iChannel++) {
|
for (S32 iChannel = 0; iChannel < channels->size(); iChannel++) {
|
||||||
const AnimData* animData = (*channels)[iChannel];
|
const AnimData* animData = (*channels)[iChannel];
|
||||||
if (animData->enabled) {
|
if (animData->mEnabled) {
|
||||||
for (S32 iValue = 0; iValue < animData->targetValueCount; iValue++)
|
for (S32 iValue = 0; iValue < animData->mTargetValueCount; iValue++)
|
||||||
animData->interpValue(time, iValue, &vec[animData->targetValueOffset + iValue]);
|
animData->interpValue(time, iValue, &vec[animData->mTargetValueOffset + iValue]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue