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 
22  class NAPAPI SphereMesh : public IMesh
23  {
24  RTTI_ENABLE(IMesh)
25 
26  public:
27  SphereMesh(Core& core);
28 
34  virtual bool init(utility::ErrorState& errorState) override;
35 
39  virtual MeshInstance& getMeshInstance() override { return *mMeshInstance; }
40 
44  virtual const MeshInstance& getMeshInstance() const override { return *mMeshInstance; }
45 
46  public:
47  float mRadius = 1.0f;
48  uint mRings = 50;
49  uint mSectors = 50;
51  ECullMode mCullMode = ECullMode::Back;
53  RGBAColorFloat mColor = { 1.0f, 1.0f, 1.0f, 1.0f };
54  glm::vec3 mPosition = { 0.0, 0.0, 0.0 };
55 
56  private:
57  RenderService* mRenderService;
58  std::unique_ptr<MeshInstance> mMeshInstance;
59  };
60 }
nap::uint
unsigned int uint
Definition: numeric.h:23
nap::SphereMesh::getMeshInstance
virtual MeshInstance & getMeshInstance() override
Definition: spheremesh.h:39
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:401
nap::SphereMesh::getMeshInstance
virtual const MeshInstance & getMeshInstance() const override
Definition: spheremesh.h:44
nap::SphereMesh
Definition: spheremesh.h:22
nap::RenderService
Definition: renderservice.h:198
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