示例#1
0
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;
    }
  }
}
示例#2
0
文件: float3x3.cpp 项目: Ilikia/naali
ScaleOp float3x3::UniformScale(float uniformScale)
{
    return ScaleOp(uniformScale, uniformScale, uniformScale);
}
示例#3
0
文件: float3x3.cpp 项目: Ilikia/naali
ScaleOp float3x3::Scale(const float3 &scale)
{
    return ScaleOp(scale);
}
示例#4
0
文件: float3x3.cpp 项目: Ilikia/naali
ScaleOp float3x3::Scale(float sx, float sy, float sz)
{
    return ScaleOp(sx, sy, sz);
}
示例#5
0
ScaleOp float3x4::Scale(const float4 &scale)
{
	return ScaleOp(scale);
}