TreeCollision serialization

MrCarbohydrate

26-01-2006 22:51:34

I've just sent a CVS patch to use Newton's TreeCollision serialization from OgreNewt. It seems to make a huge performance boost when you need to create lots of static objects on the fly, I'm especially using it with PLSM2 at the moment and initializing a 64x64 terrain tile is roughly 50 times faster with serialization. :D

Code sample on the wiki.

walaber

27-01-2006 01:12:19

hmmm... I wonder how I get patches.... I'm still very new to CVS.

thanks for adding this though, it was one of the few things missing!

[edit]
okay, I found the patch on sourceforge... I wonder how I merge it into ogrenewt CVS?? anyone know?[/edit]

haffax

27-01-2006 10:23:00

You need a patch command line tool. For instance cygwin or the one from unxutils.sf.net.

On the cmd commandline(unxutils) or bash(cygwin) go to your ogreaddons/ogrenewt/OgreNewt_Main/ directory. and type

patch -p0 < patch.txt

The patch.txt from the patch.zip being in the same directory.

walaber

27-01-2006 18:20:06

thank you haffax. I got it to work, and am checking it now. I will update CVS today with the changes. and thanks again MrCarbohydrate for the patch!!

OvermindDL1

29-01-2006 23:35:05

Demo expected for its use?

walaber

30-01-2006 00:51:51

not reall necessary, it's extremely simple to use. just create the collision once, serialize it to a file, and then just load the treecollision from the serialized file, and it's created MUCH faster.

OvermindDL1

30-01-2006 02:17:53

Will have to examine, would certainly be more efficient then allload'ing a plsm2 terrain...

jacmoe

30-01-2006 02:58:28

thank you haffax. I got it to work, and am checking it now. I will update CVS today with the changes. and thanks again MrCarbohydrate for the patch!!
If you applied it, it would be a good idea to log into sourceforge and add a message to the patch that it can be closed. :)

walaber

30-01-2006 03:20:00

OK, will do!

MrCarbohydrate

30-01-2006 07:14:15

Will have to examine, would certainly be more efficient then allload'ing a plsm2 terrain...
Did you check the wiki link I mentionned in the first post? There are code samples, it's very straightforward. And much more efficient than directly creating the collision from the PLSM2 geometry indeed!

OvermindDL1

30-01-2006 07:35:44

Looked quickly earlier, have not yet added plsm2 to my project, that is my next goal after I finish a set of factory classes, will look closely then. Thank you.

maxwave

10-04-2006 20:24:15

Hello all!
I use PLSM2 and OgreNewt. Also I want to use serialization, because my app very slowly. I have 2 questions:
1) I read code in wiki (PLSM2 and OgreNewt) and make it, but I don't understand, where I must use serializarion code for save or recovery collizion for best performance.
2) this method fix problem for LOWEST FPS, when work line?:

OgreNewt::Collision* collision=new OgreNewt::CollisionPrimitives::TreeCollision(m_World,numVertices,vertices,indexData,false); (i this line my app "pausing")

maxwave

11-04-2006 20:23:37

I understand how to use serilization, but I have trouble - ALL objects collide with terrain and fall Through it. Why??? :(

OvermindDL1

11-04-2006 20:50:02

Perhaps a demo in the next version of OgreNewt showing how to serialize? I can make it if you want.

But yea, going with maxwave, I often have things go through the terrain, rather then impact on it as well, happens at the faster speeds so the problem is obvious, but is there a good way to help prevent it without turning on that one costly option (it is vehicles themselves that pass through)? I could turn on that option at the certain times it occurs, is it costly to turn it on/off rapidly (every few frames or so)?

maxwave

12-04-2006 17:21:36

I'm sorry, but your english hard for me. If I have understood, you want to make one option, which down FPS, but due to which the objects will not go trough. It you want to show in Demo?

maxwave

12-04-2006 17:36:58

And serialization don't have only one problem. When I press F3, that show collisions, app crash.

danni

15-10-2006 18:38:13

Same boat, using latest ogrenewt, PLSM and Newton i get a crash in newton.dll!0037635a when i press f3 to view the collision mesh using the serializer.

If it rebuild the data each time instead of serializing it works for a short while.

Any clues?