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!
AndroidAdam
Gnoblar
Posts: 1
Joined: Sat Aug 14, 2010 2:59 am

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

Post by AndroidAdam »

Sorry to rez an old thread, if that be the case, but I'm having a bit of a problem. MOC worked amazing for a single character, but I now have 40 entities each casting 4 rays (one in each of the cardinal directions) and this is causing quite a performance problem. I'm curious if there is a method of increasing the speed. Already I cache the MeshInformation so that it only has to be retrieved once, but nevertheless the game is unplayable.

Any suggestions would be greatly appreciated
User avatar
Nauk
Gnoll
Posts: 653
Joined: Thu May 11, 2006 9:12 pm
Location: Bavaria
x 36

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

Post by Nauk »

I think you would be better off with using a real physics library in that case. Curious, how much speed gain did you get with the caching?
User avatar
RoadKillGrill
Kobold
Posts: 39
Joined: Fri Mar 13, 2009 8:27 pm
Location: Ohio
x 6

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

Post by RoadKillGrill »

AndroidAdam wrote:Sorry to rez an old thread, if that be the case, but I'm having a bit of a problem. MOC worked amazing for a single character, but I now have 40 entities each casting 4 rays (one in each of the cardinal directions) and this is causing quite a performance problem. I'm curious if there is a method of increasing the speed. Already I cache the MeshInformation so that it only has to be retrieved once, but nevertheless the game is unplayable.

Any suggestions would be greatly appreciated
Instead on using cardinal directions use the heading of the object, that will still allow for good collision with half of the checks. Another thing to do is to disable queries with the current object, the is reduce 2 more checks per entity. For that matter made sure that it is only checking relevant objects that you indeed want collision with, if you don't want collision with it set its query flag. Also try to collide with simpler geometry, at this point seriously consider a real physics engine but it will help allot.

I started using MOC as a temporary solution but as the ppl I assigned to add physics failed it is the only system the High Contract: Zombie Game uses for collision. Even with many objects it is still rather playable on most systems tho I know that MOC is my bottleneck and I really should use a better system.
It's a rule, artist applications are 50% magic and 40% productivity and 10% crash.
jonathan_blacknight
Kobold
Posts: 32
Joined: Sun Mar 21, 2010 8:42 am
Location: Brazil
x 2

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

Post by jonathan_blacknight »

Sorry the stupid question, how about linux and animated meshes with tri mesh shape?
Brazilian blog about game programming
http://www.pontov.com.br/

My develop blog:
http://shydsgames.com/
User avatar
icaro56
Greenskin
Posts: 105
Joined: Sun Feb 15, 2009 2:03 am
Location: Belo Horizonte, MG, BRA
x 1

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

Post by icaro56 »

Hi,

how I to do collision using a OBBoxRenderable ?
http://www.ogre3d.org/tikiwiki/Oriented ... e=Cookbook

OBBoxRenderable is not a mesh and in the MOC the collision test is done witch mesh. Is it simple change the MOC 's code to work with OBBoxRenderable?

thanks.
Ícaro Motta
User avatar
gameengineer
Kobold
Posts: 35
Joined: Sat Oct 09, 2010 8:04 pm
Location: San Diego, CA, USA

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

Post by gameengineer »

I noticed the sample that comes with MOC is camera to world collisions. Will this library handle one object Entity with other static things like walls?

I just need simple kinematic entity collisions against walls. The walls are made up of blocks or cubes placed around the scene. Full blown physics like OgreBullet and NxOgre are overkill for me. Just want collisions so the player mesh and their bullets doesn't go through walls.

Steve
User avatar
RoadKillGrill
Kobold
Posts: 39
Joined: Fri Mar 13, 2009 8:27 pm
Location: Ohio
x 6

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

Post by RoadKillGrill »

gameengineer wrote: Just want collisions so the player mesh and their bullets doesn't go through walls.
It will do that no problem and be very easy, that is what my game uses until I get off my lazy ass and add something better.
It's a rule, artist applications are 50% magic and 40% productivity and 10% crash.
User avatar
gameengineer
Kobold
Posts: 35
Joined: Sat Oct 09, 2010 8:04 pm
Location: San Diego, CA, USA

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

Post by gameengineer »

It will do that no problem and be very easy, that is what my game uses until I get off my lazy ass and add something better.
Yes! Finally the answer I was looking for. I spent the last 2 days searching, asking, learning physics solutions because another post said I needed Bullet or I needed NxOgre. Well this game, which is a Wii Play Tanks clone of sorts, doesn't need physical dynamics. Just collisions if you please.

I will learn physics later but have no time at the moment.

Ok so I reserve the right to ask you more questions if, after diving into the source code, I need to. :roll: :)

Thanks so much for your help.

EDIT: Just watched the video of your game. Nice... a lot of blood. :) My son likes those bloody games too. What is wrong with you people! :roll:

Steve
siondream
Kobold
Posts: 38
Joined: Tue Nov 24, 2009 7:54 pm
x 1

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

Post by siondream »

Wow, this is really great for beginners like me. Have you thought of providing some documentation among the code? Doxygen style documentation would be really great in orden to get a better understanding of the system.

Thanks again!
User avatar
rogerdv
Gnome
Posts: 351
Joined: Fri May 09, 2003 10:43 pm
Location: Cuba
x 1

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

Post by rogerdv »

i havent used MOC in a log time. Does it has been updated to work with new terrain system?
Mafioso
Kobold
Posts: 29
Joined: Mon Mar 21, 2011 4:49 pm

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

Post by Mafioso »

Hello there, I've just implemented MOC::collidesWithEntity into my app, but I've got a problem. I placed two entities opposite to each other and slowly move one towards another that stands still, it works fine, but then I increase the movement speed of the moving entity, the function always returns that collision occured, as far as I know the variables are incorrect in the collidesWithEntity function:

Code: Select all

distToColl = -0.8
distToDest = 1.0
Can anybody help me with this? Thanks in advance.

P.S. And thanks for your time and great work creating this easy to use lib :)

EDIT: I've found out that the gliches occur when frame rate is low, if it's hight enough, even on maximum speed it works fine, any ideas on how to fix it? I would be really grateful :(
maxiwill
Halfling
Posts: 45
Joined: Sat May 22, 2010 8:43 am

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

Post by maxiwill »

hi,

does anybody know what the ETM (Enhanced Terrain Manager) do in the source code?

I'm just wondering if I should implement my own set of terrain manager or not :o
singmelody
Gnoblar
Posts: 11
Joined: Sun Dec 19, 2010 11:03 pm

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

Post by singmelody »

Thanks for that. Now I am using it.
User avatar
Nauk
Gnoll
Posts: 653
Joined: Thu May 11, 2006 9:12 pm
Location: Bavaria
x 36

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

Post by Nauk »

@Maxiwill: ETM is not required, we just used it because we had the setup ready to demo MOC.

@Singmelody: Great to see people still using MOC :)
JDX_John
Gnome
Posts: 397
Joined: Sat Nov 08, 2008 1:59 pm
x 2

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

Post by JDX_John »

A quick question for anyone using MOC for picking... does it support static meshes only or will it work on animated entities too?
User avatar
MorrK
Gnoblar
Posts: 12
Joined: Thu Jun 24, 2010 12:05 pm
x 7

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

Post by MorrK »

i think the current version is just working with not animatied entitys but its easy to make it work with animations as well using this: http://www.ogre3d.org/tikiwiki/Raycasti ... ed_version
eferaga
Gnoblar
Posts: 1
Joined: Wed Feb 15, 2012 10:53 pm

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

Post by eferaga »

Hello, i have the next problem i try to use the function

collidesWithEntity(Ogre::Vector3::ZERO,Ogre::Vector3(50,0,0),60.0f,-1.0f);

and i just do that to get always a true in the collision detection just to test, but the problem is that i always get false the result of this :s, so i would like to know what else do i have to add to achieve the collision or what do i have to modify, i would be very grateful if someone can help me out with this since i need it for a school project,

Sincerely,
Eferaga
fiorebat
Gnoblar
Posts: 3
Joined: Sat May 12, 2012 11:57 am

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

Post by fiorebat »

hi, set up an application with ogre 1.7.3, no artifex, with 3 meshes, 1 particle, if I put the MOC, it works well, but my frame rate goes to 0,7 ~ 1,3 :)

I try a version posted backwards (col3=) but is the same.

Some idea?

tnx