I have objects that require a collider and it can be of any type. In unity the collider's bounds object is an AABB in world space. Is it possible to obtain a AABB local bounding box with zero rotation, that can then be transformed into world space?
If not I have an idea of defining the bounding box using the collider parameters, and then apply the obj transform to put it into world space. But, how can I know which type of collider an object has, from this options: BoxCollider, SphereCollider, CapsuleCollider, MeshCollider?
You can use GetType to find out what type of collider you have attached.
There is another similar thread which you might want to take a look at: http://answers.unity3d.com/questions/1183/local-bounds-or-not-aabb-bounds
answered Dec 08 '09 at 08:04 PM