VoxelEngine
 
Loading...
Searching...
No Matches
engine::Block Class Reference
Inheritance diagram for engine::Block:
engine::VariantBlock

Public Member Functions

 Block (BlockID id, Layer layer, const Geometry *geo)
 
 Block (BlockID id, Layer layer, const Geometry *geo, RotationMode rotationMode)
 
virtual bool onInteract (InteractContext *context) const
 
virtual void onDestroyed (const BlockSetContext &context) const
 
virtual void onPlaced (const BlockSetContext &context) const
 
bool isAir () const
 
bool isMultiblock () const
 
BlockID getID () const
 
const Geometrygeometry () const
 
bool isSolid () const
 
bool isVoxel () const
 
bool facingUp () const
 
Layer layer () const
 
RotationMode rotationMode () const
 
BlockrotationMode (RotationMode mode)
 
BlockisSolid (bool solid)
 
BlockisVoxel (bool voxel)
 
BlockfacingUp (bool state)
 
Blockmaterial (const BlockMaterial &mat)
 
const BlockMaterialmaterial () const
 

Static Public Member Functions

static Blockair ()
 
static Blockmultiblock ()
 

Static Public Attributes

static constexpr BlockID AirID = 0
 Reserved block ID range: 0-8 (inclusive).
 
static constexpr BlockID MultiblockID = 1
 

Protected Attributes

bool m_isSolid
 
bool m_isVoxel
 
bool m_faceUp = false
 
Layer m_layer
 
RotationMode m_rotationMode = RotationMode::None
 
const Geometrym_geometry
 
BlockMaterial m_material
 

Member Function Documentation

◆ facingUp()

Block & Block::facingUp ( bool  state)
Note
Denotes the base orientation of the block model and texture. Blocks have to be modeled so the base orientation is either up or north.

Member Data Documentation

◆ AirID

constexpr BlockID engine::Block::AirID = 0
staticconstexpr

Reserved block ID range: 0-8 (inclusive).

Note
Block IDs 0-8 are reserved for engine use: 0: Air 1: Multiblock 2-8: (reserved for future/engine use; see Engine.cpp lines 34-40)

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