Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using RicoTanks_Common;
- using System;
- namespace RicoTanks_Server
- {
- public class BoundingBox
- {
- public Vector2Net min { get; set; }
- public Vector2Net max { get; set; }
- public BoundingBox Create(params Vector2Net[] points)
- {
- Vector2Net _min = points[0];
- Vector2Net _max = points[1];
- for (int i = 1; i < points.Length; i++)
- {
- _min = Vector2Net.Min(_min, points[i]);
- _max = Vector2Net.Max(_max, points[i]);
- }
- return new BoundingBox { min = _min, max = _max };
- }
- public bool IsContains(Vector2Net point)
- {
- return (point.x < min.x || point.x > max.x || point.y < min.y || point.y > max.y) == false;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement