Added GetSpriteWorldCenter() function

This commit is contained in:
n00b87
2025-11-21 22:10:44 -06:00
parent 4df735e4f6
commit f53f486c54
13 changed files with 1343 additions and 1302 deletions

View File

@@ -12,6 +12,18 @@ void rc_getSpriteCenter(int spr_id, double* x, double* y)
*y = (double)rc_sprite[spr_id].physics.body->GetLocalCenter().y;
}
void rc_getSpriteWorldCenter(int spr_id, double* x, double* y)
{
if(spr_id < 0 || spr_id >= rc_sprite.size())
return;
if(!rc_sprite[spr_id].active)
return;
*x = (double)rc_sprite[spr_id].physics.body->GetWorldCenter().x;
*y = (double)rc_sprite[spr_id].physics.body->GetWorldCenter().y;
}
void rc_setSpriteLinearVelocity(int spr_id, double x, double y)
{
if(spr_id < 0 || spr_id >= rc_sprite.size())