SO3Engine
|
SO3Entity.cpp
Go to the documentation of this file.
54 SEntity::SEntity(SScene* parent, const std::string& groupName, const std::string& entityName, const std::string& meshName, bool loadInBackground) : SNode(parent, entityName, SNode::ENTITY_TYPE_ID)
85 Ogre::LogManager::getSingletonPtr()->logMessage(e.getFullDescription(), Ogre::LML_CRITICAL, true);
103 Ogre::LogManager::getSingletonPtr()->logMessage(e.getFullDescription(), Ogre::LML_CRITICAL, true);
124 // Check if there's an animation per pose, and create it in the mesh if not exists. NB that those are created in the mesh BEFORE creating the entity!
137 Ogre::LogManager::getSingleton().logMessage("No animation was found for mesh pose \"" + animationName + "\", SO3Engine will generate automatically an animation for it, but it'll be cleaner to create this animation in your modeler!");
153 Ogre::VertexAnimationTrack* vt = ogreAnimation->createVertexTrack(targetSubMesh, Ogre::VAT_POSE);
163 O3Entity = currentScene->GetOgreScenePointer()->createEntity(GetName(), mResourceName, mGroupName);
219 OGRE_EXCEPT(Ogre::Exception::ERR_INTERNAL_ERROR, "Cannot load a mesh with manual LOD!", "SEntity::SEntity");
225 // Check if there's an animation per pose, and create it in the mesh if not exists. NB that those are created in the mesh BEFORE creating the entity!
239 Ogre::LogManager::getSingleton().logMessage("No animation was found for mesh pose \"" + animationName + "\", SO3Engine will generate automatically an animation for it, but it'll be cleaner to create this animation in your modeler!");
255 Ogre::VertexAnimationTrack* vt = ogreAnimation->createVertexTrack(targetSubMesh, Ogre::VAT_POSE);
261 O3Entity = currentScene->GetOgreScenePointer()->createEntity(GetName(), mResourceName, mGroupName);
278 SEntity::SEntity(SScene* parent, const std::string& entityName, const std::string& groupName, Ogre::MeshPtr meshPointer) : SNode(parent, entityName, SNode::ENTITY_TYPE_ID)
308 Ogre::LogManager::getSingletonPtr()->logMessage(e.getFullDescription(), Ogre::LML_CRITICAL, true);
325 // Check if there's an animation per pose, and create it in the mesh if not exists. NB that those are created in the mesh BEFORE creating the entity!
339 Ogre::LogManager::getSingleton().logMessage("No animation was found for mesh pose \"" + animationName + "\", SO3Engine will generate automatically an animation for it, but it'll be cleaner to create this animation in your modeler!");
365 SEntity::SEntity(SScene* parent, const std::string& entityName, const EntityPrefabType& prefabType) : SNode(parent, entityName, SNode::ENTITY_TYPE_ID)
378 O3Entity = currentScene->GetOgreScenePointer()->createEntity(entityName, Ogre::SceneManager::PT_PLANE);
381 O3Entity = currentScene->GetOgreScenePointer()->createEntity(entityName, Ogre::SceneManager::PT_CUBE);
384 O3Entity = currentScene->GetOgreScenePointer()->createEntity(entityName, Ogre::SceneManager::PT_SPHERE);
393 SEntity::SEntity(SScene* parent, const std::string& groupName, const std::string& entityName, const SPointFloat& sizev, const SPointInt& seg, const SPointFloat& uv) : SNode(parent, entityName, SNode::ENTITY_TYPE_ID)
403 mMesh = Ogre::MeshManager::getSingleton().createPlane(mResourceName, mGroupName, plane, sizev.x, sizev.y, seg.x, seg.y, true, 1, uv.x, uv.y, Ogre::Vector3::UNIT_Z);
404 O3Entity = currentScene->GetOgreScenePointer()->createEntity(entityName, mResourceName, groupName);
409 SEntity::SEntity(SScene* parent, const std::string& groupName, const std::string& entityName, const float& radius, const int& rings, const int& segments) : SNode(parent, entityName, SNode::ENTITY_TYPE_ID)
418 mMesh = SBaseMeshsTools::CreateSphere(mResourceName, radius, rings, segments, true, true, mGroupName);
419 O3Entity = currentScene->GetOgreScenePointer()->createEntity(entityName, mResourceName, groupName);
424 SEntity::SEntity(SScene* parent, const std::string& groupName, const std::string& entityName, const float& radius, const float& height, const int& segments) : SNode(parent, entityName, SNode::ENTITY_TYPE_ID)
434 O3Entity = currentScene->GetOgreScenePointer()->createEntity(entityName, mResourceName, groupName);
439 SEntity::SEntity(SScene* parent, const std::string& groupName, const std::string& entityName, const float& base, const float& bottom, const float& dist) : SNode(parent, entityName, SNode::ENTITY_TYPE_ID)
449 O3Entity = currentScene->GetOgreScenePointer()->createEntity(entityName, mResourceName, groupName);
469 if (vdata && !vdata->vertexDeclaration->findElementBySemantic(Ogre::VertexElementSemantic::VES_TEXTURE_COORDINATES))
479 auto tvbuf = mMesh->getHardwareBufferManager()->createVertexBuffer(vcnt + 2 * sizeof(float), vdata->vertexCount, origBuffer->getUsage(), origBuffer->hasShadowBuffer());
514 const Ogre::VertexElement* hasTangent = mMesh->getSubMesh(0)->vertexData->vertexDeclaration->findElementBySemantic(Ogre::VertexElementSemantic::VES_TANGENT);
531 Ogre::LogManager::getSingletonPtr()->logMessage(e.getFullDescription(), Ogre::LML_CRITICAL, true);
567 Ogre::LogManager::getSingletonPtr()->logMessage(e.getFullDescription(), Ogre::LML_CRITICAL, true);
610 animation = new SPoseAnimation(GetParentScene(), ogreAnimation->getName(), this, animationCounter++, iPoseAnim->second);
612 animation = new SVertexAnimation(GetParentScene(), ogreAnimation->getName(), this, animationCounter++);
618 // Bind this instance to every subentity of the entity (used in SEntitySelectorMaterialSwitcher).
MMechostr(MSKDEBUG, " > Start loading Plugin SO3Engine dll\n")
static Ogre::MeshPtr CreateCone(const Ogre::String &strName, float radius, float height, int nVerticesInBase, Ogre::String groupName=Ogre::RGN_DEFAULT)
Definition SO3BaseMeshsTools.cpp:145
static Ogre::MeshPtr CreateSphere(const Ogre::String &strName, float radius, int nRings, int nSegments, bool bNormals, bool bTexCoords, Ogre::String groupName=Ogre::RGN_DEFAULT)
Definition SO3BaseMeshsTools.cpp:35
static Ogre::MeshPtr CreateOctahedron(const Ogre::String &strName, float baseLength, float bottomDistance, float upDistance, Ogre::String groupName=Ogre::RGN_DEFAULT)
Definition SO3BaseMeshsTools.cpp:253
virtual void SetCastShadows(const bool &castShadows)
Definition SO3Entity.cpp:699
virtual void SetRenderingDistance(const float &distance)
Definition SO3Entity.cpp:713
void SetVisibilityFlags(const Ogre::uint32 &flags)
Definition SO3Entity.cpp:823
virtual Ogre::Vector3 GetWorldBoundingBoxCenter(const bool &childs=false)
Definition SO3Entity.cpp:762
void SetRenderQueue(const Ogre::RenderQueueGroupID &groupId)
Definition SO3Entity.cpp:809
virtual Ogre::Vector3 GetBoundingBoxCenter(const bool &childs=false)
Definition SO3Entity.cpp:740
virtual Ogre::Vector3 GetBoundingBoxSize(const bool &childs=false)
Definition SO3Entity.cpp:727
virtual Ogre::Vector3 GetWorldBoundingBoxSize(const bool &childs=false)
Definition SO3Entity.cpp:749
void SetVisibilityFlagIndexEnable(const Ogre::uint32 &flagIndex, bool enable)
Definition SO3Entity.cpp:837
bool GetVisibilityFlagIndexEnable(const Ogre::uint32 &flagIndex)
Definition SO3Entity.cpp:850
virtual void loadingComplete(Ogre::Resource *res)
Definition SO3Entity.cpp:272
Definition SO3Material.h:43
Ogre::MaterialPtr getOgreMaterialPointer()
Definition SO3Material.cpp:157
Definition SO3NodeScol.h:43
Ogre::Vector3 GetSonsWorldBoundingBox()
Definition SO3NodeScol.cpp:508
void SetVisible(const bool &visible, const bool &cascade=true)
Definition SO3NodeScol.cpp:934
SNode(SScene *parent, const std::string &nodeName, const bool &isRootNode=false)
Definition SO3NodeScol.cpp:37
Definition SO3Point.h:37
Definition SO3Root.h:73
Definition SO3Scene.h:125
SMaterial * GetMaterial(const std::string &groupName, const std::string &materialName, bool searchOtherGroups=true)
Definition SO3Scene.cpp:1099
SMaterial * CreateMaterial(const std::string &groupname, const std::string &matname, const bool &loadedFromScript=false)
Definition SO3Scene.cpp:1048
Ogre::SceneManager * GetOgreScenePointer()
Definition SO3Scene.cpp:449
void DeleteSkeleton(SSkeleton *existingSkeleton)
Definition SO3Scene.cpp:941
Definition SO3Skeleton.h:42
Definition SO3DataScol.h:38
Generated by 1.9.8