8 #ifndef Navigation_CircleArcSplineSection_H
9 #define Navigation_CircleArcSplineSection_H
19 class CircleArcSplineSectionBlob;
20 class CircleArcSplineSectionDisplayConfig;
27 static const KyFloat32 SmallLengthThreshold;
45 void InitFromBlob(
const CircleArcSplineSectionBlob* blob);
49 const Bubble& GetBubble()
const {
return m_bubble; }
50 const Vec3f& GetStartPosition()
const {
return m_startPosition; }
51 const Vec3f& GetEndPosition()
const {
return m_endPosition; }
52 KyUInt32 GetStartSectionIdx()
const {
return m_startSectionIdx; }
53 KyUInt32 GetEndSectionIdx()
const {
return m_endSectionIdx; }
54 KyFloat32 GetLength2d()
const {
return m_length2d; }
55 const Vec2f& GetStartTangent()
const {
return m_startTangent; }
56 const Vec2f& GetEndTangent()
const {
return m_endTangent; }
58 const Vec3f& GetCenter()
const {
return m_bubble.GetCenter(); }
59 KyFloat32 GetRadius()
const {
return m_bubble.GetRadius(); }
60 RotationDirection GetRotationDirection()
const {
return m_bubble.GetRotationDirection(); }
62 bool IsInitialized()
const {
return (m_length2d > 0.0f); }
65 bool IsSmall()
const {
return (m_length2d < SmallLengthThreshold); }
93 KyFloat32 ComputeAngleFromStart(
const Vec3f& position)
const;
100 KyFloat32 ComputeDistance2dFromStart(
const Vec3f& position)
const;
105 KyFloat32 ComputeDistance2dToEnd(
const Vec3f& position)
const;
107 void Display(
const CircleArcSplineSectionDisplayConfig& displayConfig, ScopedDisplayList& displayList_arc, ScopedDisplayList& displayList_extremities,
108 ScopedDisplayList& displayList_sectionIdx, ScopedDisplayList& displayList_radius)
const;
111 void ComputeStartTangent();
112 void ComputeEndTangent();
113 void ComputeProperties();
120 Vec3f m_startPosition;
123 Vec2f m_startTangent;
135 , m_startPosition(startPosition)
136 , m_endPosition(endPosition)
137 , m_startTangent(startTangent)
138 , m_endTangent(endTangent)
139 , m_startSectionIdx(startSectionIdx)
140 , m_endSectionIdx(endSectionIdx)
143 ComputeStartTangent();
152 : m_bubble(startPosition,
KyFloat32MAXVAL, UndefinedRotationDirection, UndefinedBubbleType)
153 , m_startPosition(startPosition)
154 , m_endPosition(endPosition)
155 , m_startTangent(dir2d)
156 , m_endTangent(dir2d)
157 , m_startSectionIdx(startSectionIdx)
158 , m_endSectionIdx(endSectionIdx)
162 ComputeStartTangent();
163 m_endTangent = m_startTangent;
171 #endif // Navigation_CircleArcSplineSection_H
void MoveTo(Vec3f &position, KyFloat32 distanceFromStart, Vec2f *tangent=0) const
Moves the provided position to the one on CircleArcSplineSection at the given distance from start pos...
#define KyFloat32MAXVAL
The maximum value that can be stored in the KyFloat32 variable type.
Definition: types.h:227
#define KY_NULL
Null value.
Definition: types.h:247
RotationDirection
Defines the 4 possible cases of possibly constrained rotation in the horizontal plane for a given ele...
Definition: rotation.h:20
void SetEndPosition(const Vec3f &endPosition, KyUInt32 endSectionIdx, const Vec2f &endTangent)
Sets end position related information.
This class represents a circle with potential rotation limitation.
Definition: bubble.h:35
This class defines a two-dimensional vector whose coordinates are stored using floating-point numbers...
Definition: vec2f.h:24
Definition: gamekitcrowddispersion.h:20
Vec2f ComputeTangent(const Vec3f &position) const
Computes the tangent direction at the given position.
static Vec2f Zero()
Returns a vector of zero size: (0,0).
Definition: vec2f.h:154
void SetStartPosition(const Vec3f &startPosition, KyUInt32 startSectionIdx, const Vec2f &startTangent)
Sets start position related information.
unsigned int KyUInt32
Type used internally to represent an unsigned 32-bit integer.
Definition: types.h:36
Class representing either an oriented circle arc or a straight line segment, to be aggregated into a ...
Definition: circlearcsplinesection.h:25
CircleArcSplineSection()
Creates an uninitialized CircleArcSplineSection.
Definition: circlearcsplinesection.h:32
#define KyUInt32MAXVAL
The maximum value that can be stored in the KyUInt32 variable type.
Definition: types.h:226
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