PCG Lib
Library for procedural content generation
Classes | Typedefs | Enumerations | Functions | Variables
skr::pcg Namespace Reference

Classes

struct  Face
 strcut describing a face More...
 
class  FloorGenerator
 Generates a level consisting of rooms. More...
 
class  FloorGeneratorParameter
 holds parameters for floor generator More...
 
class  LevelBoundingBox
 defines the overall extends of a level in 2d. More...
 
class  RNG
 random number generator helper class More...
 
class  Room
 specifies position, extends and relations to neighboring rooms More...
 
class  Target
 specifies are target in a level to hit More...
 
class  TargetMovement
 specifies parameters how a target can move during gameplay More...
 
struct  Vertex
 struct describing a vertex More...
 

Typedefs

typedef std::array< float, 2 > Point2d
 2d point More...
 
typedef Point2d Vec2
 
typedef std::array< float, 3 > Point3d
 c 2d vector More...
 
typedef Point3d Vec3
 

Enumerations

enum  OpenGLTextureWrapParameter { OpenGLTextureWrapParameter::OGL_REPEAT = 0x2901, OpenGLTextureWrapParameter::OGL_MIRRORED_REPEAT = 0x8370, OpenGLTextureWrapParameter::OGL_CLAMP_TO_EDGE = 0x812F, OpenGLTextureWrapParameter::OGL_CLAMP_TO_BORDER = 0x812D }
 c 3d vector More...
 
enum  FloorLayoutStrategy { FloorLayoutStrategy::RandomPlacement, FloorLayoutStrategy::Stacking, FloorLayoutStrategy::PlaceAndShrink }
 enum for used strategy to generate room layout More...
 
enum  DoorDirection {
  DoorDirection::TOP, DoorDirection::TOP_RIGHT, DoorDirection::RIGHT, DoorDirection::BOTTOM_RIGHT,
  DoorDirection::BOTTOM, DoorDirection::BOTTOM_LEFT, DoorDirection::LEFT, DoorDirection::TOP_LEFT
}
 
enum  RoomType { RoomType::Room, RoomType::Hallway, RoomType::Start, RoomType::Finish }
 enum for types of rooms More...
 
enum  FaceType { FaceType::Wall, FaceType::Ceiling, FaceType::Floor }
 enum for types of faces More...
 

Functions

std::string GetReadbleDoorDirection (DoorDirection d)
 
DoorDirection InvertRoomDir (DoorDirection dir)
 

Variables

constexpr float PCG_DEFAULT_ROOM_HEIGHT = 5.0f
 default value for height of a room More...
 
constexpr float PCG_DEFAULT_ROOM_BASE_HEIGHT = 0.0f
 default value for base eight of the level More...
 
constexpr float PCG_DEFAULT_ROOM_STACKING_OFFSET = 3.0f
 default space between rooms; also size of hallways More...
 
constexpr float PCG_DEFAULT_TARGET_SIZE = 2.0f
 default size of targets; used to prevent overlap More...
 
constexpr float PCG_DEFAULT_TARGET_MOVEMENT_MAX_EXTEND = PCG_DEFAULT_TARGET_SIZE * 1.5f
 default extend to which a target can move at maxmium More...
 
constexpr float PCG_DEFAULT_TARGET_MOVEMENT_MAX_EXTEND_VERTICAL = (PCG_DEFAULT_ROOM_HEIGHT - PCG_DEFAULT_TARGET_SIZE) * 0.5f
 default extend to which a target can move vertically (y-axis) at maximum More...
 
constexpr float PCG_DEFAULT_TARGET_MAX_MOVEMENT_SPEED = 2.0f
 
constexpr Vec3 DefaultNormal_Bottom { 0.0f, 1.0f, 0.0f }
 
constexpr Vec3 DefaultNormal_Top { 0.0f, -1.0f, 0.0f }
 

default normal for bottom face

More...
 
constexpr Vec3 DefaultNormal_Back { 0.0f, 0.0f, -1.0f }
 

default normal for top face

More...
 
constexpr Vec3 DefaultNormal_Front { 0.0f, 0.0f, 1.0f }
 

default normal for back face

More...
 
constexpr Vec3 DefaultNormal_Right { -1.0f, 0.0f, 0.0f }
 

default normal for front face

More...
 
constexpr Vec3 DefaultNormal_Left { 1.0f, 0.0f, 0.0f }
 

default normal for right face

More...
 

Typedef Documentation

◆ Point2d

typedef std::array<float, 2> skr::pcg::Point2d

2d point

◆ Point3d

typedef std::array<float, 3> skr::pcg::Point3d

c 2d vector

3d point

◆ Vec2

◆ Vec3

Enumeration Type Documentation

◆ DoorDirection

enum DoorDirection specifying direction to which the doors elads

Enumerator
TOP 
TOP_RIGHT 
RIGHT 
BOTTOM_RIGHT 
BOTTOM 
BOTTOM_LEFT 
LEFT 
TOP_LEFT 

◆ FaceType

enum skr::pcg::FaceType
strong

enum for types of faces

Enumerator
Wall 

Wall, with or wihout door.

Ceiling 
Floor 

ceilling

floor

◆ FloorLayoutStrategy

enum for used strategy to generate room layout

Enumerator
RandomPlacement 

place rooms randomly. NOTE: unused and probably outdated. Currently does not connect rooms

Stacking 

place inital room and place other adjecent to previous

PlaceAndShrink 

place rooms randomly and shrink them close to each other. NOTE: currently not implemented

◆ OpenGLTextureWrapParameter

c 3d vector

enum for OpenGL Texture Wrap Parameters

Enumerator
OGL_REPEAT 
OGL_MIRRORED_REPEAT 
OGL_CLAMP_TO_EDGE 
OGL_CLAMP_TO_BORDER 

◆ RoomType

enum skr::pcg::RoomType
strong

enum for types of rooms

Enumerator
Room 

regular room filled with targest and light sources

Hallway 

connecting rooms, no targets or lights

Start 

place player starts in

Finish 

place to finished the game

Function Documentation

◆ GetReadbleDoorDirection()

std::string skr::pcg::GetReadbleDoorDirection ( DoorDirection  d)

prints readable string of specified door direction

Parameters
dspecified door direction
Returns
human readable string of specified DoorDirection

◆ InvertRoomDir()

DoorDirection skr::pcg::InvertRoomDir ( DoorDirection  dir)

returns opposite direction of given room direction

Parameters
dirDoorDirection to be inverted
Returns
opposite Door Direction

Variable Documentation

◆ DefaultNormal_Back

constexpr Vec3 skr::pcg::DefaultNormal_Back { 0.0f, 0.0f, -1.0f }
constexpr

default normal for top face

◆ DefaultNormal_Bottom

constexpr Vec3 skr::pcg::DefaultNormal_Bottom { 0.0f, 1.0f, 0.0f }
constexpr

◆ DefaultNormal_Front

constexpr Vec3 skr::pcg::DefaultNormal_Front { 0.0f, 0.0f, 1.0f }
constexpr

default normal for back face

◆ DefaultNormal_Left

constexpr Vec3 skr::pcg::DefaultNormal_Left { 1.0f, 0.0f, 0.0f }
constexpr

default normal for right face

◆ DefaultNormal_Right

constexpr Vec3 skr::pcg::DefaultNormal_Right { -1.0f, 0.0f, 0.0f }
constexpr

default normal for front face

◆ DefaultNormal_Top

constexpr Vec3 skr::pcg::DefaultNormal_Top { 0.0f, -1.0f, 0.0f }
constexpr

default normal for bottom face

◆ PCG_DEFAULT_ROOM_BASE_HEIGHT

constexpr float skr::pcg::PCG_DEFAULT_ROOM_BASE_HEIGHT = 0.0f
constexpr

default value for base eight of the level

◆ PCG_DEFAULT_ROOM_HEIGHT

constexpr float skr::pcg::PCG_DEFAULT_ROOM_HEIGHT = 5.0f
constexpr

default value for height of a room

◆ PCG_DEFAULT_ROOM_STACKING_OFFSET

constexpr float skr::pcg::PCG_DEFAULT_ROOM_STACKING_OFFSET = 3.0f
constexpr

default space between rooms; also size of hallways

◆ PCG_DEFAULT_TARGET_MAX_MOVEMENT_SPEED

constexpr float skr::pcg::PCG_DEFAULT_TARGET_MAX_MOVEMENT_SPEED = 2.0f
constexpr

◆ PCG_DEFAULT_TARGET_MOVEMENT_MAX_EXTEND

constexpr float skr::pcg::PCG_DEFAULT_TARGET_MOVEMENT_MAX_EXTEND = PCG_DEFAULT_TARGET_SIZE * 1.5f
constexpr

default extend to which a target can move at maxmium

◆ PCG_DEFAULT_TARGET_MOVEMENT_MAX_EXTEND_VERTICAL

constexpr float skr::pcg::PCG_DEFAULT_TARGET_MOVEMENT_MAX_EXTEND_VERTICAL = (PCG_DEFAULT_ROOM_HEIGHT - PCG_DEFAULT_TARGET_SIZE) * 0.5f
constexpr

default extend to which a target can move vertically (y-axis) at maximum

◆ PCG_DEFAULT_TARGET_SIZE

constexpr float skr::pcg::PCG_DEFAULT_TARGET_SIZE = 2.0f
constexpr

default size of targets; used to prevent overlap