From 14edf14d3912e580ddca66ac62df52f1001b4523 Mon Sep 17 00:00:00 2001 From: gered Date: Sun, 25 Aug 2013 16:32:58 -0400 Subject: [PATCH] add bounding volume constructor overloads to copy from other instances --- Blarg.GameFramework/Math/BoundingBox.cs | 10 ++++++++-- Blarg.GameFramework/Math/BoundingSphere.cs | 8 +++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/Blarg.GameFramework/Math/BoundingBox.cs b/Blarg.GameFramework/Math/BoundingBox.cs index 7a1afab..120ab9a 100644 --- a/Blarg.GameFramework/Math/BoundingBox.cs +++ b/Blarg.GameFramework/Math/BoundingBox.cs @@ -24,8 +24,14 @@ namespace Blarg.GameFramework get { return Math.Abs(Max.Z - Min.Z); } } + public BoundingBox(BoundingBox other) + { + Min = other.Min; + Max = other.Max; + } + public BoundingBox(Vector3 min, Vector3 max) - : this(ref min, ref max) + : this(ref min, ref max) { } @@ -46,7 +52,7 @@ namespace Blarg.GameFramework } public BoundingBox(Vector3 center, float halfWidth) - : this(ref center, halfWidth) + : this(ref center, halfWidth) { } diff --git a/Blarg.GameFramework/Math/BoundingSphere.cs b/Blarg.GameFramework/Math/BoundingSphere.cs index f495845..8b5b23b 100644 --- a/Blarg.GameFramework/Math/BoundingSphere.cs +++ b/Blarg.GameFramework/Math/BoundingSphere.cs @@ -9,8 +9,14 @@ namespace Blarg.GameFramework public Vector3 Center; public float Radius; + public BoundingSphere(BoundingSphere other) + { + Center = other.Center; + Radius = other.Radius; + } + public BoundingSphere(Vector3 center, float radius) - : this(ref center, radius) + : this(ref center, radius) { }