Simulant  21.12-574
A portable game engine for Windows, OSX, Linux, Dreamcast, and PSP
material_object.h
1 #pragma once
2 
3 #include "../../types.h"
4 #include "constants.h"
5 #include "core/material_property_overrider.h"
6 
7 namespace smlt {
8 
9 class MaterialPropertyRegistry;
10 class MaterialPropertyValue;
11 
13 public:
14  friend class Material;
15 
17  MaterialPropertyOverrider(nullptr) {}
18 
20  virtual ~MaterialObject();
21 
22  /* Built-in properties */
23  void set_specular(const Colour& colour);
24  void set_ambient(const Colour& colour);
25  void set_diffuse(const Colour& colour);
26  void set_emission(const Colour& colour);
27  void set_shininess(float shininess);
28  void set_diffuse_map(TexturePtr texture);
29  void set_light_map(TexturePtr texture);
30  void set_specular_map(TexturePtr texture);
31  void set_normal_map(TexturePtr texture);
32 
33  const Mat4& diffuse_map_matrix() const;
34  const Mat4& light_map_matrix() const;
35  const Mat4& normal_map_matrix() const;
36  const Mat4& specular_map_matrix() const;
37 
38  void set_diffuse_map_matrix(const Mat4& mat);
39  void set_light_map_matrix(const Mat4& mat);
40  void set_normal_map_matrix(const Mat4& mat);
41  void set_specular_map_matrix(const Mat4& mat);
42 
43  const TexturePtr& diffuse_map() const;
44  const TexturePtr& light_map() const;
45  const TexturePtr& normal_map() const;
46  const TexturePtr& specular_map() const;
47 
48  void set_fog_density(float density);
49  void set_fog_start(float start);
50  void set_fog_end(float end);
51  void set_fog_mode(FogMode mode);
52  void set_fog_colour(const Colour& colour);
53 
54  float fog_density() const;
55  float fog_start() const;
56  float fog_end() const;
57  FogMode fog_mode() const;
58  const Colour& fog_colour() const;
59 
60  const Colour& specular() const;
61  const Colour& ambient() const;
62  const Colour& emission() const;
63  const Colour& diffuse() const;
64  float shininess() const;
65  bool is_blending_enabled() const;
66  void set_blend_func(BlendType b);
67  BlendType blend_func() const;
68 
69  void set_depth_func(DepthFunc b);
70  DepthFunc depth_func() const;
71  void set_depth_write_enabled(bool v);
72  bool is_depth_write_enabled() const;
73 
74  void set_cull_mode(CullMode mode);
75  CullMode cull_mode() const;
76  void set_depth_test_enabled(bool v);
77  bool is_depth_test_enabled() const;
78  void set_lighting_enabled(bool v);
79  bool is_lighting_enabled() const;
80  void set_textures_enabled(EnabledTextureMask v);
81  int32_t textures_enabled() const;
82  float point_size() const;
83 
84  void set_polygon_mode(PolygonMode mode);
85  PolygonMode polygon_mode() const;
86 
87  void set_shade_model(ShadeModel model);
88  ShadeModel shade_model() const;
89 
90  ColourMaterial colour_material() const;
91  void set_colour_material(ColourMaterial cm);
92 
93  const MaterialObject* parent_material_object() const {
94  return dynamic_cast<const MaterialObject*>(this->parent_);
95  }
96 
97 };
98 
99 }
100 
smlt::Mat4
Definition: mat4.h:29
smlt::Material
Definition: material.h:95
smlt
Definition: animation.cpp:25
smlt::MaterialObject
Definition: material_object.h:12
smlt::MaterialPropertyOverrider
Definition: material_property_overrider.h:22
smlt::Colour
Definition: colour.h:29