Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | Friends | List of all members
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. More...
 

Private Member Functions

void DrawSides ()
 
void DrawTop ()
 

Private Attributes

Bounds global_z
 z extent in global coordinates. More...
 
Bounds local_z
 z extent in local coords. More...
 
std::vector< point_tpts
 points defining a polygon. More...
 
std::vector< Cell * > rendered_cells [2]
 

Friends

class BlockGroup
 
class Canvas
 
class Cell
 
class Model
 
class SuperRegion
 
class World
 

Detailed Description

Definition at line 1128 of file stage.hh.

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.

Definition at line 12 of file block.cc.

◆ Block() [2/2]

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

A from-file constructor

Definition at line 20 of file block.cc.

◆ ~Block()

Block::~Block ( )

Definition at line 30 of file block.cc.

Member Function Documentation

◆ AppendTouchingModels()

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

Definition at line 116 of file block.cc.

◆ 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

Definition at line 69 of file block.cc.

◆ 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

Definition at line 49 of file block.cc.

◆ DrawFootPrint()

void Block::DrawFootPrint ( )

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

Definition at line 295 of file block.cc.

◆ DrawSides()

void Block::DrawSides ( )
private

Definition at line 280 of file block.cc.

◆ DrawSolid()

void Block::DrawSolid ( bool  topview)

draw the block in OpenGL as a solid single color

Definition at line 303 of file block.cc.

◆ DrawTop()

void Block::DrawTop ( )
private

Definition at line 269 of file block.cc.

◆ Load()

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

Definition at line 309 of file block.cc.

◆ Map()

void Block::Map ( unsigned int  layer)

render the block into the world's raytrace data structure

Definition at line 170 of file block.cc.

◆ Rasterize()

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

Definition at line 198 of file block.cc.

◆ 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

Definition at line 88 of file block.cc.

◆ 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

Definition at line 102 of file block.cc.

◆ 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

Definition at line 95 of file block.cc.

◆ SetZ()

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

Set the extent in Z of the block

Definition at line 107 of file block.cc.

◆ TestCollision()

Model * Block::TestCollision ( )

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

Definition at line 129 of file block.cc.

◆ Translate()

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

Translate all points in the block by the indicated amounts

Definition at line 36 of file block.cc.

◆ UnMap()

void Block::UnMap ( unsigned int  layer)

remove the block from the world's raytracing data structure

Definition at line 183 of file block.cc.

Friends And Related Function Documentation

◆ BlockGroup

friend class BlockGroup
friend

Definition at line 1129 of file stage.hh.

◆ Canvas

friend class Canvas
friend

Definition at line 1133 of file stage.hh.

◆ Cell

friend class Cell
friend

Definition at line 1134 of file stage.hh.

◆ Model

friend class Model
friend

Definition at line 1130 of file stage.hh.

◆ SuperRegion

friend class SuperRegion
friend

Definition at line 1131 of file stage.hh.

◆ World

friend class World
friend

Definition at line 1132 of file stage.hh.

Member Data Documentation

◆ global_z

Bounds Stg::Block::global_z
private

z extent in global coordinates.

Definition at line 1194 of file stage.hh.

◆ group

BlockGroup* Stg::Block::group

The BlockGroup to which this Block belongs.

Definition at line 1190 of file stage.hh.

◆ local_z

Bounds Stg::Block::local_z
private

z extent in local coords.

Definition at line 1193 of file stage.hh.

◆ pts

std::vector<point_t> Stg::Block::pts
private

points defining a polygon.

Definition at line 1192 of file stage.hh.

◆ rendered_cells

std::vector<Cell *> Stg::Block::rendered_cells[2]
private

record the cells into which this block has been rendered so we can remove them very quickly. One vector for each of the two bitmap layers.

Definition at line 1199 of file stage.hh.


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


stage
Author(s): Richard Vaughan , Brian Gerkey , Reed Hedges , Andrew Howard , Toby Collett , Pooya Karimian , Jeremy Asher , Alex Couture-Beil , Geoff Biggs , Rich Mattes , Abbas Sadat
autogenerated on Mon Feb 28 2022 23:48:56