igor::iVoxelTerrain Class Reference

#include <iVoxelTerrain.h>

Public Member Functions

 iVoxelTerrain (iVoxelTerrainGenerateDelegate generateVoxelsDelegate, iVoxelTerrainPlacePropsDelegate placePropsDelegate, uint32 lodCount=11, uint32 voxelBlockSetupDistance=4, const iaVector3I &maxDiscoveryBoundaries=iaVector3I(100000, 100000, 100000))
 
 ~iVoxelTerrain ()
 
void setScene (iScenePtr scene)
 
void setLODTrigger (uint32 lodTriggerID)
 
void setPhysicsMaterialID (uint64 materialID)
 
uint64 getPhysicsMaterialID () const
 
iMaterialPtr getMaterial () const
 
void modify (const iAABoxI &box, uint8 density)
 
void modify (const iaSphereI &sphere, uint8 density)
 
bool castRay (const iaVector3I &from, const iaVector3I &to, iaVector3I &outside, iaVector3I &inside)
 
uint8 getVoxelDensity (iaVector3I pos)
 

Static Public Attributes

static const int32 _voxelBlockSize = 32
 
static const int32 _voxelBlockOverlap = 2
 

Friends

class iTaskVoxelTerrain
 

Detailed Description

voxel terrain class

Constructor & Destructor Documentation

◆ iVoxelTerrain()

igor::iVoxelTerrain::iVoxelTerrain ( iVoxelTerrainGenerateDelegate  generateVoxelsDelegate,
iVoxelTerrainPlacePropsDelegate  placePropsDelegate,
uint32  lodCount = 11,
uint32  voxelBlockSetupDistance = 4,
const iaVector3I maxDiscoveryBoundaries = iaVector3I(100000, 100000, 100000) 
)

initializes voxel terrain

Parameters
generateVoxelsDelegatecallback to generate voxel data
lodCountcount of level of detail allowed range is 2-11 (right now the lowest LOD is not visible)
voxelBlockSetupDistancedistance in blocks of the lowest level of detail to be generated and visible when in range
maxDiscoveryBoundariesoptionally adding boundaries to the discovery area. Values are in voxel block coordinates of the lowest LOD

◆ ~iVoxelTerrain()

igor::iVoxelTerrain::~iVoxelTerrain ( )

deinit

Member Function Documentation

◆ castRay()

bool igor::iVoxelTerrain::castRay ( const iaVector3I from,
const iaVector3I to,
iaVector3I outside,
iaVector3I inside 
)

casts ray to voxels to detect intersection

Parameters
fromfrom where the ray is cast
toto where the ray is cast to
[out]outsideif there is an intersection this is the last voxel right before
[out]insideif there is an intersection this is the first voxel with density greater zero
Returns
true if there was an intersection

◆ getMaterial()

iMaterialPtr igor::iVoxelTerrain::getMaterial ( ) const
Returns
target material

◆ getPhysicsMaterialID()

uint64 igor::iVoxelTerrain::getPhysicsMaterialID ( ) const
Returns
terrain material ID

◆ getVoxelDensity()

uint8 igor::iVoxelTerrain::getVoxelDensity ( iaVector3I  pos)
Returns
voxel density at given position
Parameters
posthe given position

◆ modify() [1/2]

void igor::iVoxelTerrain::modify ( const iAABoxI box,
uint8  density 
)

modifies voxel data by manipulating a box area

Parameters
boxthe defined box area to manipulate
densitythe density to set within the box area

◆ modify() [2/2]

void igor::iVoxelTerrain::modify ( const iaSphereI sphere,
uint8  density 
)

modifies voxel data by manipulating a sphere area

Parameters
spherethe defined area to manipulate
densitythe density to set within the box area

◆ setLODTrigger()

void igor::iVoxelTerrain::setLODTrigger ( uint32  lodTriggerID)

sets lod trigger node to monitor

Parameters
lodTriggerIDthe lod trigger's id

◆ setPhysicsMaterialID()

void igor::iVoxelTerrain::setPhysicsMaterialID ( uint64  materialID)

sets physics material ID

Parameters
materialIDthe material ID to use

◆ setScene()

void igor::iVoxelTerrain::setScene ( iScenePtr  scene)

sets the scene and initializes the terrain

Parameters
scenethe scene to put the terrain in

Friends And Related Function Documentation

◆ iTaskVoxelTerrain

friend class iTaskVoxelTerrain
friend

Member Data Documentation

◆ _voxelBlockOverlap

const int32 igor::iVoxelTerrain::_voxelBlockOverlap = 2
static

block overlap

◆ _voxelBlockSize

const int32 igor::iVoxelTerrain::_voxelBlockSize = 32
static

block qubic size


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