Survivalcraft API 1.8.2.3 v1.8.2.3
Survivalcraft 2.4
载入中...
搜索中...
未找到
BoundingSphere.cs
浏览该文件的文档.
1namespace Engine {
2 public struct BoundingSphere : IEquatable<BoundingSphere> {
3 public Vector3 Center;
4
5 public float Radius;
6
7 public BoundingSphere(Vector3 center, float radius) {
8 Center = center;
9 Radius = radius;
10 }
11
12 public override bool Equals(object obj) => obj is BoundingSphere sphere && Equals(sphere);
13
14 public override int GetHashCode() => Center.GetHashCode() + Radius.GetHashCode();
15
16 public bool Equals(BoundingSphere other) => Center == other.Center && Radius == other.Radius;
17
18 public override string ToString() => $"{Center},{Radius}";
19
20 public static bool operator ==(BoundingSphere s1, BoundingSphere s2) => s1.Equals(s2);
21
22 public static bool operator !=(BoundingSphere s1, BoundingSphere s2) => !s1.Equals(s2);
23 }
24}
bool Equals(BoundingSphere other)
override bool Equals(object obj)
static bool operator==(BoundingSphere s1, BoundingSphere s2)
static bool operator!=(BoundingSphere s1, BoundingSphere s2)
BoundingSphere(Vector3 center, float radius)