SHADE_Y3/SHADE_Engine/SHGhostBody.h

65 lines
2.5 KiB
C++

/****************************************************************************************
* \file SHGhostBody.h
* \author Diren D Bharwani, diren.dbharwani, 390002520
* \brief Interface for the Ghost Body meant for Simulation.
*
* \copyright 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
// Project Headers
#include "Physics/Interface/SHRigidBodyComponent.h"
namespace SHADE
{
/*-----------------------------------------------------------------------------------*/
/* Type Definitions */
/*-----------------------------------------------------------------------------------*/
/**
* @brief
* Encapsulates a rigid body that will be simulated in the world, but doesn't actually
* exist in the world.
*/
struct SHGhostBody
{
public:
/*---------------------------------------------------------------------------------*/
/* Data Members */
/*---------------------------------------------------------------------------------*/
SHVec3 linearVelocity = SHVec3::Zero;
SHVec3 angularVelocity = SHVec3::Zero;
SHVec3 localInvInertia = SHVec3::One;
SHVec3 localCentroid = SHVec3::Zero;
SHVec3 accumulatedForce = SHVec3::Zero;
SHVec3 accumulatedTorque = SHVec3::Zero;
SHVec3 linearLock = SHVec3::One;
SHVec3 angularLock = SHVec3::One;
float gravityScale = 1.0f;
float mass = 1.0f;
float drag = 0.01f;
float angularDrag = 0.01f;
SHVec3 position = SHVec3::Zero;
SHQuaternion orientation = SHQuaternion::Identity;
bool useGravity = true;
/*---------------------------------------------------------------------------------*/
/* Constructors & Destructor */
/*---------------------------------------------------------------------------------*/
SHGhostBody () noexcept = default;
SHGhostBody (const SHRigidBodyComponent& rigidBody) noexcept;
};
} // namespace SHADE