23 class DatabaseBinding;
47 BoxObstacleUp_Minus_X,
49 BoxObstacleUp_Minus_Y,
73 m_localHalfExtents.
Set(0.0f, 0.0f, 0.0f);
74 m_startPosition.
Set(0.0f, 0.0f, 0.0f);
103 Vec3f m_localHalfExtents;
104 Vec3f m_startPosition;
136 virtual const char* GetTypeName()
const {
return "BoxObstacle"; }
202 const Vec3f& GetLocalCenter()
const {
return m_localCenter; }
203 const Vec3f& GetLocalHalfExtents()
const {
return m_localHalfExtents; }
207 const Transform& GetTransform()
const {
return m_transform; }
209 const TagVolume* GetTagVolume()
const {
return m_tagVolumeTrigger.GetTagVolume(); }
210 TagVolume* GetTagVolume() {
return m_tagVolumeTrigger.GetTagVolume(); }
211 const DynamicNavTag& GetNavTag()
const {
return m_navTag; }
215 const SpatializedCylinder& GetSpatializedCylinder(
KyUInt32 index)
const
217 return (GetRotationMode() ==
BoxObstacleRotation_Yaw) ? m_sampledSpatializedCylinders[index] : m_centralSpatializedCylinder;
220 TagVolume::IntegrationStatus GetTagVolumeIntegrationStatus()
const {
return m_tagVolumeTrigger.GetIntegrationStatus(); }
221 const DatabaseBinding* GetDatabaseBinding()
const {
return m_databaseBinding; }
238 void ComputeSampledPoints();
243 void ComputeSampledPoints_2D(
const Vec3f& baseCenter,
const Vec3f& axis0,
const Vec3f& axis1,
249 void ComputeSampledPoints_1D(
const Vec3f& baseCenter,
const Vec3f& axis,
254 void ComputePositionAndVelocity(
const Vec3f& localPosition, Vec3f& newPosition, Vec3f& newVelocity);
258 virtual void DoSendVisualDebug(VisualDebugServer& visualDebugServer, VisualDebugSendChangeEvent changeEvent);
263 void UpdateSpatialization();
268 void SetupTagVolumeInitConfig(TagVolumeInitConfig& tagVolumeInitConfig);
271 void OnTagVolumeIntegration();
279 const SpatializedCylinder& GetCentralSpatializedCylinder()
const {
return m_centralSpatializedCylinder; }
281 KyUInt32 GetSampledSpatializedCylinderCount()
const {
return m_sampledSpatializedCylinderCount; }
282 const SpatializedCylinder& GetSampledSpatializedCylinder(
KyUInt32 index)
const {
return m_sampledSpatializedCylinders[index]; }
287 Ptr<DatabaseBinding> m_databaseBinding;
289 DynamicNavTag m_navTag;
292 Vec3f m_localHalfExtents;
298 bool m_doesTriggerTagVolume;
300 Transform m_transform;
317 Vec3f* m_sampledSpatializedCylinderLocalPositions;
318 KyUInt32 m_sampledSpatializedCylinderCount;
void Clear()
Prepares this instance for destruction and / or reuse: sets all members to their default values and c...
Definition: boxobstacle.cpp:116
BoxObstacleRotationMode
Enumerates the possible controls for how a BoxObstacle should be internally represented.
Definition: boxobstacle.h:28
void SetTransform(const Transform &transform)
The transform of the box.
Definition: boxobstacle.h:174
std::uint32_t KyUInt32
uint32_t
Definition: types.h:29
Used for all obstacles which are freely rotating (for example, concrete blocs just after the explosio...
Definition: boxobstacle.h:38
Vec3f m_localCenter
Defines the local AABBox center relatively to rotation axis.
Definition: boxobstacle.h:101
void Set(KyFloat32 _x, KyFloat32 _y, KyFloat32 _z)
Sets {_x, _y, _z}.
Definition: vec3f.h:29
void SetDefaults()
Sets all members to their default value.
Definition: boxobstacle.h:66
void SetAngularVelocity(const Vec3f &angularVelocity)
The rotational speed as rotation vector.
Definition: boxobstacle.h:181
void AddToWorld()
Adds the BoxObstacle to the World.
Definition: boxobstacle.cpp:147
Vec3f m_angularVelocity
Stores the rotational speed as rotation vector expressed in World coordinate system.
Definition: boxobstacle.h:309
BoxObstacleUpAxis
Enumerates the possible up-axis definition for a BoxObstacle.
Definition: boxobstacle.h:44
#define KY_CLASS_WITHOUT_COPY(ClassName)
Define to forbid copy constructor and copy assignment.
Definition: types.h:196
This class is a runtime container for Autodesk Navigation WorldElements such as NavData, Bots, BoxObstacles, TagVolumes...
Definition: world.h:52
static const char * GetRotationModeDescription(BoxObstacleRotationMode rotationMode)
Returns a short description of the rotation mode for visual debug.
Definition: boxobstacle.cpp:359
#define KY_DEFINE_NEW_DELETE_OPERATORS(MemStat)
This macro defines new and delete operators.
Definition: memory.h:132
World * m_world
Mandatory: you must provide a World when calling BoxObstacle::Init.
Definition: boxobstacle.h:84
Vec3f m_linearVelocity
The linear velocity, expressed in World coordinate system, at the local transform center of the box...
Definition: boxobstacle.h:304
DynamicNavTag m_navTag
This DynamicNavTag will be used to set up the TagVolume NavTag when the BoxObstacle will trigger it...
Definition: boxobstacle.h:93
Used for obstacles that are moving mainly horizontally (such as cars, doors, etc.).
Definition: boxobstacle.h:33
TagVolumeTrigger is dedicated to TagVolume creation / removal management.
Definition: tagvolumetrigger.h:22
WorldElementType
Enumerates the WorldElement types.
Definition: worldelementtype.h:13
void Init(const BoxObstacleInitConfig &initConfig)
Sets m_world and allocates memory depending on m_databaseBinding; it does not add the obstacle to the...
Definition: boxobstacle.cpp:62
Base internal class used to represent elements that can be added to a World, such as instances of Dat...
Definition: worldelement.h:41
The Autodesk Navigation namespace.
Definition: gamekitcrowddispersion.cpp:17
Class used to provide BoxObstacle initialization parameters.
Definition: boxobstacle.h:56
void SetRotationMode(BoxObstacleRotationMode mode)
Sets the next rotation mode used to update this BoxObstacle.
Definition: boxobstacle.h:186
void RemoveFromWorld()
Removes the BoxObstacle from the World.
Definition: boxobstacle.cpp:160
bool DoesTriggerTagVolume() const
Returns whether the TriggerTagVolume flag is raised or not; not if the BoxObstacle has actually trigg...
BoxObstacleUpAxis m_upAxis
Used only for BoxObstacles that are yaw-rotating.
Definition: boxobstacle.h:112
Internal representation of world elements, using a vertical cylinder shape.
Definition: spatializedcylinder.h:44
Ptr< DatabaseBinding > m_databaseBinding
Defines the Databases in which the BoxObstacle will be spatialized.
Definition: boxobstacle.h:89
void SetLinearVelocity(const Vec3f &linearVelocity)
The linear velocity at the local transform center of the box.
Definition: boxobstacle.h:177
Each instance of the BoxObstacle class represents a dynamic, physical object in your game engine that...
Definition: boxobstacle.h:127
float KyFloat32
float
Definition: types.h:32
3d vector using 32bits floating points.
Definition: vec3f.h:16
void SetDoesTriggerTagVolume(bool doesTriggerTagVolume)
This information is copied and applied in the next World::Update.
Definition: boxobstacle.h:197