History: PrefabType
Source of version: 3 (current)
Copy to clipboard
PrefabType is an enumerator of the ((-SceneManager|SceneManager)) class, which allows an __easy creation of shapes__.
Available are the types __plane__, __cube__ and __spere__.
These are __useful for visual testing purpose__ by tiny code additions code.
To create a shape, refer the related enum as parameter to the instruction ''SceneManager::__createEntity()__''. The returned ((-Entity|Entity)) contains the wanted shape.
Disadvantage: You have no control over the vertices and texture coordinates.
For dynamic creation of more complex 3D objects you can use ((ManualObject)) or the ((Ogre Procedural Geometry Library)).
Enums:
* PT_PLANE
* PT_CUBE
* PT_SPHERE
!!Example code
{CODE(wrap="1", colors="c++")}
// Create a prefab plane
Entity* planeEnt = sceneMgr->createEntity("Plane", SceneManager::PT_PLANE);
// Give the plane a texture
planeEnt->setMaterialName("Examples/BumpyMetal");
// Attach the 2 new entities to the root of the scene
sceneMgr->getRootSceneNode()->attachObject(planeEnt);
{CODE}
%%%
!!See also
* [http://www.ogre3d.org/docs/api/html/classOgre_1_1SceneManager.html#ab4c2ff4f6c76f7fe0a8eae76f2a84cbf|API reference] of enum __SceneManager::PrefabType__ (incl. a link to the source code)
* ((ManualObject)) - useful class for creation of complex 3D objects by code
* ((Ogre Procedural Geometry Library)) - a library to quickly create geometric primitives
* ((-Entity|Entity))
* ((-Mesh|Mesh))