BoundingBox IsColliding Method (BoundingBox)Delta Engine Documentation

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

public bool IsColliding(
	BoundingBox other
)

Return Value

Type: Boolean
Remarks

Tests: DeltaEngine.Tests.Datatypes.BoundingBoxTests
Examples

2 unit tests call DeltaEngine.Datatypes.BoundingBox.IsColliding(DeltaEngine.Datatypes.BoundingBox)
[Test]
public void IntersectBoundingBoxWithBoundingBox()
{
    var box1 = new BoundingBox(Vector3D.Zero, Vector3D.One);
    var box2 = new BoundingBox(Vector3D.One / 2, Vector3D.One);
    Assert.IsTrue(box1.IsColliding(box2));
    var box3 = new BoundingBox(Vector3D.One * 2, Vector3D.One);
    Assert.IsFalse(box1.IsColliding(box3));
}
[Test]
public void IntersectBoundingBoxWithBoundingSphere()
{
    var boundingBox = new BoundingBox(Vector3D.Zero, Vector3D.One);
    var sphere = new BoundingSphere(Vector3D.Zero, 0.5f);
    Assert.IsTrue(boundingBox.IsColliding(sphere));
}
See Also