Added SHAnimationClip stub

This commit is contained in:
Kah Wei 2022-12-20 17:26:27 +08:00
parent 51479d2bd0
commit b402a44d95
4 changed files with 130 additions and 0 deletions

View File

@ -0,0 +1,32 @@
/************************************************************************************//*!
\file SHAnimationClip.cpp
\author Tng Kah Wei, kahwei.tng, 390009620
\par email: kahwei.tng\@digipen.edu
\date Nov 20, 2022
\brief Contains the function definitions of the SHAnimationClip class.
Copyright (C) 2022 DigiPen Institute of Technology.
Reproduction or disclosure of this file or its contents without the prior written consent
of DigiPen Institute of Technology is prohibited.
*//*************************************************************************************/
// Pre-compiled Header
#include "SHpch.h"
// Primary Header
#include "SHAnimationClip.h"
namespace SHADE
{
/*-----------------------------------------------------------------------------------*/
/* Constructors */
/*-----------------------------------------------------------------------------------*/
/*-----------------------------------------------------------------------------------*/
/* Usage Functions */
/*-----------------------------------------------------------------------------------*/
/*-----------------------------------------------------------------------------------*/
/* Helper Functions */
/*-----------------------------------------------------------------------------------*/
}

View File

@ -0,0 +1,71 @@
/************************************************************************************//*!
\file SHAnimationClip.h
\author Tng Kah Wei, kahwei.tng, 390009620
\par email: kahwei.tng\@digipen.edu
\date Dec 12, 2022
\brief Contains the definition of the SHAnimationClip struct and related types.
Copyright (C) 2022 DigiPen Institute of Technology.
Reproduction or disclosure of this file or its contents without the prior written consent
of DigiPen Institute of Technology is prohibited.
*//*************************************************************************************/
#pragma once
// STL Includes
// Project Includes
#include "Math/SHMatrix.h"
#include "Assets/Asset Types/Models/SHAnimationAsset.h"
namespace SHADE
{
/*-----------------------------------------------------------------------------------*/
/* Forward Declarations */
/*-----------------------------------------------------------------------------------*/
/*-----------------------------------------------------------------------------------*/
/* Type Definitions */
/*-----------------------------------------------------------------------------------*/
struct SHAnimationKeyFrame
{
float TimeStamp;
SHVec3 Position;
SHQuaternion Orientation;
SHVec3 Scale;
SHMatrix TransformationMatrix;
};
class SHAnimationClip
{
/*---------------------------------------------------------------------------------*/
/* Type Definitions */
/*---------------------------------------------------------------------------------*/
struct Channel
{
std::string Name;
std::vector<SHAnimationKeyFrame> KeyFrames;
};
/*---------------------------------------------------------------------------------*/
/* Constructors */
/*---------------------------------------------------------------------------------*/
explicit SHAnimationClip(const SHAnimAsset& asset);
/*---------------------------------------------------------------------------------*/
/* Getter Functions */
/*---------------------------------------------------------------------------------*/
private:
/*---------------------------------------------------------------------------------*/
/* Data Members */
/*---------------------------------------------------------------------------------*/
std::vector<Channel> Channels;
/*---------------------------------------------------------------------------------*/
/* Helper Functions */
/*---------------------------------------------------------------------------------*/
};
}

View File

@ -19,6 +19,28 @@ of DigiPen Institute of Technology is prohibited.
namespace SHADE namespace SHADE
{ {
/*-----------------------------------------------------------------------------------*/
/* Setter Functions */
/*-----------------------------------------------------------------------------------*/
void SHAnimatorComponent::SetRig(Handle<SHRig> newRig)
{
// Same rig, don't bother
if (rig == newRig)
return;
rig = newRig;
// Populate bone matrices based on new rig's default pose
if (rig)
{
}
else
{
boneMatrices.clear();
}
}
/*-----------------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------------------*/
/* Update Functions */ /* Update Functions */
/*-----------------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------------------*/

View File

@ -45,6 +45,11 @@ namespace SHADE
void Pause(); void Pause();
void Stop();*/ void Stop();*/
/*---------------------------------------------------------------------------------*/
/* Setter Functions */
/*---------------------------------------------------------------------------------*/
void SetRig(Handle<SHRig> newRig);
/*---------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------*/
/* Getter Functions */ /* Getter Functions */
/*---------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------*/