9 #ifndef Navigation_OrientedBox2d_H
10 #define Navigation_OrientedBox2d_H
87 bool IsInside2d(const
Vec3f& pos);
99 KY_INLINE OrientedBox2d::OrientedBox2d() : m_length(0.f), m_width(0.f), m_thickness(0.f) {}
112 KY_DEBUG_ASSERTN(orientation.
GetLength() ==
Vec2f(orientation).
Normalize(), (
"Wrong BoxObtacle parameter, the orientation should be normalized"));
138 inline bool OrientedBox2d::IsInside2d(
const Vec3f& pos)
143 if (dotProd1 < 0.f || dotProd1 >
m_length ||
144 dotProd2 < 0.f || dotProd2 >
m_width )
KyFloat32 Normalize()
Normalizes the vector, making it one unit in length without changing its orientation.
Definition: vec2f.h:267
KyFloat32 m_length
The extents of the box along its orientation vector.
Definition: orientedbox2d.h:109
#define KyFloat32MAXVAL
The maximum value that can be stored in the KyFloat32 variable type.
Definition: types.h:227
This class represents a three-dimensional bounding box with a free orientation on the (X...
Definition: orientedbox2d.h:53
KyFloat32 z
The size of the vector along the Z axis.
Definition: vec3f.h:229
static Vec2f UnitX()
Returns the normalized orientation of the X axis.
Definition: vec2f.h:157
void Set(KyFloat32 _x, KyFloat32 _y, KyFloat32 _z)
Sets the coordinates.
Definition: vec3f.h:52
KyFloat32 x
The size of the vector along the X axis.
Definition: vec2f.h:169
void Set(KyFloat32 _x, KyFloat32 _y)
Sets the coordinates of the vector.
Definition: vec2f.h:47
void Set(const Vec3f &a, const Vec2f &orientation, KyFloat32 length, KyFloat32 width, KyFloat32 thickness)
Sets the dimensions of the box.
Definition: orientedbox2d.h:126
static Vec3f Zero()
Returns a vector of zero size: (0,0,0).
Definition: vec3f.h:209
KyFloat32 GetNormalized(Vec2f &normalized) const
Normalizes the vector, making it one unit in length without changing its orientation.
Definition: vec2f.h:276
void InitAs2dInflatedSegment(const Vec3f &start, const Vec3f &dest, KyFloat32 radius)
Creates a new OrientedBox2d that will be an inflate of the segment going from start to dest of radius...
Definition: orientedbox2d.h:137
KyFloat32 y
The size of the vector along the Y axis.
Definition: vec3f.h:228
OrientedBox2d()
Creates a new OrientedBox2d with 0.0f length, width and thickness.
Definition: orientedbox2d.h:115
Vec2f Get2d() const
Returns a Vec2f that contains the X and Y coordinates of this vector. The Z coordinate is ignored...
Definition: vec3f.h:188
Vec2f PerpCCW() const
Rotates this vector 90 degrees counter-clockwise (negating the Y coordinate).
Definition: vec2f.h:144
KyFloat32 x
The size of the vector along the X axis.
Definition: vec3f.h:227
This class defines a two-dimensional vector whose coordinates are stored using floating-point numbers...
Definition: vec2f.h:24
Definition: gamekitcrowddispersion.h:20
KyFloat32 DotProduct(const Vec2f &v1, const Vec2f &v2)
Returns the dot product of v1 and v2.
Definition: vec2f.h:187
#define KY_DEFINE_NEW_DELETE_OPERATORS(MemStat)
This macro defines new and delete operators.
Definition: memory.h:137
KyFloat32 m_thickness
The extents of the box along the vertical Z axis.
Definition: orientedbox2d.h:111
static Vec2f Zero()
Returns a vector of zero size: (0,0).
Definition: vec2f.h:154
Vec2f m_normalizedOrientation
The facing orientation of the box (unit vector).
Definition: orientedbox2d.h:108
KyFloat32 GetLength() const
Returns the magnitude of the vector.
Definition: vec2f.h:126
Vec3f m_a
The position of the reference corner.
Definition: orientedbox2d.h:107
KyFloat32 m_width
The extents of the box perpendicular to its orientation vector on the (X,Y) plane.
Definition: orientedbox2d.h:110
float KyFloat32
Type used internally to represent a 32-bit floating-point number.
Definition: types.h:43
This class defines a three-dimensional vector whose coordinates are stored using floating-point numbe...
Definition: vec3f.h:23
KyFloat32 y
The size of the vector along the Y axis.
Definition: vec2f.h:170