BrainTrain
 All Classes Namespaces Files Functions Variables Macros Pages
brtr::Bench Class Reference

Bench class, creates a bench Object. More...

#include <Bench.h>

Inheritance diagram for brtr::Bench:

Public Member Functions

 Bench (const Vec3 &pcenter=Vec3(0, 0, 0), const double plength=8)
 
ref_ptr
< PositionAttitudeTransform > 
getHitbox (const double alpha, double height=8)
 return the Hitbox of the Bench More...
 
 Bench (const Bench &, const CopyOp &copyop=CopyOp::SHALLOW_COPY)
 
 ~Bench ()
 

Private Member Functions

void initBench (const double plength)
 initialize the bench More...
 
ref_ptr< Material > createIronMaterial ()
 create the material for iron objects More...
 
ref_ptr< Material > createWoodMaterial ()
 create the material for wood objects More...
 
ref_ptr< Group > createLeg ()
 
ref_ptr< Group > createBar ()
 
ref_ptr< Group > createSeat (const double width)
 creates the seat More...
 
ref_ptr< Group > createArmrest (double radius, double width, double length, double totalwidth)
 creates the armrest More...
 
ref_ptr< Geometry > createArmrestSidesFrontBack (double radius, double width, int lsteps, int wsteps, bool flip=true)
 creates the front/back for the armrest More...
 
ref_ptr< Geometry > createArmrestSidesLeftRight (double length, double width, int lsteps, int wsteps, bool flip=true)
 creates the left/rigth for the armrest More...
 
ref_ptr< DrawElementsUInt > getPrimitiveSetforARectangle (int lsteps, int wsteps)
 creates a primitives set for the getRectangle function More...
 

Private Attributes

Vec3 center
 
double length
 
ref_ptr< Group > bench
 

Detailed Description

Bench class, creates a bench Object.

creates a bench with a given length at a given position. The length has to be between 2 and 30

Author
Marcel Felix
Version
1.0
Date
2014

Definition at line 24 of file Bench.h.

Constructor & Destructor Documentation

brtr::Bench::Bench ( const Vec3 &  pcenter = Vec3(0, 0, 0),
const double  plength = 8 
)

Definition at line 7 of file Bench.cpp.

brtr::Bench::Bench ( const Bench copy,
const CopyOp &  copyop = CopyOp::SHALLOW_COPY 
)

Definition at line 18 of file Bench.cpp.

brtr::Bench::~Bench ( )

Definition at line 21 of file Bench.cpp.

Member Function Documentation

ref_ptr< Group > brtr::Bench::createArmrest ( double  radius,
double  width,
double  length,
double  totalwidth 
)
private

creates the armrest

Parameters
radiusthe distance between bench and armrest
widthwidth of the armrest
lengthlength of the armrest
totalwidthwidth of the bar on the armrest

Definition at line 252 of file Bench.cpp.

ref_ptr< Geometry > brtr::Bench::createArmrestSidesFrontBack ( double  radius,
double  width,
int  lsteps,
int  wsteps,
bool  flip = true 
)
private

creates the front/back for the armrest

Parameters
radiusthe distance between bench and armrest
widthwidth of the armrest
lengthlength of the armrest
flipswitch between front and back creation

Definition at line 140 of file Bench.cpp.

ref_ptr< Geometry > brtr::Bench::createArmrestSidesLeftRight ( double  length,
double  width,
int  lsteps,
int  wsteps,
bool  flip = true 
)
private

creates the left/rigth for the armrest

Parameters
radiusthe distance between bench and armrest
widthwidth of the armrest
lengthlength of the armrest
flipswitch between front and back creation

Definition at line 84 of file Bench.cpp.

ref_ptr< Group > brtr::Bench::createBar ( )
private

Definition at line 331 of file Bench.cpp.

ref_ptr< Material > brtr::Bench::createIronMaterial ( )
private

create the material for iron objects

Definition at line 53 of file Bench.cpp.

ref_ptr< Group > brtr::Bench::createLeg ( )
private

Definition at line 190 of file Bench.cpp.

ref_ptr< Group > brtr::Bench::createSeat ( const double  width)
private

creates the seat

Parameters
widththe width/length of the Seat

Definition at line 212 of file Bench.cpp.

ref_ptr< Material > brtr::Bench::createWoodMaterial ( )
private

create the material for wood objects

Definition at line 62 of file Bench.cpp.

ref_ptr< PositionAttitudeTransform > brtr::Bench::getHitbox ( const double  alpha,
double  height = 8 
)

return the Hitbox of the Bench

Parameters
alpha
heightthe height of the hitbox. height < 0 will use the height of the bench
Returns
the hitbox as a PositionAttitudeTransform with the given alpha value

Definition at line 24 of file Bench.cpp.

ref_ptr< DrawElementsUInt > brtr::Bench::getPrimitiveSetforARectangle ( int  lsteps,
int  wsteps 
)
private

creates a primitives set for the getRectangle function

parts of the function are copy/pasted from Chapter 7, CG1 Lecture Script by Frauke Sprengel

Parameters
lsteps
wsteps
Returns
a ref_ptr<DrawElementsUInt> containing the primitives set

Definition at line 71 of file Bench.cpp.

void brtr::Bench::initBench ( const double  plength)
private

initialize the bench

Parameters
plengththe length of the bench

Definition at line 360 of file Bench.cpp.

Member Data Documentation

ref_ptr<Group> brtr::Bench::bench
private

Definition at line 108 of file Bench.h.

Vec3 brtr::Bench::center
private

Definition at line 105 of file Bench.h.

double brtr::Bench::length
private

Definition at line 107 of file Bench.h.


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