Skip to main content

History: PrefabType

Source of version: 1

Copy to clipboard
            The PrefabType enumerator allows an easy creation of 3 types of shapes (plane, cube, 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 call ''SceneManager::__createEntity()__''. The returned ((-Entity|Entity)) contains the wanted shape.

Enums:
* PrefabType::PT_PLANE
* PrefabType::PT_CUBE
* PrefabType::PT_SPHERE

!!Example code

{CODE(wrap="1", colors="c++")}
// 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);
{CODE}
Note: ''sceneMgr'' is the variable/instance of the SceneManager

%%%
!!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))

        

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