Recast Navigation
Navigation-mesh Toolset for Games
Loading...
Searching...
No Matches
Sample_SoloMesh.h
Go to the documentation of this file.
1//
2// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org
3//
4// This software is provided 'as-is', without any express or implied
5// warranty. In no event will the authors be held liable for any damages
6// arising from the use of this software.
7// Permission is granted to anyone to use this software for any purpose,
8// including commercial applications, and to alter it and redistribute it
9// freely, subject to the following restrictions:
10// 1. The origin of this software must not be misrepresented; you must not
11// claim that you wrote the original software. If you use this software
12// in a product, an acknowledgment in the product documentation would be
13// appreciated but is not required.
14// 2. Altered source versions must be plainly marked as such, and must not be
15// misrepresented as being the original software.
16// 3. This notice may not be removed or altered from any source distribution.
17//
18
19#pragma once
20
21#include "Recast.h"
22#include "Sample.h"
23
24#include <cstdint>
25
26class Sample_SoloMesh : public Sample
27{
28protected:
30
32
33 unsigned char* triAreas = nullptr;
37 rcPolyMesh* polyMesh = nullptr;
39
61 static const char* drawModeNames[];
62
63 void cleanup();
64
65public:
67 ~Sample_SoloMesh() override;
72
73 void drawSettingsUI() override;
74 void drawToolsUI() override;
75 void drawDebugUI() override;
76
77 void render() override;
78 void renderOverlay() override;
79 void onMeshChanged(InputGeom* geom) override;
80 bool build() override;
81
82private:
83 void UI_DrawModeOption(DrawMode drawMode, bool enabled);
84};
Definition InputGeom.h:96
Definition Sample_SoloMesh.h:27
void renderOverlay() override
Definition Sample_SoloMesh.cpp:320
DrawMode currentDrawMode
Definition Sample_SoloMesh.h:60
rcConfig config
Definition Sample_SoloMesh.h:31
float totalBuildTimeMs
Definition Sample_SoloMesh.h:29
~Sample_SoloMesh() override
Definition Sample_SoloMesh.cpp:59
Sample_SoloMesh(const Sample_SoloMesh &&)=delete
unsigned char * triAreas
Definition Sample_SoloMesh.h:33
Sample_SoloMesh & operator=(const Sample_SoloMesh &&)=delete
void drawSettingsUI() override
Definition Sample_SoloMesh.cpp:82
void render() override
Definition Sample_SoloMesh.cpp:175
rcHeightfield * heightfield
Definition Sample_SoloMesh.h:34
static const char * drawModeNames[]
Definition Sample_SoloMesh.h:35
void drawDebugUI() override
Definition Sample_SoloMesh.cpp:149
bool build() override
Definition Sample_SoloMesh.cpp:345
Sample_SoloMesh()
Definition Sample_SoloMesh.cpp:54
Sample_SoloMesh(const Sample_SoloMesh &)=delete
Sample_SoloMesh & operator=(const Sample_SoloMesh &)=delete
void drawToolsUI() override
Definition Sample_SoloMesh.cpp:105
rcPolyMesh * polyMesh
Definition Sample_SoloMesh.h:37
DrawMode
Definition Sample_SoloMesh.h:41
void onMeshChanged(InputGeom *geom) override
Definition Sample_SoloMesh.cpp:329
rcContourSet * contourSet
Definition Sample_SoloMesh.h:36
rcPolyMeshDetail * detailMesh
Definition Sample_SoloMesh.h:38
rcCompactHeightfield * compactHeightfield
Definition Sample_SoloMesh.h:35
void cleanup()
Definition Sample_SoloMesh.cpp:64
Definition Sample.h:116
A compact, static heightfield representing unobstructed space.
Definition Recast.h:354
Specifies a configuration to use when performing Recast builds.
Definition Recast.h:217
Represents a group of related contours.
Definition Recast.h:433
A dynamic heightfield representing obstructed space.
Definition Recast.h:313
Contains triangle meshes that represent detailed height data associated with the polygons in its asso...
Definition Recast.h:487
Represents a polygon mesh suitable for use in building a navigation mesh.
Definition Recast.h:457