HexDump
04-02-2008 22:57:06
Hi all,
Is there anyway to precreate a body whitout having it added authomatically to the world?.
I need this in order to precreate a pool of entities with all its parts ready to go. But I have noticed that there's only a way to create a body, and it adds the body authomatically to the world Sad.
I would like to do something like this:
1) Create Entity (nothing is added to the physics world, but collision and body for the entity are been created).
2) Add the Entity to the game world. The entity body is added to the physics world.
3) Remove entity from the game world. The entity body is removed form the world but not deleted. It is ready to be added again if I re-add the entity to the world.
Note: I could freeze the bodies after creation, but I think this isn´t a good option (Think about a pool of 300 entities Smile ). By the way I have read that when creating a body it is authomatically added to the simulation list, so, to the world.
Thanks in advance,
HexDump.
Is there anyway to precreate a body whitout having it added authomatically to the world?.
I need this in order to precreate a pool of entities with all its parts ready to go. But I have noticed that there's only a way to create a body, and it adds the body authomatically to the world Sad.
I would like to do something like this:
1) Create Entity (nothing is added to the physics world, but collision and body for the entity are been created).
2) Add the Entity to the game world. The entity body is added to the physics world.
3) Remove entity from the game world. The entity body is removed form the world but not deleted. It is ready to be added again if I re-add the entity to the world.
Note: I could freeze the bodies after creation, but I think this isn´t a good option (Think about a pool of 300 entities Smile ). By the way I have read that when creating a body it is authomatically added to the simulation list, so, to the world.
Thanks in advance,
HexDump.