Create StaticGeometry directly from Mesh
Posted: Sun Feb 24, 2013 11:19 am
StaticGeometry can currently only be built by attaching Entities with the following function
addEntity (Entity *ent, const Vector3 &position, const Quaternion &orientation=Quaternion::IDENTITY, const Vector3 &scale=Vector3::UNIT_SCALE)
The Entity is itself just an instance of a Mesh and every tutorial for use of staticGeometry I've seen warns you that you need to destroy the entity after assigning it to the Geometry or you will end up rendering both at a huge waste. Now if I'm correct the only thing addEntity dose is immediately rip the Mesh pointer and Material pointers out of Entity and works with them directly. So why are you forced to make Entities which are serving as nothing but temporary containers for this function and are then a liability. Lets have at least the option of doing this cleanly with the following function.
addMesh (Mesh* mesh, Material* mat, const Vector3 &position, const Quaternion &orientation=Quaternion::IDENTITY, const Vector3 &scale=Vector3::UNIT_SCALE)
addEntity (Entity *ent, const Vector3 &position, const Quaternion &orientation=Quaternion::IDENTITY, const Vector3 &scale=Vector3::UNIT_SCALE)
The Entity is itself just an instance of a Mesh and every tutorial for use of staticGeometry I've seen warns you that you need to destroy the entity after assigning it to the Geometry or you will end up rendering both at a huge waste. Now if I'm correct the only thing addEntity dose is immediately rip the Mesh pointer and Material pointers out of Entity and works with them directly. So why are you forced to make Entities which are serving as nothing but temporary containers for this function and are then a liability. Lets have at least the option of doing this cleanly with the following function.
addMesh (Mesh* mesh, Material* mat, const Vector3 &position, const Quaternion &orientation=Quaternion::IDENTITY, const Vector3 &scale=Vector3::UNIT_SCALE)