BoundingSphere StructureDelta Engine Documentation
Contains the center position in 3D and radius. Allows quick collision and intersection tests. View code on GitHub

Namespace: DeltaEngine.Datatypes
Assembly: DeltaEngine (in DeltaEngine.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public struct BoundingSphere

The BoundingSphere type exposes the following members.

Constructors

  NameDescription
Public methodBoundingSphere
Initializes a new instance of the BoundingSphere class
Top
Methods

  NameDescription
Public methodIsColliding
Top
Properties

  NameDescription
Public propertyCenter
Public propertyRadius
Top
Remarks

Tests: DeltaEngine.Tests.Datatypes.BoundingSphereTests
Examples

2 unit tests call DeltaEngine.Datatypes.BoundingSphere
[Test]
public void CreateBoundingSphere()
{
    var boundingSphere = new BoundingSphere(Vector3D.One, 2.0f);
    Assert.AreEqual(Vector3D.One, boundingSphere.Center);
    Assert.AreEqual(2.0f, boundingSphere.Radius);
}
[Test]
public void IntersectBoundingSphereWithBoundingSphere()
{
    var sphere1 = new BoundingSphere(Vector3D.Zero, 1.0f);
    var sphere2 = new BoundingSphere(Vector3D.One, 1.0f);
    Assert.IsTrue(sphere1.IsColliding(sphere2));
}
See Also