GCubeSDK
©2026 FenixFox®Studios

GridHelper

GridHelper ⟵ LineObject3D

A helper class for creating grid patterns using Line geometry.
GridHelper creates a two-dimensional grid of lines, useful for visualizing coordinate systems, reference planes, and spatial relationships.

  • Configurable grid size and divisions
  • Separate colors for center lines and grid lines
  • Automatic geometry generation

Methods

GridHelper(f32 size, u32 divisions, const Color& colorCenterLine, const Color& colorGrid)

Constructor with size, divisions, and colors

size Size of the grid in world units 50.0f
divisions Number of divisions per side 10
colorCenterLine Color of center lines (RGBA) 0x444444FF
colorGrid Color of grid lines (RGBA) 0x888888FF

virtual Object3D* clone(bool recursive = true) const override

Creates a copy of this object

recursive Whether to clone children

virtual void copy(const Object3D& object, bool recursive = true) override

Copies properties from another object

object Source
recursive Copy children too

void setSize(f32 size)

Sets the size of the grid

size New size in world units

f32 getSize() const

Gets the current size of the grid

void setDivisions(u32 divisions)

Sets the number of divisions

divisions New number of divisions per side

u32 getDivisions() const

Gets the current number of divisions

void setColors(const Color& colorCenterLine, const Color& colorGrid)

Sets the colors for center and grid lines

colorCenterLine Color for center lines
colorGrid Color for grid lines

Properties

colorCenterLine Color Color of center lines (RGBA)
colorGrid Color Color of grid lines (RGBA)
divisions u32 Number of divisions per side
isGridHelper bool Read-only tag
size f32 Size of the grid in world units