SG_Voxel
— Agar-SG
voxel object
#include <agar/core.h>
#include <agar/sg.h>
The SG_Voxel
node renders a
three-dimensional array of real-valued "cells".
SG_Voxel *
SG_VoxelNew
(SG_Node
*parent, const char
*name);
void
SG_VoxelAlloc3
(SG_Voxel
*vol, Uint width,
Uint height,
Uint depth);
int
SG_VoxelSet3
(SG_Voxel
*vol, int x,
int y,
int z,
M_Real value);
void
SG_VoxelReset3
(SG_Voxel
*vol, M_Real
value);
The
SG_VoxelNew
()
function creates a new voxel object at the origin of the
parent node.
SG_VoxelAlloc3
()
allocates a voxel of specified dimensions.
SG_VoxelSet3
()
sets the value of the cell at coordinates x,
y, z to the specified
value. Returns 0 on success, -1 if the coordinates are
invalid.
The
SG_VoxelReset3
()
function resets the value of all cells to the specified
value.
For the SG_Voxel
object:
- M_Real ***map
- Three-dimensional array of cell values.
- int w
- Total width.
- int h
- Total height.
- int d
- Total depth.
The SG_Voxel
node class first appeared in
Agar 1.6.0.