Agar
Agar 1.7 Manual

SG_Voxel(3)

SYNOPSIS

#include <agar/core.h>
#include <agar/sg.h>

DESCRIPTION

The SG_Voxel node renders a three-dimensional array of real-valued "cells".

INHERITANCE HIERARCHY

AG_Object(3)-> SG_Node(3)-> SG_Voxel.

INITIALIZATION


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.

STRUCTURE DATA

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.

SEE ALSO

M_Real(3), SG(3), SG_Intro(3), SG_Node(3)

HISTORY

The SG_Voxel node class first appeared in Agar 1.6.0.


ElectronTubeStore Csoft.net www.libAgar.org is © 2024 Julien Nadeau Carriere <vedge@csoft.net>.
Support LibAgar: www.patreon.com/libAgar.