51# define __JO_LIGHT_H__
53#ifdef JO_COMPILE_WITH_3D_SUPPORT
56# define JO_MAX_POINT_LIGHTS (8)
58# define JO_MAX_POINT_LIGHT_MESHES (64)
61# define JO_POINT_LIGHT_STRENGTH_DEFAULT (256)
73 const unsigned char b,
const int radius,
const int strength);
Mesh structure.
Definition 3d.h:216
bool jo_3d_point_lights_add_mesh(jo_3d_mesh *const mesh)
Add a mesh lit by the point lights: its points in world coordinates (a mesh drawn without a matrix of...
void jo_3d_point_lights_clear(void)
Remove the lights and the meshes (the gouraud tables get their colors back): before the meshes are fr...
void jo_3d_point_light_set_shadows(const int id, const bool shadows)
Shadows of a light (on by default when jo_3d_point_lights_set_occlusion() is set): off for a light th...
int jo_3d_point_light_add(const jo_pos3D_fixed *const position, const unsigned char r, const unsigned char g, const unsigned char b, const int radius, const int strength)
Add a point light.
void jo_3d_point_lights_sample(const jo_pos3D_fixed *const position, int *const r, int *const g, int *const b)
The light of the lights at a point (for an object that moves: a character, a weapon,...
void jo_3d_point_lights_update(void)
Write the gouraud tables changed by the lights (computes the light of the lights added or moved first...
void jo_3d_point_light_set_color(const int id, const unsigned char r, const unsigned char g, const unsigned char b)
Color of a light (cheap).
void jo_3d_point_lights_set_occlusion(bool(*hit)(const jo_pos3D_fixed *const origin, const jo_pos3D_fixed *const dir, const jo_fixed max_t))
Shadows: a function that tells if a ray hits a wall (for instance the walls of the cells,...
void jo_3d_point_lights_set_mesh_seen(const jo_3d_mesh *const mesh, const bool seen)
A mesh is seen or not in this frame (for instance the cells drawn, see jo_cells_prepare()): the light...
void jo_3d_point_light_set_sampled(const int id, const bool sampled)
Light of a light seen by jo_3d_point_lights_sample() (the objects, the weapon of the player): on by d...
void jo_3d_point_light_enable(const int id, const bool enabled)
Switch a light on or off (cheap).
void jo_3d_point_light_set_spot(const int id, const jo_pos3D_fixed *const direction, const int angle)
A spot light (a torch, a lamp with a shade): the light goes in a cone; or all around (a bulb,...
void jo_3d_point_light_set_intensity(const int id, const int intensity)
Intensity of a light (a flicker, a pulse: cheap).
void jo_3d_point_light_set_position(const int id, const jo_pos3D_fixed *const position)
Move a light (its light is computed again on all the meshes: costly).
void jo_3d_point_lights_enable(const bool enabled)
The point lights on or off (off: the meshes get their colors back).
int jo_fixed
Fixed point Q16.16 number.
Definition types.h:48
3D position using fixed numbers
Definition types.h:92