NAP
spheremesh.h
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2  * License, v. 2.0. If a copy of the MPL was not distributed with this
3  * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
4 
5 #pragma once
6 
7 // Local Includes
8 #include "mesh.h"
9 
10 // External Includes
11 #include <utility/dllexport.h>
12 #include <color.h>
13 
14 namespace nap
15 {
16  class Core;
17 
21  class NAPAPI SphereMesh : public IMesh
22  {
23  RTTI_ENABLE(IMesh)
24 
25  public:
26  SphereMesh(Core& core);
27 
33  virtual bool init(utility::ErrorState& errorState) override;
34 
38  virtual MeshInstance& getMeshInstance() override { return *mMeshInstance; }
39 
43  virtual const MeshInstance& getMeshInstance() const override { return *mMeshInstance; }
44 
45  public:
46  float mRadius = 1.0f;
47  uint mRings = 50;
48  uint mSectors = 50;
50  ECullMode mCullMode = ECullMode::Back;
52  RGBAColorFloat mColor = { 1.0f, 1.0f, 1.0f, 1.0f };
53  glm::vec3 mPosition = { 0.0, 0.0, 0.0 };
54 
55  private:
56  RenderService* mRenderService;
57  std::unique_ptr<MeshInstance> mMeshInstance;
58  };
59 }
nap::uint
unsigned int uint
Definition: numeric.h:23
nap::SphereMesh::getMeshInstance
virtual MeshInstance & getMeshInstance() override
Definition: spheremesh.h:38
nap::EMemoryUsage::Static
@ Static
Buffer data is uploaded only once from the CPU to the GPU.
nap::EPolygonMode
EPolygonMode
Definition: mesh.h:55
nap::RGBAColor< float >
nap::ECullMode
ECullMode
Definition: mesh.h:43
nap::EMemoryUsage
EMemoryUsage
Definition: gpubuffer.h:41
nap::utility::ErrorState
Definition: errorstate.h:19
nap::IMesh
Definition: mesh.h:394
nap::SphereMesh::getMeshInstance
virtual const MeshInstance & getMeshInstance() const override
Definition: spheremesh.h:43
nap::SphereMesh
Definition: spheremesh.h:21
nap::RenderService
Definition: renderservice.h:275
nap::Core
Definition: core.h:82
nap::ECullMode::Back
@ Back
Cull back facing triangles.
nap::EPolygonMode::Fill
@ Fill
Polygons are interpreted and rendered using the specified 'EDrawMode'.
nap
Definition: templateapp.h:17
nap::MeshInstance
Definition: mesh.h:196