/// <summary> /// this method requires that you are using a collision layer setup in the constructor. /// </summary> public TmxLayerTile GetTileAtWorldPosition(Vector2 worldPos) { Insist.IsNotNull(CollisionLayer, "collisionLayer must not be null!"); // offset the passed in world position to compensate for the entity position worldPos -= Entity.Transform.Position + _localOffset; return(CollisionLayer.GetTileAtWorldPosition(worldPos)); }
/// <summary> /// this method requires that you are using a collision layer setup in the constructor. /// </summary> public TmxLayerTile GetTileAtWorldPosition(Vector2 worldPos) { Insist.IsNotNull(CollisionLayer, "collisionLayer must not be null!"); return(CollisionLayer.GetTileAtWorldPosition(worldPos - _localOffset)); }