x


Collider local bounding box

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?

more ▼

asked Dec 08 '09 at 06:45 PM

Ricardo Arango gravatar image

Ricardo Arango
658 10 13 27

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

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

more ▼

answered Dec 08 '09 at 08:04 PM

TowerOfBricks gravatar image

TowerOfBricks
3.2k 17 25 50

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x2499

asked: Dec 08 '09 at 06:45 PM

Seen: 2670 times

Last Updated: Dec 08 '09 at 07:43 PM