mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
add 'on_physics_update' entity event
This commit is contained in:
parent
b60f0f0ea2
commit
6d3dac9106
6 changed files with 42 additions and 3 deletions
|
|
@ -25,7 +25,10 @@
|
|||
static debug::Logger logger("entities");
|
||||
|
||||
Entities::Entities(Level& level)
|
||||
: level(level), sensorsTickClock(20, 3), updateTickClock(20, 3) {
|
||||
: level(level),
|
||||
sensorsTickClock(20, 3),
|
||||
updateTickClock(20, 3),
|
||||
physicsTickClock(60, 1) {
|
||||
}
|
||||
|
||||
std::optional<Entity> Entities::get(entityid_t id) {
|
||||
|
|
@ -320,6 +323,13 @@ void Entities::update(float delta) {
|
|||
updateTickClock.getPart()
|
||||
);
|
||||
}
|
||||
if (physicsTickClock.update(delta)) {
|
||||
scripting::on_entities_physics_update(
|
||||
physicsTickClock.getTickRate(),
|
||||
physicsTickClock.getParts(),
|
||||
physicsTickClock.getPart()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
static void debug_render_skeleton(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue