Kaim::CircleArcSplineSection Class Reference

Kaim::CircleArcSplineSection Class Reference

#include <circlearcsplinesection.h>

Class Description

Class representing either an oriented circle arc or a straight line segment, to be aggregated into a CircleArcSpline.

Public Member Functions

 CircleArcSplineSection ()
 Creates an uninitialized CircleArcSplineSection. More...
 
 CircleArcSplineSection (const Bubble &bubble, const Vec3f &startPosition, KyUInt32 startSectionIdx, const Vec3f &endPosition, KyUInt32 endSectionIdx, const Vec2f &startTangent=Vec2f::Zero(), const Vec2f &endTangent=Vec2f::Zero())
 Creates a CircleArcSplineSection as sub part of an oriented circle (a.k.a. Bubble). More...
 
 CircleArcSplineSection (const Vec3f &startPosition, KyUInt32 startSectionIdx, const Vec3f &endPosition, KyUInt32 endSectionIdx, const Vec2f &dir2d=Vec2f::Zero())
 Creates a CircleArcSplineSection representing a straight line segment. More...
 
void SetStartPosition (const Vec3f &startPosition, KyUInt32 startSectionIdx, const Vec2f &startTangent)
 Sets start position related information. More...
 
void SetEndPosition (const Vec3f &endPosition, KyUInt32 endSectionIdx, const Vec2f &endTangent)
 Sets end position related information. More...
 
Vec2f ComputeTangent (const Vec3f &position) const
 Computes the tangent direction at the given position. More...
 
void MoveTo (Vec3f &position, KyFloat32 distanceFromStart, Vec2f *tangent=nullptr) const
 Moves the provided position to the one on CircleArcSplineSection at the given distance from start position. More...
 

For internal use only

KyFloat32 ComputeAngleFromStart (const Vec3f &position) const
 
KyFloat32 ComputeDistance2dFromStart (const Vec3f &position) const
 
KyFloat32 ComputeDistance2dToEnd (const Vec3f &position) const
 
void Display (const CircleArcSplineSectionDisplayConfig &displayConfig, DisplayList &displayList_arc, DisplayList &displayList_extremities, DisplayList &displayList_sectionIdx, DisplayList &displayList_radius) const
 

Constructor & Destructor Documentation

Kaim::CircleArcSplineSection::CircleArcSplineSection ( )
inline

Creates an uninitialized CircleArcSplineSection.

Kaim::CircleArcSplineSection::CircleArcSplineSection ( const Bubble bubble,
const Vec3f startPosition,
KyUInt32  startSectionIdx,
const Vec3f endPosition,
KyUInt32  endSectionIdx,
const Vec2f startTangent = Vec2f::Zero(),
const Vec2f endTangent = Vec2f::Zero() 
)
inline

Creates a CircleArcSplineSection as sub part of an oriented circle (a.k.a. Bubble).

Kaim::CircleArcSplineSection::CircleArcSplineSection ( const Vec3f startPosition,
KyUInt32  startSectionIdx,
const Vec3f endPosition,
KyUInt32  endSectionIdx,
const Vec2f dir2d = Vec2f::Zero() 
)
inline

Creates a CircleArcSplineSection representing a straight line segment.

Member Function Documentation

Vec2f Kaim::CircleArcSplineSection::ComputeTangent ( const Vec3f position) const

Computes the tangent direction at the given position.

It does not check (nor need) the position is actually on the CircleArcSplineSection.

void Kaim::CircleArcSplineSection::MoveTo ( Vec3f position,
KyFloat32  distanceFromStart,
Vec2f tangent = nullptr 
) const

Moves the provided position to the one on CircleArcSplineSection at the given distance from start position.

It also updates the corresponding tangent direction.

Precondition
distanceFromStart must be less than m_length2d.
void Kaim::CircleArcSplineSection::SetEndPosition ( const Vec3f endPosition,
KyUInt32  endSectionIdx,
const Vec2f endTangent 
)

Sets end position related information.

It then calls ComputeProperties to maintain internals up-to-date.

void Kaim::CircleArcSplineSection::SetStartPosition ( const Vec3f startPosition,
KyUInt32  startSectionIdx,
const Vec2f startTangent 
)

Sets start position related information.

It then calls ComputeProperties to maintain internals up-to-date.


The documentation for this class was generated from the following files: