Recast Navigation
Navigation-mesh Toolset for Games
Loading...
Searching...
No Matches
Tool_OffMeshConnection.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 "Sample.h"
22
25{
26 Sample* sample = nullptr;
27 float hitPos[3];
28 bool hitPosSet = false;
29 bool bidirectional = true;
30 unsigned char oldFlags = 0;
31
32public:
35 {
36 if (sample)
37 {
38 sample->navMeshDrawFlags = oldFlags;
39 }
40 }
41
43
44 void init(Sample* sample) override;
45 void reset() override;
46
47 void singleStep() override {}
48 void update(const float /*dt*/) override {}
49 void render() override;
50
51 void drawMenuUI() override;
52 void drawOverlayUI() override;
53
54 void onClick(const float* rayStartTime, const float* rayHitPos, bool shift) override;
55 void onToggle() override {}
56};
SampleToolType
Tool types.
Definition Sample.h:33
Tool to create off-mesh connections for InputGeom.
Definition Tool_OffMeshConnection.h:25
void init(Sample *sample) override
Definition Tool_OffMeshConnection.cpp:27
OffMeshConnectionTool()=default
SampleToolType type() override
Definition Tool_OffMeshConnection.h:42
void onToggle() override
Definition Tool_OffMeshConnection.h:55
void onClick(const float *rayStartTime, const float *rayHitPos, bool shift) override
Definition Tool_OffMeshConnection.cpp:49
void reset() override
Definition Tool_OffMeshConnection.cpp:39
void update(const float) override
Definition Tool_OffMeshConnection.h:48
void render() override
Definition Tool_OffMeshConnection.cpp:107
void singleStep() override
Definition Tool_OffMeshConnection.h:47
void drawMenuUI() override
Definition Tool_OffMeshConnection.cpp:44
~OffMeshConnectionTool() override
Definition Tool_OffMeshConnection.h:34
void drawOverlayUI() override
Definition Tool_OffMeshConnection.cpp:122
Definition Sample.h:116
unsigned char navMeshDrawFlags
Definition Sample.h:124
Definition Sample.h:85