40 void InitFromBlob(
const BubbleBlob& blob);
42 void SetCenter(
const Vec3f& center);
47 void SetCenterAltitude(
KyFloat32 newCenterAltitude);
49 const Vec3f& GetCenter()
const;
53 FunnelSide GetFunnelSide()
const;
55 bool IsInitialized()
const;
83 bool operator==(
const Bubble& other)
const;
94 KY_INLINE Bubble::Bubble() { Reset(); }
97 Set(center, radius, rotationDirection, type);
99 KY_INLINE
void Bubble::Reset()
101 Set(
Vec3f::Zero(), 0.0f, UninitializedRotationDirection, UndefinedBubbleType);
107 SetRotationDirection(rotationDirection);
111 KY_INLINE
void Bubble::SetCenter(
const Vec3f& center) { m_center = center; }
112 KY_INLINE
void Bubble::SetRadius(
KyFloat32 radius) { m_radius = radius; }
113 KY_INLINE
void Bubble::SetRotationDirection(
RotationDirection rotationDirection) { m_rotationDirection = rotationDirection; }
114 KY_INLINE
void Bubble::SetType(
BubbleType type) { m_type = type; }
115 KY_INLINE
void Bubble::SetCenterAltitude(
KyFloat32 newCenterAltitude) { m_center.z = newCenterAltitude; }
117 KY_INLINE
const Vec3f& Bubble::GetCenter()
const {
return m_center; }
118 KY_INLINE
KyFloat32 Bubble::GetRadius()
const {
return m_radius; }
119 KY_INLINE
RotationDirection Bubble::GetRotationDirection()
const {
return m_rotationDirection; }
120 KY_INLINE
BubbleType Bubble::GetType()
const {
return m_type; }
122 KY_INLINE
bool Bubble::IsInitialized()
const {
return m_rotationDirection != UninitializedRotationDirection; }
127 return ComputeBiTangent(arrivalBubble, biTangentStart, biTangentEnd, unused);
129 KY_INLINE FunnelSide Bubble::GetFunnelSide()
const
131 if (m_type != IntermediaryBubble)
132 return FunnelBothSides;
135 (m_rotationDirection == Clockwise ) ? FunnelRight :
136 (m_rotationDirection == CounterClockwise) ? FunnelLeft :
137 UndefinedFunnelSide);
142 return ComputeBiTangent(arrivalBubble, biTangentStart, biTangentEnd, unused);
145 inline bool Bubble::operator==(
const Bubble& other)
const
148 m_center == other.m_center &&
149 m_radius == other.m_radius &&
150 m_rotationDirection == other.m_rotationDirection &&
151 m_type == other.m_type ;
156 template <
class OSTREAM>
157 inline OSTREAM& operator<<(OSTREAM& os,
const Bubble& bubble)
159 os <<
"center=" << bubble.GetCenter() <<
" radius=" << bubble.GetRadius() <<
" direction=" << GetRotationDirectionLabel(bubble.GetRotationDirection());
std::uint32_t KyUInt32
uint32_t
Definition: types.h:29
KyResult ComputeBiTangentBubble(const Vec3f &tangencyPosition, const Bubble &secondBubble, Vec3f &tangencyPositionOnSecondBubble, Bubble &biTangentBubble) const
Computes the Bubble tangent to this Bubble at the provided position and tangent to arrivalBubble...
Definition: bubble.cpp:74
KyResult ComputeBiTangent(const Bubble &arrivalBubble, Vec2f &biTangentStart, Vec2f &biTangentEnd, Vec2f &biTangentNormalizedDir) const
Computes the segment starting from this Bubble and arriving on arrivalBubble, tangent to both Bubbles...
Definition: bubble.cpp:46
static Vec3f Zero()
Returns {0.0f, 0.0f, 0.0f}.
Definition: vec3f.h:99
KyResult ComputeTangentBubble(const Vec3f &tangencyPosition, const Vec3f &position, Bubble &tangentBubble) const
Computes the Bubble tangent to this Bubble at the provided tangencyPosition and passing through an ar...
Definition: bubble.cpp:215
RotationDirection
Defines the 4 possible cases of possibly constrained rotation in the horizontal plane for a given ele...
Definition: rotation.h:15
BubbleType
Defines the type of a bubble accordingly to the place it has in a BubbleArray, a BubbleList, etc.
Definition: bubble.h:22
This class represents a circle with potential rotation limitation.
Definition: bubble.h:31
2d vector using KyFloat32.
Definition: vec2f.h:18
DisplayList is used to push text, lines or shapes for rendering in the NavigationLab e...
Definition: displaylist.h:128
Navigation return code class.
Definition: types.h:108
The Autodesk Navigation namespace.
Definition: gamekitcrowddispersion.cpp:17
RGBA color.
Definition: color.h:16
KyResult ComputeBiTangentDirection(const Bubble &arrivalBubble, Vec2f &biTangentDir) const
Computes the normalized direction of the segment starting from this Bubble and arriving on arrivalBub...
Definition: bubble.cpp:21
float KyFloat32
float
Definition: types.h:32
3d vector using 32bits floating points.
Definition: vec3f.h:16
void ComputeMedianTurnAxisAndPoint(const Vec2f &entryDir, const Vec2f &exitDir, Vec2f &medianTurnAxis, Vec3f &midPoint) const
Computes median turn axis and position accordingly to provided entry and exit axis.
Definition: bubble.cpp:267