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

[AI] Represents a 3D vertex with floating point coordinates. More...

#include <legovertex.h>

Public Member Functions

 LegoVertex ()
 [AI] Constructs a LegoVertex at the origin (0, 0, 0). More...
 
LegoFloat GetCoordinate (LegoU32 p_i)
 [AI] Gets the value of one of the xyz coordinates by index (0=x, 1=y, 2=z). More...
 
void SetCoordinate (LegoU32 p_i, LegoFloat p_coordinate)
 [AI] Sets the value of one of the xyz coordinates by index (0=x, 1=y, 2=z). More...
 
LegoFloat GetX ()
 [AI] Gets the X coordinate. More...
 
void SetX (LegoFloat p_x)
 [AI] Sets the X coordinate. More...
 
LegoFloat GetY ()
 [AI] Gets the Y coordinate. More...
 
void SetY (LegoFloat p_y)
 [AI] Sets the Y coordinate. More...
 
LegoFloat GetZ ()
 [AI] Gets the Z coordinate. More...
 
void SetZ (LegoFloat p_z)
 [AI] Sets the Z coordinate. More...
 
LegoBool IsOrigin ()
 [AI] Checks whether the vertex is located at the origin (0,0,0). More...
 
LegoResult Read (LegoStorage *p_storage)
 [AI] Reads the coordinates from a storage object (usually a file/buffer). More...
 
LegoFloatoperator[] (int i)
 [AI] Provides direct access to a coordinate by index (read/write). More...
 
LegoFloat operator[] (int i) const
 [AI] Provides direct access to a coordinate by index (read-only). More...
 

Protected Attributes

LegoFloat m_coordinates [3]
 [AI] The x, y, and z coordinates of the vertex. [AI] More...
 

Detailed Description

[AI] Represents a 3D vertex with floating point coordinates.

Used to store 3D position information in the LEGO Island engine.

[AI] This class encapsulates a 3D point or vector with three coordinates (x, y, z), and provides accessor, mutator, and serialization methods. It can be used to represent geometry positions or transform points.

Definition at line 11 of file legovertex.h.

Constructor & Destructor Documentation

◆ LegoVertex()

LegoVertex::LegoVertex ( )

[AI] Constructs a LegoVertex at the origin (0, 0, 0).

Definition at line 9 of file legovertex.cpp.

Member Function Documentation

◆ GetCoordinate()

LegoFloat LegoVertex::GetCoordinate ( LegoU32  p_i)
inline

[AI] Gets the value of one of the xyz coordinates by index (0=x, 1=y, 2=z).

Parameters
p_iIndex of the coordinate (0, 1, or 2). [AI]
Returns
The coordinate value at the given index. [AI]

Definition at line 19 of file legovertex.h.

◆ GetX()

LegoFloat LegoVertex::GetX ( )
inline

[AI] Gets the X coordinate.

Definition at line 27 of file legovertex.h.

◆ GetY()

LegoFloat LegoVertex::GetY ( )
inline

[AI] Gets the Y coordinate.

Definition at line 34 of file legovertex.h.

◆ GetZ()

LegoFloat LegoVertex::GetZ ( )
inline

[AI] Gets the Z coordinate.

Definition at line 41 of file legovertex.h.

◆ IsOrigin()

LegoBool LegoVertex::IsOrigin ( )
inline

[AI] Checks whether the vertex is located at the origin (0,0,0).

[AI] Returns true if all coordinates are zero. Used to verify default or reset state.

Returns
True if the vertex is the origin; otherwise false. [AI]

Definition at line 50 of file legovertex.h.

◆ operator[]() [1/2]

LegoFloat & LegoVertex::operator[] ( int  i)
inline

[AI] Provides direct access to a coordinate by index (read/write).

Parameters
iIndex of the coordinate (0 for X, 1 for Y, 2 for Z). [AI]
Returns
Reference to the requested coordinate. [AI]

Definition at line 61 of file legovertex.h.

◆ operator[]() [2/2]

LegoFloat LegoVertex::operator[] ( int  i) const
inline

[AI] Provides direct access to a coordinate by index (read-only).

Parameters
iIndex of the coordinate (0 for X, 1 for Y, 2 for Z). [AI]
Returns
Value of the requested coordinate. [AI]

Definition at line 66 of file legovertex.h.

◆ Read()

LegoResult LegoVertex::Read ( LegoStorage p_storage)

[AI] Reads the coordinates from a storage object (usually a file/buffer).

Parameters
p_storagePointer to a LegoStorage for reading the coordinates. [AI]

[AI] Reads 3 floats in order (X, Y, Z) from the storage stream.

Returns
Indicates whether reading was successful or an error occurred. [AI]

Definition at line 17 of file legovertex.cpp.

◆ SetCoordinate()

void LegoVertex::SetCoordinate ( LegoU32  p_i,
LegoFloat  p_coordinate 
)
inline

[AI] Sets the value of one of the xyz coordinates by index (0=x, 1=y, 2=z).

Parameters
p_iIndex of the coordinate (0, 1, or 2). [AI]
p_coordinateThe new value for the coordinate. [AI]

Definition at line 24 of file legovertex.h.

◆ SetX()

void LegoVertex::SetX ( LegoFloat  p_x)
inline

[AI] Sets the X coordinate.

Parameters
p_xThe X value. [AI]

Definition at line 31 of file legovertex.h.

◆ SetY()

void LegoVertex::SetY ( LegoFloat  p_y)
inline

[AI] Sets the Y coordinate.

Parameters
p_yThe Y value. [AI]

Definition at line 38 of file legovertex.h.

◆ SetZ()

void LegoVertex::SetZ ( LegoFloat  p_z)
inline

[AI] Sets the Z coordinate.

Parameters
p_zThe Z value. [AI]

Definition at line 45 of file legovertex.h.

Member Data Documentation

◆ m_coordinates

LegoFloat LegoVertex::m_coordinates[3]
protected

[AI] The x, y, and z coordinates of the vertex. [AI]

Definition at line 70 of file legovertex.h.


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