BrainTrain
|
Namespace for the whole BrainTrain Project. More...
Classes | |
class | AddInteractionCallbackToDrawableVisitor |
NodeVisitor for batch replacing all UserDataContainer of all Drawables. More... | |
class | AddPortalGunInteractionCallback |
InteractionCallback for adding the portal gun to the players inventar. More... | |
class | BaseInteractionCallback |
This is the TemplateClass for InteractionCallbacks. More... | |
class | Bench |
Bench class, creates a bench Object. More... | |
struct | BodyOfRotationFunction |
struct holding the function, which calculates the radius in dependece of the height. lambda (double)->double func, int end, BodyOfRotationFunction* nextFunc if one wish to have more then one function then the end value and nextFunc pointer must be set accordingly the end+1 is the beginning x of the next function More... | |
class | CelShading |
CelSading Effect, every child of this node will get the effect. More... | |
class | CelShadingTechnique |
The Technique for the cel-shading effect. More... | |
class | ControlRoom |
Control Room Class, derived from PositionAttitudeTransform, set ups the whole room as its own children. More... | |
class | DrunkenInteractionCallback |
Callback for the drunk effect. More... | |
class | FPSCameraManipulator |
A FPS style CameraManipulator with ground clamping and intersection. More... | |
class | GeometryPlacerVisitor |
NodeVisitor for batch replacing all Geometry in all visited Geodes. More... | |
class | KeyHandler |
Key Handler Class, handles all of our KeyFunctions, which do not belong to camera control (this are handled by FPSCameraManipulator) More... | |
class | ModifyMaterialVisitor |
Visitor for altering the material attributes, mainly used for objects craeted with blender. More... | |
class | ProgramSwitcherCallback |
Callback for switching the postprocess programs. More... | |
struct | RenderingPipeline |
struct holding the camera for the multi-rendering passes. Also holds the program vector for the post process pass. pass0Color, pass0depth, passPostProcess, program array, count programArray The program vector is used by the KeyHandler and the InteractionItems for changing the postprocess programs More... | |
class | ToonTexSwitcherCallback |
Callback for switching the ToonTextures. More... | |
class | TrainSwitcherCallback |
Callback for switching the "trains". More... | |
class | WeaponHUD |
WeaponHUD class, provides the functions to add a HUD camera to the scene. More... | |
Functions | |
void | createRenderingPipeline (unsigned int width, unsigned int height, osg::Node &rootForToon, osgViewer::Viewer &viewer, RenderingPipeline &pipe, osg::Vec3f &fogColor) |
creates the rendering pipeline More... | |
osg::ref_ptr< osg::LightSource > | createLight (const osg::Vec3 &pos, int lightNum, int point=1, double spotCutoff=180, double spotExponent=0) |
creates a Light with a lightsource More... | |
osg::ref_ptr< osg::Camera > | createRTTCamera (osg::Camera::BufferComponent buffer, osg::Texture *tex, bool isAbsolute=false) |
creates a RTTCam More... | |
osg::ref_ptr< osg::Geode > | createScreenQuad (float width, float height, float scale=1.0f) |
creates a texture-ready screen quad for postprocessing More... | |
osg::ref_ptr< osg::Camera > | createHUDCamera (double left, double right, double bottom, double top) |
creates a HUD-Cam with a 2D-orthogonal projection matrix More... | |
osg::ref_ptr< osgText::Text > | createText (const osg::Vec3 &pos, const std::string &content, float size) |
creates a (arial) text object for use with a hud camera More... | |
osg::ref_ptr< osg::Geometry > | createBodyOfRotation (double height, int hsteps, int rsteps, const BodyOfRotationFunction &function) |
Creates a body of rotation. More... | |
osg::ref_ptr< osg::Geometry > | createRectangle (double length, double width, int lsteps, int wsteps) |
Creates a Rectangle with TRIANGLE_STRIPS. More... | |
osg::ref_ptr< osg::Geometry > | createRectangleWithTexcoords (double length, double width, int lsteps, int wsteps) |
Creates a Rectangle with TRIANGLE_STRIPS. More... | |
osg::ref_ptr< osg::Group > | createCuboid (const double length, const double width, const double height, const double factor=6) |
Creates a Cubiod with TRIANGLE_STRIPS using the createRectangle function. More... | |
osg::ref_ptr < osg::PositionAttitudeTransform > | wrapInPositionAttitudeTransform (osg::Node *srcNode, const osg::Vec3d &pos) |
Return the given Node in a PositionAttitudeTransform with a given position. More... | |
osg::ref_ptr< osg::Geometry > | createBeerBottle () |
Creates a BeerBottle with Material with the help of the BodyOfRotationFunction. More... | |
osg::ref_ptr< osg::Geometry > | createRealBottle () |
Creates a Bottle with Material with the help of the BodyOfRotationFunction. More... | |
osg::ref_ptr< osg::Geometry > | createVase () |
Creates a vase with Material with the help of the BodyOfRotationFunction. More... | |
osg::ref_ptr< osg::Geometry > | createStalk () |
Creates a stalk with Material with the help of the BodyOfRotationFunction. More... | |
osg::ref_ptr< osg::Geometry > | createBud () |
Creates a bud with Material with the help of the BodyOfRotationFunction. More... | |
osg::ref_ptr< osg::Geometry > | createChessFigure () |
Creates a "ChessFigure" with Material with the help of the BodyOfRotationFunction. More... | |
osg::ref_ptr < osg::PositionAttitudeTransform > | createVaseWithFlower () |
combines the stalk, bud and vase in a postitionAttitudetransform More... | |
osg::ref_ptr< osg::Geode > | createCrosshair (unsigned int width, unsigned int height) |
creates a crosshair in the middle of the screen More... | |
osg::ref_ptr< osg::Texture2D > | createToonTex (std::string toonTex) |
creates a Texture2D object with the given toonTex More... | |
osg::ref_ptr< osg::Material > | createSimpleMaterial (osg::Material::Face face, const osg::Vec4 &diffuse, const osg::Vec4 &ambient, const osg::Vec4 &specular, const double shininess) |
creates a simple material More... | |
osg::Vec3 | getDimensionOfNode (osg::Node *source) |
return the dimension of a node (width, height, length) More... | |
ref_ptr< LightSource > | createLight (const Vec3 &pos, int lightNum, int point, double spotCutoff, double spotExponent) |
void | createRenderingPipeline (unsigned int width, unsigned int height, osg::Node &rootForToon, osgViewer::Viewer &viewer, RenderingPipeline &pipe, Vec3f &fogColor) |
osg::Vec3 | getDimensionOfNode (Node *source) |
Variables | |
const int | collisionMask = 0x1 |
const int | interactionMask = 0x2 |
const int | interactionAndCollisionMask = collisionMask | interactionMask |
const int | fakeWallMask = 0x4 |
Namespace for the whole BrainTrain Project.
osg::ref_ptr< osg::Geometry > brtr::createBeerBottle | ( | ) |
Creates a BeerBottle with Material with the help of the BodyOfRotationFunction.
Definition at line 352 of file UtilFunctions.cpp.
osg::ref_ptr< osg::Geometry > brtr::createBodyOfRotation | ( | double | height, |
int | hsteps, | ||
int | rsteps, | ||
const BodyOfRotationFunction & | function | ||
) |
Creates a body of rotation.
Radius depends on height. (i.e. function x is height) Function is a modified createRectangle() from Chapter 7, CG1 Lecture Script by Frauke Sprengel
height | the height of the body |
hsteps | height resolution, more steps equals more triangles, hence better lightning, but more performance cost |
rsteps | radius resolution, if rsteps value is too small, the cylinder may become a triangle or something else |
function | a BodyOfRotationFunction, which determines the radius in dependence of the height |
Definition at line 151 of file UtilFunctions.cpp.
osg::ref_ptr< osg::Geometry > brtr::createBud | ( | ) |
Creates a bud with Material with the help of the BodyOfRotationFunction.
Function provided by Florian Wicke
Definition at line 477 of file UtilFunctions.cpp.
osg::ref_ptr< osg::Geometry > brtr::createChessFigure | ( | ) |
Creates a "ChessFigure" with Material with the help of the BodyOfRotationFunction.
Function provided by Florian Wicke
Definition at line 500 of file UtilFunctions.cpp.
osg::ref_ptr< osg::Geode > brtr::createCrosshair | ( | unsigned int | width, |
unsigned int | height | ||
) |
creates a crosshair in the middle of the screen
width | screenwidth |
height | screenheight |
Definition at line 555 of file UtilFunctions.cpp.
ref_ptr< osg::Group > brtr::createCuboid | ( | const double | length, |
const double | width, | ||
const double | height, | ||
const double | factor = 6 |
||
) |
Creates a Cubiod with TRIANGLE_STRIPS using the createRectangle function.
Uses 6 Rectangles and creates a Cuboid of it.
length | desired length of the Cuboid |
width | desired length of the Cuboid |
height | desired length of the Cuboid |
factor | the higher the number the greater the resolution in all dimension |
Definition at line 245 of file UtilFunctions.cpp.
ref_ptr< Camera > brtr::createHUDCamera | ( | double | left, |
double | right, | ||
double | bottom, | ||
double | top | ||
) |
creates a HUD-Cam with a 2D-orthogonal projection matrix
Original Function by Rui Wang/Xuelei Qian from OSG 3 Cookbook, Packt Publishing, 2012
left | left bound of the projection matrix |
right | right bound of the projection matrix |
bottom | bottom bound of the projection matrix |
top | top bound of the projection matrix |
Definition at line 61 of file UtilFunctions.cpp.
osg::ref_ptr<osg::LightSource> brtr::createLight | ( | const osg::Vec3 & | pos, |
int | lightNum, | ||
int | point = 1 , |
||
double | spotCutoff = 180 , |
||
double | spotExponent = 0 |
||
) |
creates a Light with a lightsource
pos | light position |
lightNum | gl_light num (must be 0 to 7) |
point | 1 = point light, 0 = directional light |
spotCutoff | |
spotExponent |
ref_ptr<LightSource> brtr::createLight | ( | const Vec3 & | pos, |
int | lightNum, | ||
int | point, | ||
double | spotCutoff, | ||
double | spotExponent | ||
) |
Definition at line 222 of file UtilFunctions.cpp.
osg::ref_ptr< osg::Geometry > brtr::createRealBottle | ( | ) |
Creates a Bottle with Material with the help of the BodyOfRotationFunction.
Function provided by Florian Wicke
Definition at line 377 of file UtilFunctions.cpp.
ref_ptr< Geometry > brtr::createRectangle | ( | double | length, |
double | width, | ||
int | lsteps, | ||
int | wsteps | ||
) |
Creates a Rectangle with TRIANGLE_STRIPS.
Function is copy/pasted from Chapter 7, CG1 Lecture Script by Frauke Sprengel
length | desired length of the rectangle |
width | desired width of the rectangle |
lsteps | the higher the number the greater the resolution in the length dimension |
wsteps | the higher the number the greater the resolution in the width dimension |
Definition at line 72 of file UtilFunctions.cpp.
ref_ptr< Geometry > brtr::createRectangleWithTexcoords | ( | double | length, |
double | width, | ||
int | lsteps, | ||
int | wsteps | ||
) |
Creates a Rectangle with TRIANGLE_STRIPS.
Function is copy/pasted from Chapter 7, CG1 Lecture Script by Frauke Sprengel Added the TexCoordArray. If the width/length ratio lower than 1:4 or 4:1 the texture coordiantes are streched to fit the Rectangle
length | desired length of the rectangle |
width | desired width of the rectangle |
lsteps | the higher the number the greater the resolution in the length dimension |
wsteps | the higher the number the greater the resolution in the width dimension |
Definition at line 118 of file UtilFunctions.cpp.
void brtr::createRenderingPipeline | ( | unsigned int | width, |
unsigned int | height, | ||
osg::Node & | rootForToon, | ||
osgViewer::Viewer & | viewer, | ||
RenderingPipeline & | pipe, | ||
osg::Vec3f & | fogColor | ||
) |
creates the rendering pipeline
Creates the cameras and textures, attachs the textures to the cameras, set the projectionmatrix
width | the width of the texture, should be screenwidth |
height | the height of the texture, should be screenheight |
rootForToon | Node which the CelShade effect will be applied to |
viewer | clipping pane and projectionmatrix will be set on this viewers cam |
pipe | pipe struct which should be filled |
void brtr::createRenderingPipeline | ( | unsigned int | width, |
unsigned int | height, | ||
osg::Node & | rootForToon, | ||
osgViewer::Viewer & | viewer, | ||
RenderingPipeline & | pipe, | ||
Vec3f & | fogColor | ||
) |
Definition at line 283 of file UtilFunctions.cpp.
ref_ptr< osg::Camera > brtr::createRTTCamera | ( | osg::Camera::BufferComponent | buffer, |
osg::Texture * | tex, | ||
bool | isAbsolute = false |
||
) |
creates a RTTCam
Original Function by Rui Wang/Xuelei Qian from OSG 3 Cookbook, Packt Publishing, 2012
buffer | which buffer should be written to texture |
tex | on this texture the buffer will be written to |
isAbsolute | absolute or relative reference frame |
Definition at line 25 of file UtilFunctions.cpp.
ref_ptr< osg::Geode > brtr::createScreenQuad | ( | float | width, |
float | height, | ||
float | scale = 1.0f |
||
) |
creates a texture-ready screen quad for postprocessing
Original Function by Rui Wang/Xuelei Qian from OSG 3 Cookbook, Packt Publishing, 2012
width | width of the quad |
height | height of the quad |
scale | scale of the quad |
Definition at line 47 of file UtilFunctions.cpp.
osg::ref_ptr< osg::Material > brtr::createSimpleMaterial | ( | osg::Material::Face | face, |
const osg::Vec4 & | diffuse, | ||
const osg::Vec4 & | ambient, | ||
const osg::Vec4 & | specular, | ||
const double | shininess | ||
) |
creates a simple material
diffuse | diffuse lighting |
ambient | ambient lighting |
specular | specular lighting |
shininess | the shininess |
Definition at line 597 of file UtilFunctions.cpp.
osg::ref_ptr< osg::Geometry > brtr::createStalk | ( | ) |
Creates a stalk with Material with the help of the BodyOfRotationFunction.
Function provided by Florian Wicke
Definition at line 451 of file UtilFunctions.cpp.
osg::ref_ptr< osgText::Text > brtr::createText | ( | const osg::Vec3 & | pos, |
const std::string & | content, | ||
float | size | ||
) |
creates a (arial) text object for use with a hud camera
Original Function by Rui Wang/Xuelei Qian from OSG 3 Cookbook, Packt Publishing, 2012
pos | postion of the text in x_y plane |
content | |
size |
Definition at line 210 of file UtilFunctions.cpp.
osg::ref_ptr< osg::Texture2D > brtr::createToonTex | ( | std::string | toonTex | ) |
creates a Texture2D object with the given toonTex
filename | of the toontex |
Definition at line 614 of file UtilFunctions.cpp.
osg::ref_ptr< osg::Geometry > brtr::createVase | ( | ) |
Creates a vase with Material with the help of the BodyOfRotationFunction.
Function provided by Florian Wicke
Definition at line 412 of file UtilFunctions.cpp.
osg::ref_ptr< osg::PositionAttitudeTransform > brtr::createVaseWithFlower | ( | ) |
combines the stalk, bud and vase in a postitionAttitudetransform
Definition at line 581 of file UtilFunctions.cpp.
osg::Vec3 brtr::getDimensionOfNode | ( | osg::Node * | source | ) |
return the dimension of a node (width, height, length)
source | node, which dimension one want to know |
osg::Vec3 brtr::getDimensionOfNode | ( | Node * | source | ) |
Definition at line 606 of file UtilFunctions.cpp.
osg::ref_ptr< osg::PositionAttitudeTransform > brtr::wrapInPositionAttitudeTransform | ( | osg::Node * | srcNode, |
const osg::Vec3d & | pos | ||
) |
Return the given Node in a PositionAttitudeTransform with a given position.
srcNode | the Node which should be moved |
pos | the relative position change |
Definition at line 238 of file UtilFunctions.cpp.
const int brtr::collisionMask = 0x1 |
Definition at line 27 of file UtilFunctions.h.
const int brtr::fakeWallMask = 0x4 |
Definition at line 30 of file UtilFunctions.h.
const int brtr::interactionAndCollisionMask = collisionMask | interactionMask |
Definition at line 29 of file UtilFunctions.h.
const int brtr::interactionMask = 0x2 |
Definition at line 28 of file UtilFunctions.h.