KiCad PCB EDA Suite
Loading...
Searching...
No Matches
RAYSEG2D Struct Reference

#include <ray.h>

Public Member Functions

 RAYSEG2D (const SFVEC2F &s, const SFVEC2F &e)
 
bool IntersectSegment (const SFVEC2F &aStart, const SFVEC2F &aEnd_minus_start, float *aOutT) const
 
bool IntersectCircle (const SFVEC2F &aCenter, float aRadius, float *aOutT0, float *aOutT1, SFVEC2F *aOutNormalT0, SFVEC2F *aOutNormalT1) const
 
float DistanceToPointSquared (const SFVEC2F &aPoint) const
 
SFVEC2F atNormalized (float t) const
 Return the position at t.
 
SFVEC2F at (float t) const
 

Public Attributes

SFVEC2F m_Start
 
SFVEC2F m_End
 
SFVEC2F m_End_minus_start
 
SFVEC2F m_Dir
 
SFVEC2F m_InvDir
 
float m_Length
 
float m_DOT_End_minus_start
 dot( m_End_minus_start, m_End_minus_start)
 

Detailed Description

Definition at line 105 of file ray.h.

Constructor & Destructor Documentation

◆ RAYSEG2D()

RAYSEG2D::RAYSEG2D ( const SFVEC2F s,
const SFVEC2F e 
)

Member Function Documentation

◆ at()

SFVEC2F RAYSEG2D::at ( float  t) const
inline

Definition at line 137 of file ray.h.

References m_Dir, and m_Start.

Referenced by FILLED_CIRCLE_2D::Intersect(), RING_2D::Intersect(), and IntersectCircle().

◆ atNormalized()

SFVEC2F RAYSEG2D::atNormalized ( float  t) const
inline

Return the position at t.

t - value 0.0 ... 1.0

Definition at line 135 of file ray.h.

References m_End_minus_start, and m_Start.

Referenced by LAYER_ITEM_2D::Intersect().

◆ DistanceToPointSquared()

float RAYSEG2D::DistanceToPointSquared ( const SFVEC2F aPoint) const

◆ IntersectCircle()

bool RAYSEG2D::IntersectCircle ( const SFVEC2F aCenter,
float  aRadius,
float *  aOutT0,
float *  aOutT1,
SFVEC2F aOutNormalT0,
SFVEC2F aOutNormalT1 
) const

Definition at line 319 of file ray.cpp.

References at(), m_Dir, m_Length, and m_Start.

Referenced by ROUND_SEGMENT_2D::Intersect().

◆ IntersectSegment()

bool RAYSEG2D::IntersectSegment ( const SFVEC2F aStart,
const SFVEC2F aEnd_minus_start,
float *  aOutT 
) const

Definition at line 262 of file ray.cpp.

References std::abs(), m_End_minus_start, and m_Start.

Referenced by POLYGON_4PT_2D::Intersect(), and ROUND_SEGMENT_2D::Intersect().

Member Data Documentation

◆ m_Dir

◆ m_DOT_End_minus_start

float RAYSEG2D::m_DOT_End_minus_start

dot( m_End_minus_start, m_End_minus_start)

Definition at line 113 of file ray.h.

Referenced by DistanceToPointSquared(), and RAYSEG2D().

◆ m_End

◆ m_End_minus_start

◆ m_InvDir

SFVEC2F RAYSEG2D::m_InvDir

Definition at line 111 of file ray.h.

Referenced by BBOX_2D::Intersect(), and RAYSEG2D().

◆ m_Length

◆ m_Start


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