Major update - Architecture Rework
This commit is contained in:
112
enginecustom/src/inc/system/object.h
Normal file
112
enginecustom/src/inc/system/object.h
Normal file
@@ -0,0 +1,112 @@
|
||||
#pragma once
|
||||
#include "modelclass.h"
|
||||
#include <WICTextureLoader.h>
|
||||
#include <SimpleMath.h>
|
||||
|
||||
enum class ObjectType
|
||||
{
|
||||
Sphere,
|
||||
Cube,
|
||||
Unknown
|
||||
};
|
||||
|
||||
class Object : public ModelClass
|
||||
{
|
||||
public:
|
||||
Object();
|
||||
~Object();
|
||||
|
||||
void SetScaleMatrix(XMMATRIX scaleMatrix);
|
||||
void SetRotateMatrix(XMMATRIX rotateMatrix);
|
||||
void SetTranslateMatrix(XMMATRIX translateMatrix);
|
||||
void SetSRMatrix(XMMATRIX srMatrix);
|
||||
void SetWorldMatrix(XMMATRIX worldMatrix);
|
||||
|
||||
void SetPosition(XMVECTOR position);
|
||||
void SetRotation(XMVECTOR rotation);
|
||||
void SetScale(XMVECTOR scale);
|
||||
|
||||
XMMATRIX GetScaleMatrix() const;
|
||||
XMMATRIX GetRotateMatrix() const;
|
||||
XMMATRIX GetTranslateMatrix() const;
|
||||
XMMATRIX GetSRMatrix() const;
|
||||
XMMATRIX GetWorldMatrix() const;
|
||||
|
||||
XMVECTOR GetPosition();
|
||||
XMVECTOR GetRotation();
|
||||
XMVECTOR GetScale();
|
||||
|
||||
void SetVelocity(XMVECTOR);
|
||||
void AddVelocity(float deltaTime);
|
||||
XMVECTOR GetVelocity() const;
|
||||
void SetAcceleration(XMVECTOR);
|
||||
XMVECTOR GetAcceleration() const;
|
||||
void SetMass(float);
|
||||
float GetMass() const;
|
||||
void SetGrounded(bool);
|
||||
bool IsGrounded() const;
|
||||
bool IsPhysicsEnabled() const;
|
||||
void SetPhysicsEnabled(bool state);
|
||||
|
||||
|
||||
void UpdateWorldMatrix();
|
||||
void UpdateSRMatrix();
|
||||
void UpdateScaleMatrix();
|
||||
void UpdateRotateMatrix();
|
||||
void UpdateTranslateMatrix();
|
||||
|
||||
void UpdatePosition(float deltaTime);
|
||||
|
||||
void Update();
|
||||
|
||||
std::string GetName();
|
||||
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; };
|
||||
|
||||
|
||||
enum ShaderType
|
||||
{
|
||||
CEL_SHADING,
|
||||
LIGHTING,
|
||||
NORMAL_MAPPING,
|
||||
SPECULAR_MAPPING,
|
||||
REFLECTION,
|
||||
REFRACTION,
|
||||
TEXTURE,
|
||||
SKYBOX,
|
||||
SUNLIGHT
|
||||
};
|
||||
|
||||
ShaderType GetActiveShader() const { return m_activeShader; };
|
||||
void SetActiveShader(ShaderType activeShader) { m_activeShader = activeShader; };
|
||||
|
||||
float GetBoundingRadius() const;
|
||||
|
||||
public :
|
||||
bool m_demoSpinning = false;
|
||||
XMVECTOR m_previousPosition;
|
||||
XMVECTOR m_velocity;
|
||||
int m_id;
|
||||
|
||||
private:
|
||||
XMMATRIX m_scaleMatrix;
|
||||
XMMATRIX m_rotateMatrix;
|
||||
XMMATRIX m_translateMatrix;
|
||||
XMMATRIX m_srMatrix;
|
||||
XMMATRIX m_worldMatrix;
|
||||
|
||||
XMVECTOR m_acceleration;
|
||||
float m_mass;
|
||||
bool m_isGrounded;
|
||||
bool m_isPhysicsEnabled;
|
||||
|
||||
std::string m_name;
|
||||
ObjectType m_type = ObjectType::Unknown;
|
||||
|
||||
ShaderType m_activeShader = LIGHTING;
|
||||
|
||||
float m_boundingRadius;
|
||||
};
|
Reference in New Issue
Block a user