Pogosim
Loading...
Searching...
No Matches
objects.h File Reference
#include <functional>
#include "utils.h"
#include "configuration.h"
#include "render.h"
#include "colormaps.h"
#include "objects_geometry.h"

Go to the source code of this file.

Classes

class  Object
 Base class of any object contained within the simulation. More...
class  PhysicalObject
 A physical object, i.e. with physics properties (e.g. collisions) modelled by Box2D. More...
class  PassiveObject
 Physical object without user code (i.e. passive). Can still interact with other objects (e.g. collisions, etc). More...

Functions

Objectobject_factory (Simulation *simulation, uint16_t id, float x, float y, b2WorldId world_id, Configuration const &config, LightLevelMap *light_map, size_t userdatasize=0, std::string const &category="objects")
 Factory of simulation Objects. Return a constructed object from configuration.
void get_cmap_val (std::string const name, uint8_t const value, uint8_t *r, uint8_t *g, uint8_t *b)
 Interface to colormaps.

Function Documentation

◆ get_cmap_val()

void get_cmap_val ( std::string const name,
uint8_t const value,
uint8_t * r,
uint8_t * g,
uint8_t * b )

Interface to colormaps.

Parameters
nameName of the colormap.
valueValue to determine the color in this colormap
rRed color component
gGreen color component
bBlue color component

◆ object_factory()

Object * object_factory ( Simulation * simulation,
uint16_t id,
float x,
float y,
b2WorldId world_id,
Configuration const & config,
LightLevelMap * light_map,
size_t userdatasize = 0,
std::string const & category = "objects" )

Factory of simulation Objects. Return a constructed object from configuration.

Parameters
simulationPointer to the underlying simulation.
world_idThe Box2D world identifier (unused in rendering).
configConfiguration entry describing the object properties.
light_mapPointer to the global light level map.
userdatasizeSize of the memory block allocated for user data.
categoryName of the category of the object.