Page 1 of 1

Weird StaticTriangleGroup frame drop

Posted: Sat Jun 28, 2008 7:24 pm
by Semei
I have weird problem with drastic frame drop using StaticTriangleGroup... When the game starts i got frame time ~1ms, then when more and more collisions StaticTriangleGroup->Sphere had accured the lower the framerate goes... In the end i have like one frame in ~10ms and i shouldn't get so low fps even if i check all mesh triangles every frame... What could be wrong?

Re: Weird StaticTriangleGroup frame drop

Posted: Sat Jun 28, 2008 8:09 pm
by Zukarakox
If the sphere is colliding with more than 4-5 triangles per frame, it could be causing your problem. Also, check your StaticTriangleGroup initalization parameters, the first two, if you have them set to large numbers, could cause a problem.

Re: Weird StaticTriangleGroup frame drop

Posted: Sat Jun 28, 2008 8:28 pm
by Norbo
For it to reach 10 ms for the detection and such under normal conditions, there would need to be on the order of hundreds of collisions going on. If your sphere rolls over many hundreds of triangles and they never poof afterwards, this could cause some slowdowns separate from collision detection. As Zukarakox mentioned, this behavior relates to the timeInterval and maxAge parameters in the constructor. For reference, the demos uses a .5f and 1 value for timeInterval and maxAge respectively.

Re: Weird StaticTriangleGroup frame drop

Posted: Sat Jun 28, 2008 8:51 pm
by Semei
I use 0.5 and 1 for times. Note that it causes permanent slowdown and i see that usually sphere collides to one or two triangles. I can just "brush" a bunch of triangles when controlling sphere to collide with them, then fly very far away and wait till framerate returns to starting, but it never happens...

Re: Weird StaticTriangleGroup frame drop

Posted: Sat Jun 28, 2008 8:53 pm
by Norbo
Would it be possible for you to provide a reproduction case?

The triangles should be disappearing if you have those settings, so now I'm trying to think of more obscure causes of the lag, perhaps related to the broad phase or weirder sources.