void RigAnim::GetSplinesAndConstants(BoneIndex bone, const MatrixOperationType* ops, int num_ops, const CompactSpline** splines, float* constants) const { const std::vector<MatrixOperationInit>& matrix_ops = Anim(bone).ops(); for (int i = 0; i < num_ops; ++i) { const MatrixOperationType op = ops[i]; const MatrixOperationType alternate_op = ScaleOp(op) ? kScaleUniformly : kInvalidMatrixOperation; // Initialize return values. If the operation isn't found, we return these // default values. splines[i] = nullptr; constants[i] = OperationDefaultValue(op); // Loop through all the operations on this matrix. for (auto it = matrix_ops.begin(); it != matrix_ops.end(); ++it) { if (it->type != op && it->type != alternate_op) continue; // Use the first operation that matches. switch (it->union_type) { case MatrixOperationInit::kUnionInitialValue: constants[i] = it->initial_value; break; case MatrixOperationInit::kUnionSpline: splines[i] = it->spline; break; default: // We don't support other types of initialization. break; } break; } } }
ScaleOp float3x3::UniformScale(float uniformScale) { return ScaleOp(uniformScale, uniformScale, uniformScale); }
ScaleOp float3x3::Scale(const float3 &scale) { return ScaleOp(scale); }
ScaleOp float3x3::Scale(float sx, float sy, float sz) { return ScaleOp(sx, sy, sz); }
ScaleOp float3x4::Scale(const float4 &scale) { return ScaleOp(scale); }