本文整理汇总了C++中Model::Bones方法的典型用法代码示例。如果您正苦于以下问题:C++ Model::Bones方法的具体用法?C++ Model::Bones怎么用?C++ Model::Bones使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Model
的用法示例。
在下文中一共展示了Model::Bones方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GameComponent
AnimationPlayer::AnimationPlayer(Game::GameBase& game, Model& model, bool interpolationEnabled)
: GameComponent(game),
mModel(&model), mCurrentClip(nullptr), mCurrentTime(0.0f), mCurrentKeyframe(0U), mToRootTransforms(), mFinalTransforms(),
mInverseRootTransform(MatrixHelper::Identity), mInterpolationEnabled(interpolationEnabled), mIsPlayingClip(false), mIsClipLooped(true)
{
mFinalTransforms.resize(model.Bones().size());
}
示例2: mModel
BoneAnimation::BoneAnimation(Model& model, aiNodeAnim& nodeAnim)
: mModel(&model), mBone(nullptr), mKeyframes(), mBoneIndex()
{
mBoneIndex = model.BoneIndexMapping().at(nodeAnim.mNodeName.C_Str());
mBone = model.Bones().at(mBoneIndex);
assert(nodeAnim.mNumPositionKeys == nodeAnim.mNumRotationKeys);
assert(nodeAnim.mNumPositionKeys == nodeAnim.mNumScalingKeys);
for (UINT i = 0; i < nodeAnim.mNumPositionKeys; i++)
{
aiVectorKey positionKey = nodeAnim.mPositionKeys[i];
aiQuatKey rotationKey = nodeAnim.mRotationKeys[i];
aiVectorKey scaleKey = nodeAnim.mScalingKeys[i];
assert(positionKey.mTime == rotationKey.mTime);
assert(positionKey.mTime == scaleKey.mTime);
Keyframe* keyframe = new Keyframe(static_cast<float>(positionKey.mTime), XMFLOAT3(positionKey.mValue.x, positionKey.mValue.y, positionKey.mValue.z),
XMFLOAT4(rotationKey.mValue.x, rotationKey.mValue.y, rotationKey.mValue.z, rotationKey.mValue.w), XMFLOAT3(scaleKey.mValue.x, scaleKey.mValue.y, scaleKey.mValue.z));
mKeyframes.push_back(keyframe);
}
}