beastie - Header only collision detection library for Ogre

A place to show off your latest screenshots and for people to comment on them. Only start a new thread here if you have some nice images to show off!
User avatar
betajaen
OGRE Moderator
OGRE Moderator
Posts: 3447
Joined: Mon Jul 18, 2005 4:15 pm
Location: Wales, UK
Contact:

Re: beastie - Header only collision detection library for Og

Post by betajaen » Fri Jul 16, 2010 9:50 am

kneeride wrote:betajaen you rock!! This is very cool.

I've been reluctant to integrate a physics engine because it would have been overkill for what I need. I also thought the memory would be overkill because there needs to be 2 scene managers (1 for phsyics and 1 for ogre).

I've been using MOC for ray to mesh but I'm really hanging out for this one:

>> Box v.s. Box and Plane intersection.

Can you please also consider: Box vs Sphere :-)

Don't worry, I'll be adding spheres/ellipsoids from this code article.

I'm just working on changing the "node" system a bit. I want it to be more like Ogre's where you can attach multiple objects, and of different types. My system just assumes you want a mesh and does it automatically. I'll probably get to boxes and spheres then.

I'm also aiming for speed. Every microsecond counts.
0 x

User avatar
Zonder
Ogre Magi
Posts: 1132
Joined: Mon Aug 04, 2008 7:51 pm
Location: Manchester - England
x 22

Re: beastie - Header only collision detection library for Og

Post by Zonder » Fri Jul 16, 2010 3:47 pm

betajaen wrote:
kneeride wrote:betajaen you rock!! This is very cool.

I've been reluctant to integrate a physics engine because it would have been overkill for what I need. I also thought the memory would be overkill because there needs to be 2 scene managers (1 for phsyics and 1 for ogre).

I've been using MOC for ray to mesh but I'm really hanging out for this one:

>> Box v.s. Box and Plane intersection.

Can you please also consider: Box vs Sphere :-)

Don't worry, I'll be adding spheres/ellipsoids from this code article.

I'm just working on changing the "node" system a bit. I want it to be more like Ogre's where you can attach multiple objects, and of different types. My system just assumes you want a mesh and does it automatically. I'll probably get to boxes and spheres then.

I'm also aiming for speed. Every microsecond counts.
Yes I remember reading that article god knows how many years ago I was developing with Geforce 2 and 3 was just out?? I never implemented it in my collision engine at the time it was the last thing on my list but I split from the team I was working with :)
0 x
There are 10 types of people in the world: Those who understand binary, and those who don't...

User avatar
Kojack
OGRE Moderator
OGRE Moderator
Posts: 7147
Joined: Sun Jan 25, 2004 7:35 am
Location: Brisbane, Australia
x 16

Re: beastie - Header only collision detection library for Og

Post by Kojack » Sat Jul 17, 2010 5:22 am

doing a box -> sphere check is only a matter of checking to see if a points distance from the center of the sphere is below it's radius
No, it takes more than that.
It's possible for the sphere to intersect the sides of the box without ever going near a box corner.

Looks cool, maybe I won't have to modify Moc now to be more efficient (it transforms every triangle into world space, instead of transforming the ray into local space like beastie does).
0 x

User avatar
Herb
Orc
Posts: 412
Joined: Thu Jun 04, 2009 3:21 am
Location: Kalamazoo,MI
x 1

Re: beastie - Header only collision detection library for Og

Post by Herb » Sat Jul 17, 2010 3:19 pm

I take it, this is more efficient (faster) and easy to use than the "minimal ogre collision library"?

http://www.ogre3d.org/tikiwiki/Minimal+ ... =Libraries
0 x

User avatar
betajaen
OGRE Moderator
OGRE Moderator
Posts: 3447
Joined: Mon Jul 18, 2005 4:15 pm
Location: Wales, UK
Contact:

Re: beastie - Header only collision detection library for Og

Post by betajaen » Sat Jul 17, 2010 3:24 pm

It's faster (about 1.5x-2x) due to it transforming the ray to localspace and caching the triangles of the loaded meshes.
0 x

reptor
Ogre Magi
Posts: 1120
Joined: Wed Nov 15, 2006 7:41 pm
Location: Finland

Re: beastie - Header only collision detection library for Og

Post by reptor » Sat Jul 17, 2010 9:12 pm

Thumbs up for this new project. I hope it a good life!
0 x

User avatar
SunSailor
Gnoll
Posts: 699
Joined: Sun Jan 02, 2005 5:45 pm
Location: Velbert, Germany
Contact:

Re: beastie - Header only collision detection library for Og

Post by SunSailor » Sat Nov 13, 2010 11:39 pm

Any news or updates on this project, or is it elapsed? If so, any recommendation for an alternative? Or is it work stable and simply didn't need any further update?
0 x
Online-Distribution with Jade-DS, Ogre-Wrapper included.
Follow me on Twitter for updates!

User avatar
betajaen
OGRE Moderator
OGRE Moderator
Posts: 3447
Joined: Mon Jul 18, 2005 4:15 pm
Location: Wales, UK
Contact:

Re: beastie - Header only collision detection library for Og

Post by betajaen » Sat Nov 13, 2010 11:43 pm

It's fine as it is. I was going to do box/plane/sphere collisions but I'm probably not now, but just for raycasting it's pretty fast and stable.
0 x

Tinnus
Halfling
Posts: 45
Joined: Fri Nov 02, 2007 3:23 am

Re: beastie - Header only collision detection library for Og

Post by Tinnus » Thu Nov 18, 2010 12:08 am

Kojack wrote:
doing a box -> sphere check is only a matter of checking to see if a points distance from the center of the sphere is below it's radius
No, it takes more than that.
It's possible for the sphere to intersect the sides of the box without ever going near a box corner.

Looks cool, maybe I won't have to modify Moc now to be more efficient (it transforms every triangle into world space, instead of transforming the ray into local space like beastie does).
I'm pretty sure taking all faces from the box and doing face<->center_of_sphere distance is enough: if a point of the box is inside the sphere, then a point of a face must be; then if a point of a face is inside the sphere, then the face's point closest to the center of the sphere must be as well.

Doing face<->point distance is a matter of projecting the point to the plane of the face; then if it's inside it, do center<->plane distance (easy), and if it's outside, you can do point<->edge with the edges of the face.

Of course that's probably not the fastest way to do it though.
0 x

Zwart
Gnoblar
Posts: 4
Joined: Mon Oct 04, 2010 4:26 pm

Re: beastie - Header only collision detection library for Og

Post by Zwart » Tue Dec 14, 2010 3:18 pm

Hi,
I have a question about beasty. I'm looking to it because I need to detect a simple collision between meshs and I though I would be able to use it in my scene but at first sight I haven't find any function to move my node in my tree so my question is, do I need to have all my objects static to compute any raytracing with beasty or do I miss in the code ??

Thanks
0 x

jonim8or
Goblin
Posts: 287
Joined: Mon Dec 08, 2008 4:49 pm

Re: beastie - Header only collision detection library for Og

Post by jonim8or » Fri Dec 17, 2010 11:33 am

Does beastie also work with manualobjects?
0 x

mikekknd
Gnoblar
Posts: 8
Joined: Fri Aug 06, 2010 1:20 am
Contact:

Re: beastie - Header only collision detection library for Og

Post by mikekknd » Sun Dec 26, 2010 10:29 pm

Very nice work but is there any mesh scaling function? It seems like the mesh is not scaled properly and the collision is detecting the unscaled mesh...
0 x

User avatar
Beauty
OGRE Community Helper
OGRE Community Helper
Posts: 767
Joined: Wed Oct 10, 2007 2:36 pm
Location: Germany
Contact:

Re: beastie - Header only collision detection library for Og

Post by Beauty » Thu Feb 03, 2011 6:22 pm

Nice project :D

Maybe some parts of your library are interesting for the sensor simulation of my underwater application. So I can learn from it.
0 x
Help to add information to the wiki. Also tiny edits will let it grow ... :idea:
Add your country to your profile ... it's interesting to know from where of the world you are.

User avatar
voyvf
Kobold
Posts: 28
Joined: Sat Jul 04, 2009 4:01 am
Location: United States
Contact:

Re: beastie - Header only collision detection library for Og

Post by voyvf » Thu Feb 03, 2011 9:36 pm

Doh! Neither g++ 4.4.5 nor clang version 2.9 (trunk 124442) appear to grok the template declarations. ):

I attempted to attach the error but the forum doesn't appear to allow .txt or .out file extensions - here is the gist: https://gist.github.com/810137
0 x

User avatar
betajaen
OGRE Moderator
OGRE Moderator
Posts: 3447
Joined: Mon Jul 18, 2005 4:15 pm
Location: Wales, UK
Contact:

Re: beastie - Header only collision detection library for Og

Post by betajaen » Thu Feb 03, 2011 9:49 pm

It's because I've literally twisted and turned C++ in a way, it may as well be BASIC. Visual Studio is a bit of a pushover, where as G++ is more hardened against my "style" of programming.

I don't have quick and easy idea of fixing it for you though. The long alternative would be to create a cpp file and declare all the functions in that and remove all the templates; just like proper C++ code. ;)
0 x

User avatar
voyvf
Kobold
Posts: 28
Joined: Sat Jul 04, 2009 4:01 am
Location: United States
Contact:

Re: beastie - Header only collision detection library for Og

Post by voyvf » Thu Feb 03, 2011 10:23 pm

betajaen wrote:It's because I've literally twisted and turned C++ in a way, it may as well be BASIC. Visual Studio is a bit of a pushover, where as G++ is more hardened against my "style" of programming.

I don't have quick and easy idea of fixing it for you though. The long alternative would be to create a cpp file and declare all the functions in that and remove all the templates; just like proper C++ code. ;)
Darn, I was hoping to write some Python bindings for this. Do you know if I'll run into the same issue with Gorilla? I've got time to kill and need a break from my normal project. :D
0 x

User avatar
betajaen
OGRE Moderator
OGRE Moderator
Posts: 3447
Joined: Mon Jul 18, 2005 4:15 pm
Location: Wales, UK
Contact:

Re: beastie - Header only collision detection library for Og

Post by betajaen » Thu Feb 03, 2011 11:48 pm

No, Gorilla doesn't use templates at all. As far as I'm aware, Gorilla is multiplatform.

I only used templates like that, so I could reference functions to classes that haven't been declared yet. Like I said; creating a cpp file, with all of the functions defined in it, would be the most appropriate way to go, but at the time I just wanted a single header file.
0 x

User avatar
voyvf
Kobold
Posts: 28
Joined: Sat Jul 04, 2009 4:01 am
Location: United States
Contact:

Re: beastie - Header only collision detection library for Og

Post by voyvf » Fri Feb 04, 2011 12:13 am

betajaen wrote:No, Gorilla doesn't use templates at all. As far as I'm aware, Gorilla is multiplatform.

I only used templates like that, so I could reference functions to classes that haven't been declared yet. Like I said; creating a cpp file, with all of the functions defined in it, would be the most appropriate way to go, but at the time I just wanted a single header file.

Awesome! I'll hit Gorilla first and then move back to beastie, as I need a GUI* just as much as I need collision. :D

Thanks!

EDIT: * Specifically a drop down hud/console.
0 x

mikekknd
Gnoblar
Posts: 8
Joined: Fri Aug 06, 2010 1:20 am
Contact:

Re: beastie - Header only collision detection library for Og

Post by mikekknd » Tue Jun 14, 2011 10:53 am

I just found something interesting recently. The collision detection become unstable when the mesh uses multiple materials. Do anyone encounter the same problem or is it just me?
0 x

User avatar
suny2000
Halfling
Posts: 51
Joined: Sun Sep 06, 2009 12:36 pm
x 2
Contact:

Re: beastie - Header only collision detection library for Og

Post by suny2000 » Sat Sep 01, 2012 11:25 am

Hi !
I'm using Beastie in a little project, and I'm wondering if this library is still under developement.
More specifically, the integration of Paul Nettle work (ellipsoid character controller), which is the only really missing feature in my opinion.
Thanks again for this work,
S.
0 x
http://bulostudio.com: website and devlog of a small indie studio working on SHMUP CREATOR
https://twitter.com/bulostudio : follow me on twitter!

User avatar
betajaen
OGRE Moderator
OGRE Moderator
Posts: 3447
Joined: Mon Jul 18, 2005 4:15 pm
Location: Wales, UK
Contact:

Re: beastie - Header only collision detection library for Og

Post by betajaen » Sat Sep 01, 2012 12:05 pm

I'm afraid not. I never got around to doing it, and I'm working on different projects now.

Perhaps you could use a physics engine instead - bullet for example?
0 x

User avatar
Zonder
Ogre Magi
Posts: 1132
Joined: Mon Aug 04, 2008 7:51 pm
Location: Manchester - England
x 22

Re: beastie - Header only collision detection library for Og

Post by Zonder » Sun Sep 02, 2012 1:39 am

Tinnus wrote:
Kojack wrote:
doing a box -> sphere check is only a matter of checking to see if a points distance from the center of the sphere is below it's radius
No, it takes more than that.
It's possible for the sphere to intersect the sides of the box without ever going near a box corner.

Looks cool, maybe I won't have to modify Moc now to be more efficient (it transforms every triangle into world space, instead of transforming the ray into local space like beastie does).
I'm pretty sure taking all faces from the box and doing face<->center_of_sphere distance is enough: if a point of the box is inside the sphere, then a point of a face must be; then if a point of a face is inside the sphere, then the face's point closest to the center of the sphere must be as well.

Doing face<->point distance is a matter of projecting the point to the plane of the face; then if it's inside it, do center<->plane distance (easy), and if it's outside, you can do point<->edge with the edges of the face.

Of course that's probably not the fastest way to do it though.
i never answered this I realised. You can just use the center of the box and the distance to it's side and the radius of the sphere for the intersect.
0 x
There are 10 types of people in the world: Those who understand binary, and those who don't...

User avatar
suny2000
Halfling
Posts: 51
Joined: Sun Sep 06, 2009 12:36 pm
x 2
Contact:

Re: beastie - Header only collision detection library for Og

Post by suny2000 » Thu Mar 07, 2013 2:57 pm

I just found something interesting recently. The collision detection become unstable when the mesh uses multiple materials. Do anyone encounter the same problem or is it just me?
I'm experiencing the same problem. I'm thinking that beastie can't properly test collisions on more than 2 sub-meshes...

If someone knows how to modify this behavior, don't hesitate to post the solution !
S.
0 x
http://bulostudio.com: website and devlog of a small indie studio working on SHMUP CREATOR
https://twitter.com/bulostudio : follow me on twitter!

Post Reply