Skip to content

Class AIAC::GOCircle

ClassList > AIAC > GOCircle

Inherits the following classes: AIAC::GOPrimitive

Public Functions

Type Name
glm::vec3 ClosestPointToPoint (glm::vec3 point)
Get the closest point to the circle from a given point.
GOPoint GetCenter () const
glm::vec4 GetEdgeColor () const
glm::vec3 GetNormal () const
float GetRadius () const
virtual void InitGLObject ()
void SetCenter (GOPoint center)
void SetEdgeColor (glm::vec4 edgeColor)
void SetNormal (glm::vec3 normal)
void SetRadius (float radius)
virtual void SetValueFrom (const std::shared_ptr< GOPrimitive > & ptrGO)
virtual void Transform (const glm::mat4x4 & transformMat)
virtual ~GOCircle () = default

Public Functions inherited from AIAC::GOPrimitive

See AIAC::GOPrimitive

Type Name
void ClearGLObject ()
void Draw ()
GOPrimitive (bool isVisible=true, glm::vec4 color=glm::vec4(0, 0, 0, 1.0))
uint32_t GenerateId ()
glm::vec4 GetColor () const
uint32_t GetId ()
std::string GetName () const
bool GetState ()
GOTypeFlags GetType ()
bool GetVisibility ()
float GetWeight () const
virtual void InitGLObject ()
bool IsVisible () const
void SetColor (glm::vec4 color)
void SetName (std::string name)
void SetState (bool state)
virtual void SetValueFrom (const std::shared_ptr< GOPrimitive > & ptrGO)
void SetVisibility (bool isVisible)
int SetWeight (float weight)
virtual void Transform (const glm::mat4x4 & transformMat)
virtual void Translate (const glm::vec3 & translation)
virtual ~GOPrimitive () = default

Public Static Functions

Type Name
std::shared_ptr< GOCircle > Add (GOPoint center, float radius)
Add GOCircle to the scene.
std::shared_ptr< GOCircle > Add (GOPoint center, glm::vec3 normal, float radius)
float ClosestDistanceFromLineToCircle (std::shared_ptr< GOLine > ptrLine, const glm::vec3 & circleCenter, float circleRadius)
This function calculates the closest distance from a line, defined by a point and a direction, to a circle in 3D space. If the line intersects the circle, the function returns 0, indicating the minimum distance is inside the circle.
std::pair< float, std::pair< glm::vec3, glm::vec3 > > ClosestDistanceFromSegmentToCircle (std::shared_ptr< GOLine > ptrLine, const glm::vec3 & circleCenter, float circleRadius)
This function calculates the closest distance from a segment. defined by two points, to a circle in 3D space.
glm::vec3 ClosestPointToCircle (const glm::vec3 & point, const glm::vec3 & circleCenter, const glm::vec3 & circleNormal, float circleRadius)
< Static geometry functions
std::shared_ptr< GOCircle > Get (const uint32_t & id)
std::vector< std::shared_ptr< GOCircle > > GetAll ()

Public Static Functions inherited from AIAC::GOPrimitive

See AIAC::GOPrimitive

Type Name
void Remove (const uint32_t & id)
void Remove (const std::shared_ptr< GOPrimitive > & ptrGO)

Protected Attributes inherited from AIAC::GOPrimitive

See AIAC::GOPrimitive

Type Name
glm::vec4 m_Color
std::vector< std::shared_ptr< GLObject > > m_GLObjects
uint32_t m_Id
bool m_IsVisible
std::string m_Name
bool m_State
GOTypeFlags m_Type
float m_Weight = = GOWeight::Default

Public Functions Documentation

function ClosestPointToPoint

Get the closest point to the circle from a given point.

glm::vec3 AIAC::GOCircle::ClosestPointToPoint (
    glm::vec3 point
) 

Parameters:

  • point the point

Returns:

glm::vec3


function GetCenter

inline GOPoint AIAC::GOCircle::GetCenter () const

function GetEdgeColor

inline glm::vec4 AIAC::GOCircle::GetEdgeColor () const

function GetNormal

inline glm::vec3 AIAC::GOCircle::GetNormal () const

function GetRadius

inline float AIAC::GOCircle::GetRadius () const

function InitGLObject

virtual void AIAC::GOCircle::InitGLObject () 

Implements AIAC::GOPrimitive::InitGLObject


function SetCenter

inline void AIAC::GOCircle::SetCenter (
    GOPoint center
) 

function SetEdgeColor

inline void AIAC::GOCircle::SetEdgeColor (
    glm::vec4 edgeColor
) 

function SetNormal

inline void AIAC::GOCircle::SetNormal (
    glm::vec3 normal
) 

function SetRadius

inline void AIAC::GOCircle::SetRadius (
    float radius
) 

function SetValueFrom

inline virtual void AIAC::GOCircle::SetValueFrom (
    const std::shared_ptr< GOPrimitive > & ptrGO
) 

Implements AIAC::GOPrimitive::SetValueFrom


function Transform

inline virtual void AIAC::GOCircle::Transform (
    const glm::mat4x4 & transformMat
) 

Implements AIAC::GOPrimitive::Transform


function ~GOCircle

virtual AIAC::GOCircle::~GOCircle () = default

Public Static Functions Documentation

function Add [½]

Add GOCircle to the scene.

static std::shared_ptr< GOCircle > AIAC::GOCircle::Add (
    GOPoint center,
    float radius
) 

Parameters:

  • center Center of the circle.
  • radius Radius of the circle.

Returns:

uint32_t Id of the circle.


function Add [2/2]

static std::shared_ptr< GOCircle > AIAC::GOCircle::Add (
    GOPoint center,
    glm::vec3 normal,
    float radius
) 

function ClosestDistanceFromLineToCircle

This function calculates the closest distance from a line, defined by a point and a direction, to a circle in 3D space. If the line intersects the circle, the function returns 0, indicating the minimum distance is inside the circle.

static inline float AIAC::GOCircle::ClosestDistanceFromLineToCircle (
    std::shared_ptr< GOLine > ptrLine,
    const glm::vec3 & circleCenter,
    float circleRadius
) 

Parameters:

  • ptrLine the pointer to the line.
  • circleCenter The center of the circle.
  • circleRadius The radius of the circle.

Returns:

The closest distance from the line to the circle


function ClosestDistanceFromSegmentToCircle

This function calculates the closest distance from a segment. defined by two points, to a circle in 3D space.

static inline std::pair< float, std::pair< glm::vec3, glm::vec3 > > AIAC::GOCircle::ClosestDistanceFromSegmentToCircle (
    std::shared_ptr< GOLine > ptrLine,
    const glm::vec3 & circleCenter,
    float circleRadius
) 

Parameters:

  • ptrLine the pointer to the line.
  • circleCenter The center of the circle.
  • circleRadius The radius of the circle.

Returns:

The closest distance from the line to the circle and the closest point on the line and the circle


function ClosestPointToCircle

< Static geometry functions

static inline glm::vec3 AIAC::GOCircle::ClosestPointToCircle (
    const glm::vec3 & point,
    const glm::vec3 & circleCenter,
    const glm::vec3 & circleNormal,
    float circleRadius
) 

Calculates the closest point on a circle to a given point in 3D.

Parameters:

  • point The point from which to find the closest point on the circle.
  • circleCenter The center of the circle.
  • circleNormal The normal vector of the circle's plane.
  • circleRadius The radius of the circle.

Returns:

The closest point on the circle to the given point.


function Get

static std::shared_ptr< GOCircle > AIAC::GOCircle::Get (
    const uint32_t & id
) 

function GetAll

static std::vector< std::shared_ptr< GOCircle > > AIAC::GOCircle::GetAll () 


The documentation for this class was generated from the following file src/AIAC/GOSys/GOPrimitive.h