voxelTerrain
 All Classes Functions Variables Typedefs Enumerations Pages
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
blub::procedural::voxel::edit::sphere< configType > Class Template Reference

The sphere class creates an interpolated voxel-sphere. More...

#include <sphere.hpp>

Inheritance diagram for blub::procedural::voxel::edit::sphere< configType >:
blub::procedural::voxel::edit::base< configType > blub::enableSharedFromThis< base< configType > > blub::noncopyable customEdit< configType >

Public Types

typedef configType t_config
 
typedef base< t_config > t_base
 
typedef sharedPointer< sphere
< t_config > > 
pointer
 
typedef t_config::t_data t_voxel
 
- Public Types inherited from blub::procedural::voxel::edit::base< configType >
typedef configType t_config
 
typedef enableSharedFromThis
< base< t_config > > 
t_base
 
typedef sharedPointer< base
< t_config > > 
pointer
 
typedef
t_config::t_container::t_simple 
t_voxelContainerSimple
 
typedef
t_config::t_container::t_tile 
t_voxelContainerTile
 
typedef t_config::t_data t_voxel
 
- Public Types inherited from blub::enableSharedFromThis< base< configType > >
typedef
std::enable_shared_from_this
< base< configType > > 
t_base
 
typedef blub::sharedPointer
< base< configType >const > 
t_thisPtrConst
 
typedef blub::sharedPointer
< base< configType > > 
t_thisPtr
 

Public Member Functions

void setSphere (const ::blub::sphere &desc)
 setSphere sets the describing sphere. Dont set it while caluculating voxel. More...
 
const ::blub::spheregetSphere () const
 getSphere More...
 
blub::axisAlignedBox getAxisAlignedBoundingBox (const blub::transform &trans) const override
 getAxisAlignedBoundingBox returns the transformed aab that includes the sphere. More...
 
- Public Member Functions inherited from blub::procedural::voxel::edit::base< configType >
virtual ~base ()
 destructor
 
void calculateVoxel (const transform &trans) const
 calculates voxel in the container u have to set by setVoxelContainer() before. If setVoxelContainer() didn't get called before, method will assert. More...
 
virtual void calculateVoxel (t_voxelContainerTile *voxelContainer, const vector3int32 &voxelContainerOffset, const transform &trans) const
 calculates all voxel in getAxisAlignedBoundingBox() and inserts them into voxelContainer. Method gets called once per tile from various threads. Voxel only will get set if the interpolation is higher than the inerpoaltion before calculation. More...
 
void setCut (const bool &cut)
 Enable or disable cut. Don't change the value while active calculation. More...
 
const bool & getCut () const
 Returns if cutting is enabled. More...
 
void setVoxelContainer (t_voxelContainerSimple *toSet)
 Sets the voxelcontainer used by calculateVoxel(). More...
 
t_voxelContainerSimple * getVoxelContainer () const
 
- Public Member Functions inherited from blub::enableSharedFromThis< base< configType > >
t_thisPtrConst getSharedThisPtr () const
 
t_thisPtr getSharedThisPtr ()
 

Static Public Member Functions

static pointer create (const ::blub::sphere &desc)
 creates an instance More...
 

Protected Member Functions

bool calculateOneVoxel (const vector3 &pos, t_voxel *resultVoxel) const override
 calculateOneVoxel calculates on voxel in getAxisAlignedBoundingBox(). More...
 
 sphere (const ::blub::sphere &desc)
 
- Protected Member Functions inherited from blub::procedural::voxel::edit::base< configType >
virtual void createLine (t_voxelContainerTile *voxelContainer, const vector3int32 &posVoxel, const real &from, const real &len, const axis &ax, const blub::plane &planeA, const blub::plane &planeB) const
 createLine creates a voxel-line on one axis with a specific length More...
 

Protected Attributes

::blub::sphere m_sphere
 
- Protected Attributes inherited from blub::procedural::voxel::edit::base< configType >
t_voxelContainerSimple * m_voxelContainer
 
bool m_cut
 

Additional Inherited Members

- Protected Types inherited from blub::procedural::voxel::edit::base< configType >
enum  axis { x, y, z }
 The axis enum is used by createLine() for describing the direction.
 

Detailed Description

template<class configType>
class blub::procedural::voxel::edit::sphere< configType >

The sphere class creates an interpolated voxel-sphere.

Examples:
customVertexInformation.cpp, mesh.cpp, noise.cpp, and primitives.cpp.

Member Function Documentation

template<class configType>
bool blub::procedural::voxel::edit::sphere< configType >::calculateOneVoxel ( const vector3 pos,
t_voxel resultVoxel 
) const
inlineoverrideprotectedvirtual

calculateOneVoxel calculates on voxel in getAxisAlignedBoundingBox().

Parameters
posabsolute voxel position.
resultVoxelinterpolation gets set if inside sphere.
Returns
true if voxel is inside sphere-radius+1. +1 because of interpolation.

Reimplemented from blub::procedural::voxel::edit::base< configType >.

template<class configType>
static pointer blub::procedural::voxel::edit::sphere< configType >::create ( const ::blub::sphere< configType > &  desc)
inlinestatic

creates an instance

Parameters
descDescribes the voxels to create
Returns
an instance of sphere as shared_ptr
Examples:
noise.cpp, and primitives.cpp.
template<class configType>
blub::axisAlignedBox blub::procedural::voxel::edit::sphere< configType >::getAxisAlignedBoundingBox ( const blub::transform trans) const
inlineoverridevirtual

getAxisAlignedBoundingBox returns the transformed aab that includes the sphere.

Parameters
transTransform.
Returns

Implements blub::procedural::voxel::edit::base< configType >.

template<class configType>
const ::blub::sphere& blub::procedural::voxel::edit::sphere< configType >::getSphere ( ) const
inline

getSphere

Returns
Returns the describing sphere
template<class configType>
void blub::procedural::voxel::edit::sphere< configType >::setSphere ( const ::blub::sphere< configType > &  desc)
inline

setSphere sets the describing sphere. Dont set it while caluculating voxel.

Parameters
desc

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