Leoss

Hello,

What would be the easy way to find a collision/intersections between two bounding box located in two different gameobject ?
I tried to understand http://esotericsoftware.com/forum/viewtopic.php?f=7&t=1337&p=6424&hilit=box but I couldn't get it... Is there really no basic fonction to check if there is an intersection with a bounding box ?

I have one even crazier question: how can I make the SkeletonAnimation bounding box interact with Unity Colliders ? Is there a way I can receive events like OnTriggerEnter() with the intersections between an Unity Trigger and a Bounding Box ?

Thanks for your help
Leoss
  • Mesajlar: 17

ProudLittlePinwheel

Hi there,

I had a go at creating generic Unity box colliders for each slot/bone and updating their size and rotation at runtime to reflect the animation, which can be found at the end of this thread (http://esotericsoftware.com/forum/viewtopic.php?f=7&t=1152). I didn't manage to get round to creating Unity colliders based on Bounding boxes but will probably be getting onto that soon. Perhaps the code will be a starting point for you (though it may be a little out of date)? Also in the code I attached a rigidbody to each moving GameObject, which is incorrect. Only the parent GameObject needs to have a rigidbody attached.

Good luck,

Rob
ProudLittlePinwheel
  • Mesajlar: 45

Nate

The SkeletonBounds class is a helper class to do hit detection with bounding boxes. You don't have to use it, you could write your own similar class using the bounding box polygons. SkeletonBounds uses coordinates that are local to the GameObject. Any point you use for hit detection also needs to be in the GameObject's local coordinates. If you have two GameObjects with a SkeletonBounds for each, they use local GameObject coordinates so hit detection can't be done directly. I will consider adding a method to transform the SkeletonBounds coordinates using SRT. This will make it easier to use SkeletonBounds for GameObjects that share a parent by transforming the SkeletonBounds coordinates by the GameObejct's SRT to go from local to parent coordinates. Task:
https://trello.com/c/yVRmAQsM/50-add-tr ... etonbounds

I would like to support Unity colliders for bounding boxes but haven't had a chance to give it a try.
Kullanıcı avatarı
Nate

Nate
  • Mesajlar: 12208

ProudLittlePinwheel

I will try giving the Unity collider Bounding box support a go over the next couple of days. Will try and create a little interface for working with them too. Will post whatever I manage to come up with here soon.

Rob
ProudLittlePinwheel
  • Mesajlar: 45


Dön Runtimes