Pogosim
Loading...
Searching...
No Matches
objects.cpp File Reference
#include "utils.h"
#include "objects.h"
#include "robot.h"
#include "distances.h"
#include "simulator.h"
#include "objects_geometry.h"
#include "lights.h"
#include <cmath>
#include "SDL2_gfxPrimitives.h"

Functions

Objectobject_factory (Simulation *simulation, uint16_t id, float x, float y, b2WorldId world_id, Configuration const &config, LightLevelMap *light_map, size_t userdatasize, std::string const &category)
 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.