Kaim::Channel Class Reference

Kaim::Channel Class Reference

#include <channel.h>

Class Description

Channel enrich Path with clearance information on each side of the Path.

It's typically used to compute SplineTrajectory to drive the bot.

Inherits Kaim::RefCountBase< C, Stat >.

Main API Functions

KyUInt32 GetGateCount () const
 
const GateGetGate (KyUInt32 index) const
 
const KyArray< Vec2f > & GetPreChannelPolyline () const
 
const KyArray< Vec2f > & GetPostChannelPolyline () const
 
KyUInt32 GetSectionCount () const
 
KyUInt32 GetLastSectionIdx () const
 
KyUInt32 GetSectionStartGateIdx (KyUInt32 sectionIdx) const
 
KyUInt32 GetSectionEndGateIdx (KyUInt32 sectionIdx) const
 
const GateGetSectionStartGate (KyUInt32 sectionIdx) const
 
const GateGetSectionEndGate (KyUInt32 sectionIdx) const
 
const Vec3fGetStartPos () const
 Returns the channel start position, i.e. More...
 
const Vec3fGetEndPos () const
 Returns the channel end position, i.e. More...
 
KyUInt32 GetFirstPathNodeIdx () const
 Return PathNodeIdx of the first gate. More...
 
KyUInt32 GetGatePathNodeIdx (KyUInt32 gateIndex) const
 Return PathNodeIdx of the gate at gateIndex. More...
 
bool IsPositionInSection (const Vec2f &position, KyUInt32 sectionIndex, KyUInt32 &positionFlags) const
 Checks a provided 2D position is inside a channel section. More...
 
bool IsPositionInSection (const Vec2f &position, KyUInt32 sectionIndex) const
 Just checks a provided 2D position is inside a channel section. More...
 
KyResult GetSectionFromPositionAndSeed (const Kaim::Vec3f &previousPosition, KyUInt32 previousSectionIdx, const Kaim::Vec3f &newPosition, KyUInt32 &newSectionIdx) const
 Given a previous position and its section, computes the section for a new position that is supposed to be near the previous one. More...
 
KyResult GetSectionFromPositionAndSeed_AlongBubble (const Bubble &bubble, const Kaim::Vec3f &previousPosition, KyUInt32 previousSectionIdx, const Kaim::Vec3f &newPosition, KyUInt32 &newSectionIdx) const
 Given a previous position and its section, computes the section for a new position that is supposed to be accessible from the previous one following a circle arc. More...
 
bool IsConcaveCorner (KyUInt32 gateIdx, ChannelSide side) const
 

For internal use only

KyArray< Gatem_gates
 
KyArray< Vec2fm_preChannelPolyline
 
KyArray< Vec2fm_postChannelPolyline
 
KyUInt32 m_firstPathNodeIdx
 
KyResult GetSectionFromPositionAndSeed (const Kaim::Vec3f &prevPos, KyUInt32 prevSectionIdx, const Kaim::Vec3f &newPos, KyUInt32 &newSectionIdx, KyFloat32 maxProgress) const
 
KyResult GetSectionFromPositionAndSeed_Forward (const Kaim::Vec3f &prevPos, KyUInt32 prevGateIdx, const Kaim::Vec3f &newPos, KyUInt32 &newGateIdx, KyFloat32 maxProgress) const
 
KyResult GetSectionFromPositionAndSeed_Backward (const Kaim::Vec3f &prevPos, KyUInt32 prevGateIdx, const Kaim::Vec3f &newPos, KyUInt32 &newGateIdx, KyFloat32 maxProgress) const
 
bool IntersectSegmentVsPreChannelPolyline (const Vec2f &A, const Vec2f &B, Vec2f &intersection) const
 
bool IntersectSegmentVsPostChannelPolyline (const Vec2f &A, const Vec2f &B, Vec2f &intersection) const
 
void SendVisualDebug (DisplayListManager *displayListManager, const ChannelDisplayConfig &displayConfig=ChannelDisplayConfig(), KyUInt32 indexInChannelArray=0, const char *listBaseName="", const char *groupName="Channel", KyUInt32 visualDebugId=0xFFFFFFFF) const
 

Creation functions

KyResult InitFromBlob (const ChannelBlob &channelBlob)
 These functions are expected to be used internally in Channel computation classes. More...
 
void Initialize ()
 
void Clear ()
 
void AddGate (const Gate &gate)
 
GateGetGate (KyUInt32 index)
 
void SetPreChannelPolyline (const KyArray< Vec2f > &polyline)
 
void SetPostChannelPolyline (const KyArray< Vec2f > &polyline)
 
void SetPolylineFromBlob (const BlobArray< Vec2f > &polylineBlob, KyArray< Vec2f > &polyline)
 
void SetFirstPathNodeIdx (KyUInt32 firstPathNodeIdx)
 
KyResult ComputeChannelWidth ()
 

Member Function Documentation

const Vec3f& Kaim::Channel::GetEndPos ( ) const
inline

Returns the channel end position, i.e.

the m_pathPos of its last Gate.

Precondition
The Channel must not be empty.
KyUInt32 Kaim::Channel::GetFirstPathNodeIdx ( ) const
inline

Return PathNodeIdx of the first gate.

KyUInt32 Kaim::Channel::GetGatePathNodeIdx ( KyUInt32  gateIndex) const
inline

Return PathNodeIdx of the gate at gateIndex.

KyResult Kaim::Channel::GetSectionFromPositionAndSeed ( const Kaim::Vec3f previousPosition,
KyUInt32  previousSectionIdx,
const Kaim::Vec3f newPosition,
KyUInt32 newSectionIdx 
) const

Given a previous position and its section, computes the section for a new position that is supposed to be near the previous one.

KyResult Kaim::Channel::GetSectionFromPositionAndSeed_AlongBubble ( const Bubble bubble,
const Kaim::Vec3f previousPosition,
KyUInt32  previousSectionIdx,
const Kaim::Vec3f newPosition,
KyUInt32 newSectionIdx 
) const

Given a previous position and its section, computes the section for a new position that is supposed to be accessible from the previous one following a circle arc.

const Vec3f& Kaim::Channel::GetStartPos ( ) const
inline

Returns the channel start position, i.e.

the m_pathPos of its last Gate.

Precondition
The Channel must not be empty.
KyResult Kaim::Channel::InitFromBlob ( const ChannelBlob &  channelBlob)

These functions are expected to be used internally in Channel computation classes.

Though you can use them when creating your own Channel.

bool Kaim::Channel::IsPositionInSection ( const Vec2f position,
KyUInt32  sectionIndex,
KyUInt32 positionFlags 
) const

Checks a provided 2D position is inside a channel section.

It updates positionFlags with a combination of the RelativePositionToChannelSectionFlag.

bool Kaim::Channel::IsPositionInSection ( const Vec2f position,
KyUInt32  sectionIndex 
) const
inline

Just checks a provided 2D position is inside a channel section.


The documentation for this class was generated from the following files:
  • gwnavruntime/channel/channel.h
  • gwnavruntime/channel/channel.cpp