OGRE Wiki
Support and community documentation for Ogre3D
Ogre Forums
ogre3d.org
Log in
Username:
Password:
CapsLock is on.
Remember me (for 1 year)
Log in
Home
Tutorials
Tutorials Home
Basic Tutorials
Intermediate Tutorials
Mad Marx Tutorials
In Depth Tutorials
Older Tutorials
External Tutorials
Cookbook
Cookbook Home
CodeBank
Snippets
Experiences
Ogre Articles
Libraries
Libraries Home
Alternative Languages
Assembling A Toolset
Development Tools
OGRE Libraries
List of Libraries
Tools
Tools Home
DCC Tools
DCC Tutorials
DCC Articles
DCC Resources
Assembling a production pipeline
Development
Development Home
Roadmap
Building Ogre
Installing the Ogre SDK
Setting Up An Application
Ogre Wiki Tutorial Framework
Frequently Asked Questions
Google Summer Of Code
Help Requested
Ogre Core Articles
Community
Community Home
Projects Using Ogre
Recommended Reading
Contractors
Wiki
Immediate Wiki Tasklist
Wiki Ideas
Wiki Guidelines
Article Writing Guidelines
Wiki Styles
Wiki Page Tracker
Ogre Wiki Help
Ogre Wiki Help Overview
Help - Basic Syntax
Help - Images
Help - Pages and Structures
Help - Wiki Plugins
Toolbox
Freetags
Categories
List Pages
Structures
Trackers
Statistics
Rankings
List Galleries
Ogre Lexicon
Comments
History: -Entity
View page
Source of version: 7
(current)
{INCLUDE(page="ogrelex ext tpl")/} --- __Short description__ by user ((user:madmarx|MadMarx)): An Entity is an instance of a ((-Mesh|mesh)), and allow different ((-Material|material)) information for each entity. Entities are often the most common object in a Ogre application. Different Entities can have different materials, while sharing the same mesh. It is possible to create Entities with different meshes too. In order to move an Entity, attach it to a ((-SceneNode|SceneNode)), and move this SceneNode. %%% __Long description__ An entity is an instance of a ((-MovableObject|MovableObject)) in the ((-scene|scene)). It could be a car, a person, a dog, a shuriken, whatever. The only assumption is that it does not necessarily have a fixed position in the world. Entities are based on discrete meshes, i.e. collections of geometry which are self-contained and typically fairly small on a world scale, which are represented by the ((-Mesh|Mesh)) object. Multiple entities can be based on the same mesh, since often you want to create multiple copies of the same type of object in a scene. You create an entity by calling the ''((-SceneManager))::createEntity()'' method, giving it a name and specifying the name of the mesh object which it will be based on (e.g. 'muscleboundhero.mesh'). The -SceneManager will ensure that the mesh is loaded by calling the ((MeshManager)) resource manager for you. Only one copy of the -Mesh will be loaded. Entities are not deemed to be a part of the scene until you attach them to a ((-SceneNode|SceneNode)) (see the section below). By attaching entities to SceneNodes, you can create complex hierarchical relationships between the positions and orientations of entities. You then modify the positions of the nodes to indirectly affect the entity positions. When a ((-Mesh|Mesh)) is loaded, it automatically comes with a number of materials defined. It is possible to have more than one material attached to a mesh - different parts of the mesh may use different materials. Any entity created from the mesh will automatically use the default materials. However, you can change this on a per-entity basis if you like so you can create a number of entities based on the same mesh but with different ((-Texture|texture))s etc. To understand how this works, you have to know that all Mesh objects are actually composed of ((-Submesh Names|SubMesh)) objects, each of which represents a part of the mesh using one ((-Material|Material)). If a Mesh uses only one Material, it will only have one SubMesh. When an Entity is created based on this Mesh, it is composed of (possibly) multiple SubEntity objects, each matching 1 for 1 with the ((-Submesh Names|SubMesh)) objects from the original Mesh. You can access the SubEntity objects using the ''Entity::getSubEntity()'' method. Once you have a reference to a SubEntity, you can change the material it uses by calling it's ''setMaterialName()'' method. In this way you can make an Entity deviate from the default materials and thus create an individual looking version of it. !!See also * [http://www.ogre3d.org/docs/api/html/classOgre_1_1Entity.html|Ogre::Entity Class Reference] * ((-Mesh|Mesh)) * ((ManualObject)) - useful class for creation of 3D objects by code * ((-Material|Material)) --- {INCLUDE(page="ogrelex ext tpl")/} ---
Search by Tags
Search Wiki by Freetags
Latest Changes
Ogre 2.1 FAQ
Minimal Ogre Collision
Artifex Terra
OpenMB
Advanced Mogre Framework
MogreSocks
Critter AI
Mogre Add-ons
MOGRE
Mogre MyGUI wrapper
...more
Search
Find
Advanced
Search Help
Online Users
148 online users