Add hitbox size/render size notion
This commit is contained in:
@@ -81,7 +81,8 @@ typedef struct Entity
|
||||
{
|
||||
v2 pos; // Position
|
||||
v2 dPos; // Velocity
|
||||
v2 size;
|
||||
v2 hitboxSize;
|
||||
v2 renderSize;
|
||||
|
||||
enum EntityState state;
|
||||
enum EntityType type;
|
||||
@@ -100,7 +101,7 @@ typedef struct Entity
|
||||
|
||||
INTERNAL inline v4 getEntityScreenRect(Entity entity)
|
||||
{
|
||||
v4 result = math_getRect(entity.pos, entity.size);
|
||||
v4 result = math_getRect(entity.pos, entity.hitboxSize);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -51,6 +51,6 @@ inline void renderer_staticString(Renderer *const renderer, Font *const font,
|
||||
}
|
||||
|
||||
void renderer_entity(Renderer *renderer, v4 cameraBounds, Entity *entity,
|
||||
v2 entityRenderSize, f32 rotate, v4 color);
|
||||
f32 rotate, v4 color);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user