Jo Engine 2026.11.6
Jo Sega Saturn Engine
Loading...
Searching...
No Matches
jo_entity_class Struct Reference

Class of entities: its callbacks (JO_NULL: nothing to do). More...

#include <entity.h>

Data Fields

const char * name
unsigned int data_size
void(*) spawn (jo_entity *const entity)
 The entity is created (its properties can be read).
void(*) update (jo_entity *const entity, const int elapsed)
 Each frame of the game, while the entity is awake (near the player or entity->timer > 0).
bool(*) action (jo_entity *const entity, const int action, const int param, jo_entity *const source)
 An action is received.
void(*) death (jo_entity *const entity, jo_entity *const source)
 The health reached 0 (before the event DEATH).
void(*) draw (jo_entity *const entity)
 Draw the entity (the camera matrix is the current matrix), JO_NULL: its model at its position.
void(*) draw_slave (jo_entity *const entity)
 Draw the entity on the slave CPU (see jo_entities_draw_slave(): the slave 3D calls, jo_actor_draw_slave()), JO_NULL: the master CPU draws it (its draw callback). An entity without draw callback is drawn by both CPUs.
void(*) tint (jo_entity *const entity, int *const r, int *const g, int *const b)
 The tint of the entity (the light of the lamps on it, see jo_3d_point_lights_sample()) before it is drawn: the class changes it (a character hit: red), JO_NULL: the light of the lamps.

Detailed Description

Class of entities: its callbacks (JO_NULL: nothing to do).

Field Documentation

◆ action

bool(*) jo_entity_class::action(jo_entity *const entity, const int action, const int param, jo_entity *const source)

An action is received.

Returns
true if the class did it, false: the engine does what it does by default (see jo_entity_send())

◆ data_size

unsigned int jo_entity_class::data_size

◆ death

void(*) jo_entity_class::death(jo_entity *const entity, jo_entity *const source)

The health reached 0 (before the event DEATH).

◆ draw

void(*) jo_entity_class::draw(jo_entity *const entity)

Draw the entity (the camera matrix is the current matrix), JO_NULL: its model at its position.

◆ draw_slave

void(*) jo_entity_class::draw_slave(jo_entity *const entity)

Draw the entity on the slave CPU (see jo_entities_draw_slave(): the slave 3D calls, jo_actor_draw_slave()), JO_NULL: the master CPU draws it (its draw callback). An entity without draw callback is drawn by both CPUs.

◆ name

const char* jo_entity_class::name

◆ spawn

void(*) jo_entity_class::spawn(jo_entity *const entity)

The entity is created (its properties can be read).

◆ tint

void(*) jo_entity_class::tint(jo_entity *const entity, int *const r, int *const g, int *const b)

The tint of the entity (the light of the lamps on it, see jo_3d_point_lights_sample()) before it is drawn: the class changes it (a character hit: red), JO_NULL: the light of the lamps.

◆ update

void(*) jo_entity_class::update(jo_entity *const entity, const int elapsed)

Each frame of the game, while the entity is awake (near the player or entity->timer > 0).

Parameters
elapsedTime since the last update (milliseconds)

The documentation for this struct was generated from the following file: