MOC - Minimal Ogre Collision 1.0 - [Update 03.May.2009]

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
Nauk
Gnoll
Posts: 647
Joined: Thu May 11, 2006 9:12 pm
Location: Bavaria
Contact:

MOC - Minimal Ogre Collision 1.0 - [Update 03.May.2009]

Postby Nauk » Tue Oct 21, 2008 6:24 pm

MOC - Minimal Ogre Collision 1.0 (Update 03.05.09)

Link to the Video:
Image

Hey everyone, since collision-detection seems to be an ongoing topic and people keep asking about simple collision and more accurate mousepicking we decided to pack our collision routines into a lightweight and easy to use mini-toolkit, named MOC - Minimal Ogre Collision.

MOC is based on the Ogre forum & wiki entries:
http://www.ogre3d.org/phpBB2/viewtopic.php?t=23440
http://www.ogre3d.org/wiki/index.php/Ra ... ygon_level

MOC does not aim to and is by no means able to be a replacement for the use of a full blown physics or collision library. It is rather a solution for situations where integrating a physics library would be a total overkill: like mousepicking in editor applications, quest & turn based rpgs, architectural presentations, quick prototypes, demos etc. Simply in all cases where you only need a basic collision-detection or picking and nothing else.

Performance:
So far we could not detect a notable performance tax when using it. Looking at the demo - you can turn it off entirely pressing C and the FPS meter doesn't show a messurable difference. We had similar good results testing it in bigger scenarios with many more objects in the scene.

Features:
- Simple accurate mousepicking on vertex level, means if you click on a mesh the mesh is only detected if you hit the actual mesh and not the bounding box.
- Simple collision detection, for example to prevent the camera from moving through walls, or enable walking and driving on objects like bridges, roadmeshes, etc.
- Supports ETM, TSM & Meshbased terrains
- Easy to setup and use. MOC only consist of 2 files CollisionTools.h + .cpp
- Open Source under the MIT license allows to use it like you wish, commercial or non-commerical

Downloads:
- MOC demo 1.0 beta - win32 demo,binaries, source and media ~ 46MB
- MOC demo 1.0 beta - VC++ 2005 express project files, sources
- Latest - MOC toolkit source
- Latest - MMOC toolkit source for MOgre

Future Plans:
- Support for BSP
- Static Geometry

Repository:
- MOC - Google Code

Homepage:
- MOC on www.artifexterra.com

Since this is not only my doing:
Thanks & credits to Wannabee who helped a lot with the implementation and Eliah for making the video.

Hopefully some of you find it useful :)

/Nauk
Last edited by Nauk on Sun Feb 26, 2012 1:50 pm, edited 8 times in total.
0 x

User avatar
altren
Gnome
Posts: 309
Joined: Tue Oct 24, 2006 9:02 am
Location: Moscow, Russa
Contact:

Postby altren » Tue Oct 21, 2008 8:33 pm

Great! I think such tool will be really useful.
Are you going to update it or it's one time release?
Last edited by altren on Tue Oct 21, 2008 9:24 pm, edited 1 time in total.
0 x
Image

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

Postby betajaen » Tue Oct 21, 2008 8:41 pm

Brilliant!

It's about time Ogre has something like this.
0 x

bharling
Gremlin
Posts: 166
Joined: Fri Jun 30, 2006 1:04 pm

Postby bharling » Tue Oct 21, 2008 9:59 pm

Very useful indeed, I second comments before - ogre needs a very simple collision lib when true physics is not required.

At the risk of over complicating things, can I recommend adding some simple octree culling into the routine, might speed things up considerably
0 x
Was here

User avatar
Duncan Mac Leod
Halfling
Posts: 79
Joined: Fri Jun 23, 2006 12:27 am
Location: Germany
Contact:

Postby Duncan Mac Leod » Tue Oct 21, 2008 11:08 pm

Thank you so much...

I will try it out as soon as time permits :wink:
0 x

User avatar
novaumas
Greenskin
Posts: 107
Joined: Mon Jan 21, 2008 9:44 am
Location: Barcelona
Contact:

Postby novaumas » Wed Oct 22, 2008 1:52 am

Great project, I love the non intrusive nature of it: Just add the two files to a project and start using it.
0 x

User avatar
crioto
Halfling
Posts: 59
Joined: Fri Aug 11, 2006 8:34 pm
Location: Bishkek, Kyrgyzstan
Contact:

Postby crioto » Wed Oct 22, 2008 6:44 am

Looks nice!!!
0 x
Do your work, don't be stupid

User avatar
Nargil
Greenskin
Posts: 124
Joined: Thu Feb 15, 2007 8:47 pm

Postby Nargil » Wed Oct 22, 2008 12:27 pm

A shame I've already started writing my editor with a physics library. But at least I can simulate the physics to see if an object isn't thrown into the space because it's placed inside the floor ;)
0 x

User avatar
manowar
Orc
Posts: 419
Joined: Thu Apr 07, 2005 2:11 pm
Location: UK
Contact:

Postby manowar » Wed Oct 22, 2008 12:40 pm

If I understand well, this is similar as OgreOpcode...but does not use opcode then ?
0 x

User avatar
Jabberwocky
OGRE Moderator
OGRE Moderator
Posts: 2819
Joined: Mon Mar 05, 2007 11:17 pm
Location: Canada
Contact:

Postby Jabberwocky » Wed Oct 22, 2008 3:23 pm

This is a great gift for people who want to get something simple working, and maybe don't have the time, programming experience, or need for something more complicated.

Nice work. :)
0 x
Image

User avatar
alexdbkim
Greenskin
Posts: 130
Joined: Sat Oct 18, 2008 7:50 am
Location: Sydney, Australia / Seoul, Korea
Contact:

Postby alexdbkim » Wed Oct 22, 2008 3:36 pm

Wow~ it must be a hard work. Excellent =)
0 x
Alexander Dong Back Kim - ê¹€ë

User avatar
oddrose
Orc
Posts: 470
Joined: Thu Feb 15, 2007 2:08 pm
Location: Gothenburg, Sweden
Contact:

Postby oddrose » Wed Oct 22, 2008 6:25 pm

Great, great!
0 x

User avatar
Nauk
Gnoll
Posts: 647
Joined: Thu May 11, 2006 9:12 pm
Location: Bavaria
Contact:

Postby Nauk » Wed Oct 22, 2008 7:47 pm

@Altren: We will update and continue working on it to improve performance and features, also the reason we put it up on sourceforge so hopefully others will contribute ideas and code.

@Bharling: I will definately have a look into that, at this point I have to admit I only know the very basics about culling mechanics and possible implementations, but I already started reading up on it, since it sounds like a good thing to do. If you have more detailed suggestions, pointers or ideas about it feel free to post them here or on the MOC forum: http://92.51.140.14/artifexterra3d/foru ... ?board=7.0 - will be definately greatly appreciated.

@Nargil: But then you got it already up and running which is what counts :) and there is always the possibility to try it in the next project.

@Manowar: Both have the same basic purpose, but Opcode has definately way more features and is likely more performant, where MOC is easier to integrate and lightweight.

Many thanks for the overly nice feedback everyone on behalf of our humble team :)
0 x

User avatar
vilgeits
Goblin
Posts: 298
Joined: Tue Aug 02, 2005 10:41 pm

Postby vilgeits » Wed Oct 22, 2008 8:18 pm

Great and simply :D
0 x

User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19261
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
Contact:

Postby sinbad » Fri Oct 24, 2008 1:01 pm

Nice work - for those that don't want to go all the way to Opcode or to a physics engine I can see this being very useful.
0 x

rukos1
Gnoblar
Posts: 5
Joined: Wed Aug 22, 2007 8:20 pm

MOC feature request

Postby rukos1 » Fri Oct 24, 2008 2:27 pm

Hi,

i tried out MOC and it works fine.
The CollisionTools::raycastFromCamera method expects an const OIS::MouseEvent param.
What do you think about a downgrade to an OIS::MouseState struct? You just use the mouse position in this function. This could reduce the dependencies.

best regards rukos1
0 x

User avatar
Praetor
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 3335
Joined: Tue Jun 21, 2005 8:26 pm
Location: Rochester, New York, US
Contact:

Postby Praetor » Fri Oct 24, 2008 3:55 pm

I actually completely removed the OIS dependency and had that function take in Ogre::Real x and y parameters for viewport-relative mouse positions.
0 x

User avatar
Nauk
Gnoll
Posts: 647
Joined: Thu May 11, 2006 9:12 pm
Location: Bavaria
Contact:

Postby Nauk » Fri Oct 24, 2008 5:26 pm

@vilgeits: thank you very much :)

@sinbad: thanks a lot, your feedback means a lot for us :)

@rukos1 & praetor: many thanks for testing and input :) , you both are totally right, changing it to x,y parameters to remove the OIS dependency.
0 x

rukos1
Gnoblar
Posts: 5
Joined: Wed Aug 22, 2007 8:20 pm

another MOC feature request

Postby rukos1 » Thu Oct 30, 2008 1:54 pm

Hi,

I tried to pick an BillboardSet, but they were not recognized, because Billboards are not intented. To allow this I added the entry:
mRaySceneQuery->setQueryTypeMask(SceneManager::FX_TYPE_MASK | SceneManager::ENTITY_TYPE_MASK);
into the constructor.
But in method CollisionTools::raycast is an explicit check if the object is an entity. Could the next version consider Billboardsets please. A flexible solution would be to allow the user to set the QueryTypeMask...

Another point is the returned target as ulong value.
Why don´t you just return a movable pointer without this horrible cast?

Thanks for your work!
0 x

User avatar
Nauk
Gnoll
Posts: 647
Joined: Thu May 11, 2006 9:12 pm
Location: Bavaria
Contact:

Postby Nauk » Thu Oct 30, 2008 6:44 pm

Good point, thanks for the input rukos1, I will add/modify both and you are welcome :)
0 x

User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
Contact:

Postby jacmoe » Thu Oct 30, 2008 9:39 pm

Great work!
I approve of the MOC! :)

About time that Ogre got a collision lib using nothing but Ogre. :wink:
0 x
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.

User avatar
Nauk
Gnoll
Posts: 647
Joined: Thu May 11, 2006 9:12 pm
Location: Bavaria
Contact:

Postby Nauk » Sat Nov 01, 2008 4:40 pm

We are happy you like the MOC! - thank you for the kind words jacmoe :)
0 x

User avatar
nikki
Old One
Posts: 2730
Joined: Sat Sep 17, 2005 10:08 am
Location: Princeton, New Jersey, USA
Contact:

Postby nikki » Tue Nov 04, 2008 2:03 pm

Thanks a lot for this! I'm working on a little demo/tutorial for NGF, and I wanted to include some simple collision detection, without placing dependencies on a full-blown physics engine or collision library. Looks like this is what I need! :)
0 x

tourist
Gnoblar
Posts: 9
Joined: Wed Jun 11, 2008 7:52 pm

Thanks!

Postby tourist » Wed Nov 05, 2008 12:09 pm

Thanks for this great and solid contribution. Its an awesome feature, solid, simple, and eficient
0 x

User avatar
Nauk
Gnoll
Posts: 647
Joined: Thu May 11, 2006 9:12 pm
Location: Bavaria
Contact:

Postby Nauk » Wed Nov 05, 2008 7:07 pm

Thanks Nikki and tourist for the great feedback, very rewarding for us :)
0 x


Return to “Showcase”

Who is online

Users browsing this forum: No registered users and 6 guests