Simulant  21.12-194
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 
31  const Mat4& diffuse_map_matrix() const;
32  const Mat4& light_map_matrix() const;
33  const Mat4& normal_map_matrix() const;
34  const Mat4& specular_map_matrix() const;
35 
36  void set_diffuse_map_matrix(const Mat4& mat);
37  void set_light_map_matrix(const Mat4& mat);
38  void set_normal_map_matrix(const Mat4& mat);
39  void set_specular_map_matrix(const Mat4& mat);
40 
41  const TexturePtr& diffuse_map() const;
42  const TexturePtr& light_map() const;
43  const TexturePtr& normal_map() const;
44  const TexturePtr& specular_map() const;
45 
46  void set_fog_density(float density);
47  void set_fog_start(float start);
48  void set_fog_end(float end);
49  void set_fog_mode(FogMode mode);
50  void set_fog_colour(const Colour& colour);
51 
52  float fog_density() const;
53  float fog_start() const;
54  float fog_end() const;
55  FogMode fog_mode() const;
56  const Colour& fog_colour() const;
57 
58  const Colour& specular() const;
59  const Colour& ambient() const;
60  const Colour& emission() const;
61  const Colour& diffuse() const;
62  float shininess() const;
63  bool is_blending_enabled() const;
64  void set_blend_func(BlendType b);
65  BlendType blend_func() const;
66 
67  void set_depth_func(DepthFunc b);
68  DepthFunc depth_func() const;
69  void set_depth_write_enabled(bool v);
70  bool is_depth_write_enabled() const;
71 
72  void set_cull_mode(CullMode mode);
73  CullMode cull_mode() const;
74  void set_depth_test_enabled(bool v);
75  bool is_depth_test_enabled() const;
76  void set_lighting_enabled(bool v);
77  bool is_lighting_enabled() const;
78  void set_textures_enabled(EnabledTextureMask v);
79  int32_t textures_enabled() const;
80  float point_size() const;
81 
82  void set_polygon_mode(PolygonMode mode);
83  PolygonMode polygon_mode() const;
84 
85  void set_shade_model(ShadeModel model);
86  ShadeModel shade_model() const;
87 
88  ColourMaterial colour_material() const;
89  void set_colour_material(ColourMaterial cm);
90 
91  const MaterialObject* parent_material_object() const {
92  return dynamic_cast<const MaterialObject*>(this->parent_);
93  }
94 
95 };
96 
97 }
98 
smlt::Mat4
Definition: mat4.h:25
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:19
smlt::Colour
Definition: colour.h:29