Bubba-3D  0.9.0
Awesome game engine!
Public Member Functions | List of all members
BoneTransformer Class Reference

#include <BoneTransformer.h>

Public Member Functions

 BoneTransformer (aiScene *aiScene)
 
std::vector< chag::float4x4 > calculateBoneTransforms (float totalElapsedTimeInSeconds)
 
int createBoneIndexIfAbsent (const aiBone *bone)
 

Detailed Description

Class for calculating the transform of all bones at a certain tick in a mesh.

Usage:

aiScene assimpScene;
BoneTransformer boneTransformer(assimpScene->mMeshes[0]);
for(unsigned int i = 0; i < assimpScene->mMeshes[0]->mNumBones; i++) {
int boneIndex = boneTransformer->createBoneIndexIfAbsent(paiMesh->mBones[i]);
}
std::vector<chag::float4x4> boneTransforms = boneTransformer.calculateBoneTransforms(elapsedTimeInSeconds);
//boneTransforms will now contain the transformation of each bone. Each index corresponds the boneIndex calculated in the for loop.

Definition at line 46 of file BoneTransformer.h.

Member Function Documentation

std::vector< chag::float4x4 > BoneTransformer::calculateBoneTransforms ( float  totalElapsedTimeInSeconds)

Calculates the transform to be applied to each bone at the current time.

Parameters
totalElapsedTimeInSecondsThe time since the application was started
Returns
A vector containing the transforms of each bone. The index in the vector corresponds to the bones index. The index of a bone can be found in boneNameToIndexMapping.

Definition at line 219 of file BoneTransformer.cpp.

int BoneTransformer::createBoneIndexIfAbsent ( const aiBone *  bone)

Updates the bonetransformer to include the bone if not already present.

Parameters
boneThe bone to add
Returns
The index of the bone

Definition at line 235 of file BoneTransformer.cpp.


The documentation for this class was generated from the following files: