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 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

@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

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.

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 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!