Skip to content

Function: useBody()

ts
function useBody(
   config, 
   tileSize, 
   options?): Body;

Factory that builds a complete celestial body — hex mesh, interactive raycast proxy, smooth display mesh, atmosphere glow, rings and effect layers — deterministically from a BodyConfig.

Dispatches to the star sub-builder (which keeps its own smooth + hex meshes) or to the dual-board planet path (rocky / metallic / gaseous all share the same sol mesh + atmo board pair).

Parameters

ParameterTypeDescription
configBodyConfigPhysics + visual configuration of the body.
tileSizenumberTarget world-space tile edge length (drives subdivisions on both sol and atmo hexaspheres).
options?UseBodyOptionsOptional hooks — see UseBodyOptions.

Returns

Body

Distribué sous la licence indiquée dans le dépôt.