Is it possible to improve the BoundingSOMETHING design?

I've noticed that BoundingSphere, BoundingBox and BoundingFrustum expose similar Intersects and Contains method for all the other BoundingXXXX objects. could you please make these class inherit from the same IVolume (or something else) interface that exposes Intersects and Contains for all the "BoundingXXX" objects this will be VERY usefull when the BoundingSOMETHING are used to filter out portion of space, for exampel in an iteratior that navigates throug a OcTree finding outs all the intersecting objects that collides with a given volume.
In that case I'll be able to use indifferently Box, Sphere or Frustum to cull out my objects, with the same iteratior.

I had something similar with my engine design in MDX 1.1

I had:

public interface ICollidable<collidableType>
{
/// <summary>
/// return true if this object's volume intersects the other ones
/// </summary>
/// <param name="other">another object</param>
/// <returns>true if an intersection occurs, false otherwise</returns>
bool Intersect(collidableType other);
/// <summary>
/// return true if this object's volume completely contains the other ones
/// </summary>
/// <param name="other">another object</param>
/// <returns>true if this object completely surrounds the other one, false otherwise</returns>
bool Contains(collidableType other);
}

and then:

public interface IVolume:ICollidable<BoundingSphere>,ICollidable<BoundingBox>,ICollidable<BoundingFrustum>
{
}


then the BoundingSOMETHING objects implements the IVolume interface.

example:

public class BoundingBox:IVolume
{
[...CUT...]
}

which implements the ICollidable for all the possible collidable objects...

Is it possible to adopt a design like this, or similar, in XNA too I think it will make all the framework more extensible and easy to use

hope to have posted inthe right place.
Congrats for your great work with XNA!
Thank you for the attention.


Answer this question

Is it possible to improve the BoundingSOMETHING design?

  • Aftab Khaliq

    Thanks guys!
    I'm sorry for the post, I suppose there are a better place for the suggestions, now i've created one here.

    Thanks again for your help and your great work!

  • Dottj

    Thanks for the feedback. We'll look into expanding the functionality of our bounding volume and intersection routines for the next version.

  • mprogrammer

    Please read the post about submitting suggestions here.

  • Is it possible to improve the BoundingSOMETHING design?