Nazara Engine  0.4
A fast, complete, cross-platform API designed for game development
PrimitiveList.hpp
1 // Copyright (C) 2017 Jérôme Leclercq
2 // This file is part of the "Nazara Engine - Core module"
3 // For conditions of distribution and use, see copyright notice in Config.hpp
4 
5 #pragma once
6 
7 #ifndef NAZARA_PRIMITIVELIST_HPP
8 #define NAZARA_PRIMITIVELIST_HPP
9 
10 #include <Nazara/Prerequesites.hpp>
11 #include <Nazara/Core/Primitive.hpp>
12 #include <Nazara/Math/Quaternion.hpp>
13 
14 namespace Nz
15 {
17  class NAZARA_CORE_API PrimitiveList
18  {
19  public:
20  PrimitiveList() = default;
21  PrimitiveList(const PrimitiveList&) = default;
22  PrimitiveList(PrimitiveList&&) = default;
23  ~PrimitiveList() = default;
24 
25  void AddBox(const Vector3f& lengths, const Vector3ui& subdivision = Vector3ui(0U), const Matrix4f& transformMatrix = Matrix4f::Identity());
26  void AddBox(const Vector3f& lengths, const Vector3ui& subdivision, const Vector3f& position, const Quaternionf& rotation = Quaternionf::Identity());
27  void AddCone(float length, float radius, unsigned int subdivision = 4, const Matrix4f& transformMatrix = Matrix4f::Identity());
28  void AddCone(float length, float radius, unsigned int subdivision, const Vector3f& position, const Quaternionf& rotation = Quaternionf::Identity());
29  void AddCubicSphere(float size, unsigned int subdivision = 4, const Matrix4f& transformMatrix = Matrix4f::Identity());
30  void AddCubicSphere(float size, unsigned int subdivision, const Vector3f& position, const Quaternionf& rotation = Quaternionf::Identity());
31  void AddIcoSphere(float size, unsigned int recursionLevel = 3, const Matrix4f& transformMatrix = Matrix4f::Identity());
32  void AddIcoSphere(float size, unsigned int recursionLevel, const Vector3f& position, const Quaternionf& rotation = Quaternionf::Identity());
33  void AddPlane(const Vector2f& size, const Vector2ui& subdivision, const Matrix4f& transformMatrix = Matrix4f::Identity());
34  void AddPlane(const Vector2f& size, const Vector2ui& subdivision, const Planef& planeInfo);
35  void AddPlane(const Vector2f& size, const Vector2ui& subdivision, const Vector3f& position, const Quaternionf& rotation = Quaternionf::Identity());
36  void AddUVSphere(float size, unsigned int sliceCount = 4, unsigned int stackCount = 4, const Matrix4f& transformMatrix = Matrix4f::Identity());
37  void AddUVSphere(float size, unsigned int sliceCount, unsigned int stackCount, const Vector3f& position, const Quaternionf& rotation = Quaternionf::Identity());
38 
39  Primitive& GetPrimitive(std::size_t i);
40  const Primitive& GetPrimitive(std::size_t i) const;
41  std::size_t GetSize() const;
42 
43  PrimitiveList& operator=(const PrimitiveList&) = default;
44  PrimitiveList& operator=(PrimitiveList&&) = default;
45 
46  Primitive& operator()(unsigned int i);
47  const Primitive& operator()(unsigned int i) const;
48 
49  private:
50  std::vector<Primitive> m_primitives;
51  };
52 }
53 
54 #endif // NAZARA_PRIMITIVELIST_HPP
TODO: Inherit SoundEmitter from Node.
Definition: Algorithm.hpp:12
Math class that represents a plane in 3D.
Definition: Plane.hpp:18
TODO: Inline this.
Definition: PrimitiveList.hpp:17
static Matrix4 Identity()
Shorthand for the identity matrix.
Definition: Matrix4.inl:1562
static Quaternion Identity()
Shorthand for the quaternion (1, 0, 0, 0)
Definition: Quaternion.inl:683