36 object(
const object&) =
delete;
37 object& operator=(
const object&) =
delete;
41 ID3D11DeviceContext* deviceContext,
46 void SetScaleMatrix(XMMATRIX scaleMatrix);
47 void SetRotateMatrix(XMMATRIX rotateMatrix);
48 void SetTranslateMatrix(XMMATRIX translateMatrix);
49 void SetSRMatrix(XMMATRIX srMatrix);
50 void SetWorldMatrix(XMMATRIX worldMatrix);
52 void SetPosition(XMVECTOR position);
53 void SetRotation(XMVECTOR rotation);
54 void SetScale(XMVECTOR scale);
56 XMMATRIX GetScaleMatrix()
const;
57 XMMATRIX GetRotateMatrix()
const;
58 XMMATRIX GetTranslateMatrix()
const;
59 XMMATRIX GetSRMatrix()
const;
60 XMMATRIX GetWorldMatrix()
const;
62 XMVECTOR GetPosition();
63 XMVECTOR GetRotation();
66 void SetVelocity(XMVECTOR);
67 void AddVelocity(
float deltaTime);
68 XMVECTOR GetVelocity()
const;
69 void SetAcceleration(XMVECTOR);
70 XMVECTOR GetAcceleration()
const;
72 float GetMass()
const;
73 void SetGrounded(
bool);
74 bool IsGrounded()
const;
75 bool IsPhysicsEnabled()
const;
76 void SetPhysicsEnabled(
bool state);
77 void SetVisible (
bool state) { m_isVisible = state; }
78 bool IsVisible()
const {
return m_isVisible; }
80 void UpdateWorldMatrix();
81 void UpdateSRMatrix();
82 void UpdateScaleMatrix();
83 void UpdateRotateMatrix();
84 void UpdateTranslateMatrix();
86 void UpdatePosition(
float deltaTime);
90 std::string GetName();
91 void SetName(std::string name);
94 void SetType(ObjectType type);
95 ObjectType GetType()
const {
return m_type; };
97 ShaderType GetActiveShader()
const {
return m_activeShader; };
98 void SetActiveShader(ShaderType activeShader) { m_activeShader = activeShader; };
100 float GetBoundingRadius()
const;
101 void SetBoundingRadius(
float radius) { m_boundingRadius = radius; }
103 void SetModelPath(std::wstring& path) { m_modelPath = path; }
104 std::wstring& GetModelPath() {
return m_modelPath; }
106 ShaderType StringToShaderType(
const std::string& shaderType);
107 std::string ShaderTypeToString(ShaderType shaderType);
109 ObjectType StringToObjectType(
const std::string& objectType);
110 std::string ObjectTypeToString(ObjectType objectType);
113 bool LoadTexturesFromPath(std::vector<std::wstring>& texturePaths,
TextureContainer& texturesContainer,
d_3d_class* m_Direct3D);
114 bool SetupInstancing(ID3D11Device* device,
const std::vector<XMMATRIX>& instanceTransforms);
115 void EnableInstancing(
bool enabled);
116 void SetInstanceCount(
int count);
117 bool IsInstancingEnabled()
const;
118 int GetInstanceCount()
const;
119 ID3D11Buffer* GetInstanceBuffer()
const;
120 void SetAlpha(
float alpha) { m_alpha = alpha; }
121 float GetAlpha()
const {
return m_alpha; }
122 void SetInitialStretch(
float initialStretch) { m_initialStretch = initialStretch; }
123 float GetInitialStretch()
const {
return m_initialStretch; }
124 void SetSpringConstant(
float springConstant) { m_springConstant = springConstant; }
125 float GetSpringConstant()
const {
return m_springConstant; }
127 bool IsGravityEnabled()
const {
return m_gravityEnabled; }
128 void SetGravityEnabled(
bool state) { m_gravityEnabled = state; }
130 std::shared_ptr<model_class> get_model()
const {
return m_model_; }
131 void SetModel(std::shared_ptr<model_class> model) { m_model_ = model; }
134 bool m_demoSpinning =
false;
135 XMVECTOR m_previousPosition;
138 bool m_gravityEnabled =
true;
144 XMMATRIX m_scaleMatrix;
145 XMMATRIX m_rotateMatrix;
146 XMMATRIX m_translateMatrix;
148 XMMATRIX m_worldMatrix;
150 XMVECTOR m_acceleration;
153 bool m_isPhysicsEnabled;
157 ObjectType m_type = ObjectType::Unknown;
158 ShaderType m_activeShader = ShaderType::LIGHTING;
160 float m_boundingRadius;
161 std::wstring m_modelPath;
163 float m_alpha = 0.0f;
164 float m_initialStretch = 0.0f;
165 float m_springConstant = 10.0f;
167 std::shared_ptr<model_class> m_model_;