Isle
Loading...
Searching...
No Matches
LegoSphere Class Reference

[AI] Represents a sphere in 3D space, used for bounding volume calculations and spatial queries. More...

#include <legosphere.h>

Collaboration diagram for LegoSphere:

Public Member Functions

 LegoSphere ()
 [AI] Default constructor initializing the sphere with zero radius. More...
 
LegoVertexGetCenter ()
 [AI] Returns a reference to the center vertex of the sphere. More...
 
void SetCenter (LegoVertex &p_center)
 [AI] Sets the center of the sphere to the specified vertex. More...
 
LegoFloat GetRadius ()
 [AI] Retrieves the current radius of the sphere. More...
 
void SetRadius (LegoFloat p_radius)
 [AI] Sets the radius to the specified value. More...
 
LegoResult Read (LegoStorage *p_storage)
 [AI] Reads the center and radius of the sphere from a binary storage source. More...
 

Protected Attributes

LegoVertex m_center
 Center position of the sphere in 3D space. [AI]. More...
 
LegoFloat m_radius
 Radius of the sphere. [AI]. More...
 

Detailed Description

[AI] Represents a sphere in 3D space, used for bounding volume calculations and spatial queries.

[AI] The class contains a center vertex and a floating-point radius. This is commonly used in collision detection, bounding volume hierarchies, view frustum culling, and other 3D spatial operations to efficiently represent and test spherical areas.

Definition at line 13 of file legosphere.h.

Constructor & Destructor Documentation

◆ LegoSphere()

LegoSphere::LegoSphere ( )
inline

[AI] Default constructor initializing the sphere with zero radius.

[AI] The center vertex is implicitly constructed, and the radius is set to 0.0f.

Definition at line 19 of file legosphere.h.

Member Function Documentation

◆ GetCenter()

LegoVertex & LegoSphere::GetCenter ( )
inline

[AI] Returns a reference to the center vertex of the sphere.

Returns
[AI] Reference to the m_center member containing the 3D center coordinate.

Definition at line 25 of file legosphere.h.

◆ GetRadius()

LegoFloat LegoSphere::GetRadius ( )
inline

[AI] Retrieves the current radius of the sphere.

Returns
[AI] The radius (float) of the sphere.

Definition at line 37 of file legosphere.h.

◆ Read()

LegoResult LegoSphere::Read ( LegoStorage p_storage)

[AI] Reads the center and radius of the sphere from a binary storage source.

Parameters
p_storageThe storage object to read from. [AI]

[AI] This method first calls the center's Read method, then reads the raw binary value for radius.

Returns
[AI] SUCCESS if all data was read correctly; a failure code otherwise.

Definition at line 9 of file legosphere.cpp.

◆ SetCenter()

void LegoSphere::SetCenter ( LegoVertex p_center)
inline

[AI] Sets the center of the sphere to the specified vertex.

Parameters
p_centerThe new center position. [AI]

Definition at line 31 of file legosphere.h.

◆ SetRadius()

void LegoSphere::SetRadius ( LegoFloat  p_radius)
inline

[AI] Sets the radius to the specified value.

Parameters
p_radiusThe new radius. [AI]

Definition at line 43 of file legosphere.h.

Member Data Documentation

◆ m_center

LegoVertex LegoSphere::m_center
protected

Center position of the sphere in 3D space. [AI].

Definition at line 54 of file legosphere.h.

◆ m_radius

LegoFloat LegoSphere::m_radius
protected

Radius of the sphere. [AI].

Definition at line 55 of file legosphere.h.


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