2023-03-08 15:29:29 +08:00
|
|
|
/************************************************************************************//*!
|
|
|
|
\file AnimationControllerAsset.hxx
|
|
|
|
\author Tng Kah Wei, kahwei.tng, 390009620
|
|
|
|
\par email: kahwei.tng\@digipen.edu
|
|
|
|
\date Mar 8, 2023
|
|
|
|
\brief Contains the definition of the managed AnimationController class.
|
|
|
|
|
|
|
|
Note: This file is written in C++17/CLI.
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
// External Dependencies
|
|
|
|
#include "Resource/SHHandle.h"
|
|
|
|
#include "Animation/SHAnimationController.h"
|
|
|
|
// Project Includes
|
|
|
|
#include "NativeAsset.hxx"
|
|
|
|
#include "Engine/GenericHandle.hxx"
|
|
|
|
|
|
|
|
namespace SHADE
|
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// Managed counterpart of the native AnimationController object containing the
|
|
|
|
/// state machine for controlling what AnimationClips that an Animator should play.
|
|
|
|
/// </summary>
|
|
|
|
public value struct AnimationControllerAsset
|
|
|
|
{
|
2023-03-10 14:11:59 +08:00
|
|
|
public:
|
|
|
|
/*-----------------------------------------------------------------------------*/
|
|
|
|
/* Operator Overloads */
|
|
|
|
/*-----------------------------------------------------------------------------*/
|
|
|
|
/// <summary>
|
|
|
|
/// Implicit conversion operator to enable checking if a AnimationController is valid.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="gameObj">Asset to check.</param>
|
|
|
|
/// <returns>True if the Asset is valid.</returns>
|
|
|
|
static operator bool(AnimationControllerAsset asset);
|
|
|
|
|
|
|
|
internal:
|
2023-03-08 15:29:29 +08:00
|
|
|
/*-----------------------------------------------------------------------------*/
|
|
|
|
/* Properties */
|
|
|
|
/*-----------------------------------------------------------------------------*/
|
|
|
|
/// <summary>
|
|
|
|
/// Copy of the Handle to the native object.
|
|
|
|
/// </summary>
|
|
|
|
property Handle<SHAnimationController> NativeObject
|
|
|
|
{
|
|
|
|
Handle<SHAnimationController> get();
|
|
|
|
}
|
|
|
|
/// <summary>
|
|
|
|
/// The raw asset ID of the asset.
|
|
|
|
/// </summary>
|
|
|
|
property AssetID NativeAssetID
|
|
|
|
{
|
|
|
|
AssetID get();
|
|
|
|
}
|
|
|
|
|
|
|
|
/*-----------------------------------------------------------------------------*/
|
|
|
|
/* Constructors/Destructor */
|
|
|
|
/*-----------------------------------------------------------------------------*/
|
|
|
|
/// <summary>
|
|
|
|
/// Constructor for the AnimationController.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="AnimationControllerId">AssetID to the AnimationController asset.</param>
|
|
|
|
AnimationControllerAsset(AssetID AnimationControllerId);
|
|
|
|
|
|
|
|
/*-----------------------------------------------------------------------------*/
|
|
|
|
/* Conversion Operators */
|
|
|
|
/*-----------------------------------------------------------------------------*/
|
|
|
|
/// <summary>
|
|
|
|
/// Conversion operator to enable casting from a AnimationController to an Asset.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="vec">Vector3 to convert from.</param>
|
|
|
|
static explicit operator Asset(AnimationControllerAsset nativeAsset);
|
|
|
|
/// <summary>
|
|
|
|
/// Conversion operator to enable casting from a Asset to a AnimationController.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="asset"></param>
|
|
|
|
static explicit operator AnimationControllerAsset(Asset asset);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
/*-----------------------------------------------------------------------------*/
|
|
|
|
/* Data Members */
|
|
|
|
/*-----------------------------------------------------------------------------*/
|
|
|
|
Asset asset;
|
|
|
|
};
|
|
|
|
}
|