This project has moved. For the latest updates, please go here.

Speeding up geom creation at runtime

Oct 25, 2008 at 10:52 AM

are there ways to improve performance of geom creation while the game is running? I'm working on a project where bodies can have a lot of different sizes, so creating a pool of about 100 bodies and geoms per size at load time doesn't seem to be the best idea.
However, if I would create one geom per size and just clone that geom for each body that is created, would this speed things up?

Thanks for your help,
Oct 25, 2008 at 1:45 PM
One of the things that takes some time to calculate, is the distance grid used in the geometries.

If you use the GeomFactory.Instance.CreateGeom(Body, Geom) method for creating a geometry, it will not create a new one, but clone the existing one. The clones distance grid will be pre-calculated and this should speed things up.