Changing Entity prefabs at runtime
Posted: Fri Aug 19, 2011 10:43 pm
Hi,
I'm currently working on a BEPUPhysics Manager for my framework (the Indiefreaks Game Framework http://igf.codeplex.com) for the SunBurn engine to replace the built in Collision system.
My goal is to provide a simple to use API that wraps most of the BEPUPhysics required processes so that SunBurn & IGF developers can easily plug Physics to their game entities.
I won't go into the details of the SunBurn scene graph but the idea is to plug BEPUPhysics entities inside this scene graph.
I'm therefore thinking on creating a dedicated component per prefab and per static & mobile meshes treatment so that developers just plug these components to their game entities depending on the game entity type (a box, a sphere, etc...).
But it seems that all the Prefabs require you to create them with their scale pushed to the Shape constructor and I would like to avoid doing so and instead automatically set them based on the game entity itself.
Since most of the game entities used in a SunBurn game will be models, should I use TriangleMesh.GetVerticesAndIndicesFromModel() to then compute the different sizes to apply to the Entity prefab?
Can I apply this information with an instance of an Entity or do I have to create the Entity with its constructor?
Thanks
I'm currently working on a BEPUPhysics Manager for my framework (the Indiefreaks Game Framework http://igf.codeplex.com) for the SunBurn engine to replace the built in Collision system.
My goal is to provide a simple to use API that wraps most of the BEPUPhysics required processes so that SunBurn & IGF developers can easily plug Physics to their game entities.
I won't go into the details of the SunBurn scene graph but the idea is to plug BEPUPhysics entities inside this scene graph.
I'm therefore thinking on creating a dedicated component per prefab and per static & mobile meshes treatment so that developers just plug these components to their game entities depending on the game entity type (a box, a sphere, etc...).
But it seems that all the Prefabs require you to create them with their scale pushed to the Shape constructor and I would like to avoid doing so and instead automatically set them based on the game entity itself.
Since most of the game entities used in a SunBurn game will be models, should I use TriangleMesh.GetVerticesAndIndicesFromModel() to then compute the different sizes to apply to the Entity prefab?
Can I apply this information with an instance of an Entity or do I have to create the Entity with its constructor?
Thanks