Introduce animation trees, remove "standard animations" from core

This commit is contained in:
mid
2025-08-10 15:42:45 +03:00
parent 96da001734
commit dbced43b2b
8 changed files with 505 additions and 168 deletions

View File

@@ -685,7 +685,7 @@ void game_update() {
size_t boneCount = Game.entities.render[ci].cache ? k3MdlGetBoneCount(Game.entities.render[ci].cache) : 0;
if(boneCount) {
struct CBoned *cb = game_getcomponent(Game.entities.render[ci].entity, boned);
/*struct CBoned *cb = game_getcomponent(Game.entities.render[ci].entity, boned);
if(!cb) {
cb = game_ensurecomponent(Game.entities.render[ci].entity, boned);
@@ -741,7 +741,7 @@ void game_update() {
glm_decompose(cb->anim.cache.inter[m], cb->bones[m].translation, rot, scaleignore);
glm_mat4_quat(cb->anim.cache.inter[m], cb->bones[m].rotation);
}
}
}*/
}
dGeomID gid = cp->geom;
@@ -776,7 +776,7 @@ void game_update() {
for(size_t cm = 0; cm < Game.entities.movementCount; cm++) {
struct CBoned *cb = game_getcomponent(Game.entities.movement[cm].entity, boned);
if(cb && cb->anim.standard) {
/*if(cb && cb->anim.standard) {
struct CPhysics *cp = game_getcomponent(Game.entities.movement[cm].entity, physics);
if(cp && cp->geom) {
dBodyID bid = dGeomGetBody(cp->geom);
@@ -789,7 +789,7 @@ void game_update() {
}
}
}
}
}*/
}
for(size_t i = 0; i < Game.conveyorCount; i++) {
@@ -876,7 +876,6 @@ void game_update() {
vec3 dif;
glm_vec3_sub(conveyor->points[nextPoint], conveyor->points[currentPoint], dif);
glm_vec3_scale_as(dif, conveyor->speed * (conveyor->active <= 0 ? -1 : 1), dif);
//printf("set %f %f %f\n", dif[0], dif[1], dif[2]);
dBodySetLinearVel(bid, dif[0], dif[1], dif[2]); // doesn't affect movement, but necessary for proper collision response
}
}
@@ -950,7 +949,7 @@ void game_cleanup() {
Game.entities.renderCount = 0;
for(size_t i = 0; i < Game.entities.bonedCount; i++) {
free(Game.entities.boned[i].bones);
//free(Game.entities.boned[i].bones);
}
Game.entities.bonedCount = 0;