Collision Type?

Jan 16, 2008 at 7:43 AM
It would be nice if we could set a collision type feature for every model. Why? Lets say that we have a very detailed model and we want that model to have collision, but if we calculate the collission for that model, this could slow the engine. Instead we could have a CollisionType property that could be choosed from "CollisionType" enum like this:

public enum CollisionType 
{
        UseRenderObject = 0, // This will use the original model to calculate collisions
        BoundingBox= 1, // This will use its boundingBox
        LowPolyModel= 2, // This will use another model and if the user choose this option, he would have to add this model also.
}    
Jan 16, 2008 at 8:22 AM
Why do you care on who the collision is calculated? Wouldn't you be happy just writing:

public void CheckCollision()
{
    for (int i = this.Scene.Entities.Count; i>=0; i--)
    {
        Entity entity = this.Scene.Entities[i];
        if (entity != this && entity.Collide(this) == true)
        {
            this.ExplodeInAInferno();
        }
    }
} 

How the collition is calculated is totally depending on the model used. The model might use LOD to dertermine the type of collision box to use. Since the framework can't know the type of bounding sphere most optimal for the entity this information has to be handled by the entity itself.
Jan 16, 2008 at 8:25 AM
No a side note, please always consider the use of enumerations. these are not extensible and does limit the usage of a feature when used. In this case a game developer could easily implement their own CollisionType, but they couldn't use it as the enumeration does not contain this value.
Coordinator
Jan 16, 2008 at 5:49 PM
I believe Ageia, and know that some other physics engines use collision type filtering. So if you only want to check an object against certain types of objects, then you can do that. For instance, terrain might be a collision type, and maybe we only want the camera colliding with terrain, but nothing else.
Jan 16, 2008 at 8:08 PM
Yes, Ageia supports that. But, if we also want to support an all-managed physics solution, then that functionality might not be available.
Coordinator
Jan 16, 2008 at 9:57 PM
True it depends, and you'll know a bit more about physics engines and applications than I will, but I would imagine all engines have some kind of collision filtering.
Jan 16, 2008 at 11:03 PM
If they don't the developer making the bridge/adapter/facade would simply have to implement that feature into it.