VR-Engage  2.2
Loading...
Searching...
No Matches
ladderLocator.h
Go to the documentation of this file.
1/*******************************************************************************
2** Copyright (c) 2025 MAK Technologies
3** All rights reserved.
4*******************************************************************************/
5
6//! \file ladderLocator.h
7//! \ingroup vreVrfobjcore
8//! \brief Ladder locator class for VREngage
9//!
10//! This file defines the DtLadderLocator class, which provides functionality for finding
11//! the nearest ladder and its access points in VREngage simulations. It enables human entities
12//! to locate and interact with nearby ladders for climbing operations.
13
14#pragma once
15
17
18#include <matrix/vlVector.h>
19
20#include <vlutil/vlString.h>
21
22class DtVrfNavAreaManager;
23class DtPhysicalWorld;
24
25namespace makVre
26{
27class DtLadder;
28
29//! \brief Helper class for finding ladders and their access points in simulations
30//!
31//! This class provides functionality to locate the nearest ladder and determine
32//! the optimal access points (points at which a human could mount or dismount a ladder).
33//! It works with the navigation system to find and prepare ladder data for use by
34//! human entities that need to climb ladders in the simulation.
36{
37public:
38 //! \brief Constructor with navigation area manager and profile
39 //! \param navAreaManager Reference to the simulation manager's navigation area manager
40 //! \param navigationProfile The string name of the navigation profile
41 //!
42 //! Creates a new ladder locator with the specified navigation area manager and profile.
43 //! The navigation profile is typically available in the parameter entry for a given
44 //! entity type (e.g., "lifeform") and determines navigational capabilities.
45 DtLadderLocator(DtVrfNavAreaManager& navAreaManager, const DtString& navigationProfile);
46
47 //! \brief Virtual destructor
48 //!
49 //! Cleans up resources used by the ladder locator.
51
52 //! \brief Sets the area to search for nearby ladders
53 //! \param localPosition The center position of the search area in local coordinates
54 //! \param range The search radius in meters
55 //!
56 //! Defines the area in which to search for ladders. This can be called repeatedly
57 //! to change the search area as needed, such as when the entity moves to a new location.
58 //! The search area is defined as a sphere with the specified position as its center
59 //! and the specified range as its radius.
60 virtual void setSearchArea(const DtVector& localPosition, double range);
61
62 //! \brief Finds the nearest ladder and its access point
63 //! \param physicalWorld Reference to the physical world for terrain queries
64 //! \param ladder Reference to a ladder object to be filled with the found ladder data
65 //! \param ladderAccessPoint Reference to a vector to be filled with the nearest access point
66 //! \return True if a ladder was found within the search area, false otherwise
67 //!
68 //! Searches for the nearest ladder within the previously set search area.
69 //! If a ladder is found, the ladder parameter is filled with the ladder data,
70 //! and the ladderAccessPoint parameter is filled with the coordinates of the
71 //! nearest point at which an entity could access (mount/dismount) the ladder.
72 virtual bool findNearestLadder(
73 const DtPhysicalWorld& physicalWorld, DtLadder& ladder, DtVector& ladderAccessPoint) const;
74
75private:
76 //! \brief Default constructor (not implemented)
77 //!
78 //! Default constructor is private and not implemented to prevent
79 //! creation of instances without proper initialization.
81
82 //! \brief Copy constructor (not implemented)
83 //! \param orig The source locator to copy from
84 //!
85 //! Copy constructor is private and not implemented to prevent copying.
87
88 //! \brief Assignment operator (not implemented)
89 //! \param orig The source locator to copy from
90 //! \return Reference to this locator after assignment
91 //!
92 //! Assignment operator is private and not implemented to prevent assignment.
94
95protected:
96 //! \brief Reference to the navigation area manager
97 //!
98 //! Cached reference to the navigation area manager that provides access to
99 //! navigation areas and ladders in the simulation.
100 DtVrfNavAreaManager& myNavAreaManager;
101
102 //! \brief Navigation profile for ladder searches
103 //!
104 //! The navigation profile to use in searches, typically available in the
105 //! object parameter entry for a given entity type (e.g., "lifeform").
106 //! This determines which navigation areas are accessible to the entity.
108
109 //! \brief Origin of the current search area
110 //!
111 //! The center position of the current ladder search area in local coordinates.
113
114 //! \brief Radius of the current search area
115 //!
116 //! The radius in meters defining the current ladder search area.
118};
119} // namespace makVre
Helper class that represents a climbable ladder in simulations.
Definition ladder.h:35
DtVrfNavAreaManager & myNavAreaManager
Reference to the navigation area manager.
Definition ladderLocator.h:100
DtLadderLocator(DtVrfNavAreaManager &navAreaManager, const DtString &navigationProfile)
Constructor with navigation area manager and profile.
DtLadderLocator(const DtLadderLocator &orig)
Copy constructor (not implemented)
virtual void setSearchArea(const DtVector &localPosition, double range)
Sets the area to search for nearby ladders.
DtString myNavigationProfile
Navigation profile for ladder searches.
Definition ladderLocator.h:107
virtual bool findNearestLadder(const DtPhysicalWorld &physicalWorld, DtLadder &ladder, DtVector &ladderAccessPoint) const
Finds the nearest ladder and its access point.
DtLadderLocator()
Default constructor (not implemented)
DtVector mySearchAreaOrigin
Origin of the current search area.
Definition ladderLocator.h:112
virtual ~DtLadderLocator()
Virtual destructor.
double mySearchAreaRadius
Radius of the current search area.
Definition ladderLocator.h:117
DtLadderLocator & operator=(const DtLadderLocator &orig)
Assignment operator (not implemented)
Export macros for the VREngage Object Core library.
#define VREVRFOBJCORE_DLL
Platform-specific DLL export/import declaration.
Definition export.h:27
Include export definitions for this library.
Definition glsVreMessageUtil.h:49