Skip to main content

History: PrefabType

Preview of version: 2

PrefabType is an enumerator of the 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 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:

  • PrefabType::PT_PLANE
  • PrefabType::PT_CUBE
  • PrefabType::PT_SPHERE


Example code

Copy to clipboard
// Create a prefab plane Entity planeEnt = sceneMgr::createEntity("Plane", SceneManager::PrefabType::PT_PLANE); // Give the plane a texture planeEnt::setMaterialName("Examples/BumpyMetal"); // Attach the 2 new entities to the root of the scene sceneMgr::rootSceneNode::attachObject(planeEnt);

Note: sceneMgr is the variable/instance of the SceneManager


See also

History

Information Version
Mon 11 of Mar, 2013 18:08 GMT-0000 scrawl fixed example code 3
Sat 05 of Mar, 2011 19:19 GMT-0000 Beauty some improvements + changed C# code to C++ code 2
Sat 05 of Mar, 2011 19:01 GMT-0000 Beauty NEW PAGE 1