BRE12
DrawableObject.h
1 #pragma once
2 
3 #include <DirectXMath.h>
4 
5 #include <MathUtils\MathUtils.h>
6 #include <Utils\DebugUtils.h>
7 
8 namespace BRE {
9 class MaterialProperties;
10 class MaterialTechnique;
11 class Model;
12 
14 public:
15  DrawableObject(const Model& model,
16  const MaterialProperties& materialProperties,
17  const MaterialTechnique& materialTechnique,
18  const DirectX::XMFLOAT4X4& worldMatrix)
19  : mModel(&model)
20  , mMaterialProperties(&materialProperties)
21  , mMaterialTechnique(&materialTechnique)
22  , mWorldMatrix(worldMatrix)
23  {}
24 
25  const Model& GetModel() const noexcept
26  {
27  BRE_ASSERT(mModel != nullptr);
28  return *mModel;
29  }
30 
31  const MaterialProperties& GetMaterialProperties() const noexcept
32  {
33  BRE_ASSERT(mMaterialProperties != nullptr);
34  return *mMaterialProperties;
35  }
36 
37  const MaterialTechnique& GetMaterialTechnique() const noexcept
38  {
39  BRE_ASSERT(mMaterialTechnique != nullptr);
40  return *mMaterialTechnique;
41  }
42 
43  const DirectX::XMFLOAT4X4& GetWorldMatrix() const noexcept
44  {
45  return mWorldMatrix;
46  }
47 
48 private:
49  const Model* mModel{ nullptr };
50  const MaterialProperties* mMaterialProperties{ nullptr };
51  const MaterialTechnique* mMaterialTechnique{ nullptr };
52  DirectX::XMFLOAT4X4 mWorldMatrix{ MathUtils::GetIdentity4x4Matrix() };
53 };
54 
55 }
56 
Definition: MaterialTechnique.h:8
Definition: Camera.cpp:8
Definition: MaterialProperties.h:6
Definition: Model.h:15
Definition: DrawableObject.h:13