aboutsummaryrefslogtreecommitdiffstats
path: root/src/entity.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/entity.c')
-rw-r--r--src/entity.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/entity.c b/src/entity.c
index 2242878..90ee641 100644
--- a/src/entity.c
+++ b/src/entity.c
@@ -115,6 +115,12 @@ bool entityCanBeSelected(EntityId id)
return entityEntries[id].canBeSelected;
}
+float getEntityDistance(Entity entity, Vector3 position)
+{
+ return Vector3Distance(entity.position, position)
+ - (Vector3Distance(entity.box.min, entity.box.max) / 2.0);
+}
+
InteractionCommand interactWithEntity(Entity* entity, Game* game,
Selection selection)
{