Stg::Block Class Reference

#include <stage.hh>

Public Member Functions

void AppendTouchingModels (std::set< Model * > &touchers)
 
 Block (BlockGroup *group, const std::vector< point_t > &pts, const Bounds &zrange)
 
 Block (BlockGroup *group, Worldfile *wf, int entity)
 
double CenterX ()
 
double CenterY ()
 
void DrawFootPrint ()
 
void DrawSolid (bool topview)
 
void Load (Worldfile *wf, int entity)
 
void Map (unsigned int layer)
 
void Rasterize (uint8_t *data, unsigned int width, unsigned int height, meters_t cellwidth, meters_t cellheight)
 
void SetCenter (double x, double y)
 
void SetCenterX (double y)
 
void SetCenterY (double y)
 
void SetZ (double min, double max)
 
ModelTestCollision ()
 
void Translate (double x, double y)
 
void UnMap (unsigned int layer)
 
 ~Block ()
 

Public Attributes

BlockGroupgroup
 The BlockGroup to which this Block belongs.
 

Constructor & Destructor Documentation

◆ Block() [1/2]

Block::Block ( BlockGroup group,
const std::vector< point_t > &  pts,
const Bounds zrange 
)

Block Constructor. A model's body is a list of these blocks. The point data is copied, so pts can safely be freed after constructing the block.

Create a new block. A model's body is a list of these blocks. The point data is copied, so pts can safely be freed after calling this.

◆ Block() [2/2]

Block::Block ( BlockGroup group,
Worldfile wf,
int  entity 
)

A from-file constructor

◆ ~Block()

Block::~Block ( )

Member Function Documentation

◆ AppendTouchingModels()

void Block::AppendTouchingModels ( std::set< Model * > &  touchers)

◆ CenterX()

double Block::CenterX ( )

Return the center of the block on the X axis

Return the value half way between the min and max X position of the polygon points

◆ CenterY()

double Block::CenterY ( )

Return the center of the block on the Y axis

Return the value half way between the min and max Y position of the polygon points

◆ DrawFootPrint()

void Block::DrawFootPrint ( )

draw the projection of the block onto the z=0 plane

◆ DrawSolid()

void Block::DrawSolid ( bool  topview)

draw the block in OpenGL as a solid single color

◆ Load()

void Block::Load ( Worldfile wf,
int  entity 
)

◆ Map()

void Block::Map ( unsigned int  layer)

render the block into the world's raytrace data structure

◆ Rasterize()

void Block::Rasterize ( uint8_t *  data,
unsigned int  width,
unsigned int  height,
meters_t  cellwidth,
meters_t  cellheight 
)

◆ SetCenter()

void Block::SetCenter ( double  x,
double  y 
)

Set the center of the block

move the block by the distance required to bring its center to the requested position

◆ SetCenterX()

void Block::SetCenterX ( double  x)

Set the center of the block on the X axis

move the block by the distance required to bring its center to the requested position

◆ SetCenterY()

void Block::SetCenterY ( double  y)

Set the center of the block on the Y axis

move the block by the distance required to bring its center to the requested position

◆ SetZ()

void Block::SetZ ( double  min,
double  max 
)

Set the extent in Z of the block

◆ TestCollision()

Model * Block::TestCollision ( )

Returns the first model that shares a bitmap cell with this model

◆ Translate()

void Block::Translate ( double  x,
double  y 
)

Translate all points in the block by the indicated amounts

◆ UnMap()

void Block::UnMap ( unsigned int  layer)

remove the block from the world's raytracing data structure

Member Data Documentation

◆ group

BlockGroup* Stg::Block::group

The BlockGroup to which this Block belongs.


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