package controllers import "server/models" func (h *Hub) addEntity(id uint32, entity models.Entity) { h.Mu.Lock() defer h.Mu.Unlock() h.Entities[id] = entity } func (h *Hub) updateEntityPosition(x, y, z float32, entity_id uint32) { h.Mu.Lock() defer h.Mu.Unlock() h.Entities[entity_id].SetPosition(x, y, z) } func (h *Hub) updateEntityRotation(yaw float32, entity_id uint32) { h.Mu.Lock() defer h.Mu.Unlock() h.Entities[entity_id].SetYaw(yaw) } func (h *Hub) removeEntity(id uint32) { h.Mu.Lock() defer h.Mu.Unlock() delete(h.Entities, id) }