Physic rebuild start

This commit is contained in:
2025-01-15 18:33:02 +01:00
parent 58cafd7682
commit c707e49561
6 changed files with 188 additions and 116 deletions

View File

@@ -3,6 +3,13 @@
#include <WICTextureLoader.h>
#include <SimpleMath.h>
enum class ObjectType
{
Sphere,
Cube,
Unknown
};
class Object : public ModelClass
{
public:
@@ -30,7 +37,7 @@ public:
XMVECTOR GetScale();
void SetVelocity(XMVECTOR);
void AddVelocity(float);
void AddVelocity(float deltaTime);
XMVECTOR GetVelocity() const;
void SetAcceleration(XMVECTOR);
XMVECTOR GetAcceleration() const;
@@ -54,6 +61,8 @@ public:
void SetName(std::string name);
int SetId(int id);
int GetId() const;
void SetType(ObjectType type) { m_type = type; };
ObjectType GetType() const { return m_type; };
bool LoadTexture(ID3D11Device* device, ID3D11DeviceContext* deviceContext, const std::wstring& filename);
@@ -88,9 +97,10 @@ private:
XMVECTOR m_acceleration;
float m_mass;
bool m_isGrounded;
bool m_isPhysicsEnabled;
bool m_isPhysicsEnabled = false;
std::string m_name;
ObjectType m_type = ObjectType::Unknown;
ShaderType m_activeShader = LIGHTING;