1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 20:42:21 +02:00

Initial checkin

This commit is contained in:
Brian Fiete 2019-08-23 11:56:54 -07:00
parent c74712dad9
commit 078564ac9e
3242 changed files with 1616395 additions and 0 deletions

View file

@ -0,0 +1,78 @@
#pragma once
#include "Common.h"
#include "util/Quaternion.h"
#include "util/Vector.h"
#include <vector>
NS_BF_BEGIN;
class ModelJointTranslation
{
public:
Quaternion mQuat;
Vector3 mScale;
Vector3 mTrans;
};
class ModelAnimationFrame
{
public:
std::vector<ModelJointTranslation> mJointTranslations;
};
class ModelAnimation
{
public:
String mName;
std::vector<ModelAnimationFrame> mFrames;
public:
void GetJointTranslation(int jointIdx, float frameNum, ModelJointTranslation* outJointTranslation);
};
#define MODEL_MAX_BONE_WEIGHTS 8
class ModelVertex
{
public:
Vector3 mPosition;
uint32 mColor;
TexCoords mTexCoords;
TexCoords mBumpTexCoords;
Vector3 mNormal;
Vector3 mTangent;
int mNumBoneWeights;
int mBoneIndices[MODEL_MAX_BONE_WEIGHTS];
float mBoneWeights[MODEL_MAX_BONE_WEIGHTS];
};
class ModelJoint
{
public:
String mName;
int mParentIdx;
Matrix4 mPoseInvMatrix;
};
class ModelMesh
{
public:
String mName;
std::vector<ModelVertex> mVertices;
std::vector<uint16> mIndices;
String mTexFileName;
String mBumpFileName;
};
class ModelDef
{
public:
String mLoadDir;
float mFrameRate;
std::vector<ModelMesh> mMeshes;
std::vector<ModelJoint> mJoints;
std::vector<ModelAnimation> mAnims;
};
NS_BF_END;