SO3Engine
|
ALNode.cpp
Go to the documentation of this file.
9 ALNode::ALNode(aiNode* asNode, SNode* pNode, ALScene* alscene, std::vector<aiCamera*> camerasNames, std::vector<aiLight*> lightsNames)
26 ALConverterNodeAnim nodeAnim(mScene, anims[n], anims[n]->mChannels[i], mOrigin, anims[n]->mTicksPerSecond);
33 ALNode::ALNode(aiNode* asNode, SNode* pNode, ALScene* alscene, std::vector<aiCamera*> camerasNames, std::vector<aiLight*> lightsNames, tinyxml2::XMLElement* xmlParent)
51 ALConverterNodeAnim nodeAnim(mScene, anims[n], anims[n]->mChannels[i], mOrigin, anims[n]->mTicksPerSecond);
67 if ((ConversionTools::fequal(light->mAttenuationLinear, 0.0f)) && (ConversionTools::fequal(light->mAttenuationQuadratic, 0.0f)))
76 float range = (sqrt(4 * light->mAttenuationConstant * light->mAttenuationQuadratic + light->mAttenuationLinear + 4 * light->mAttenuationQuadratic) - light->mAttenuationLinear) / (2 * light->mAttenuationQuadratic);
155 xmlight->SetAttribute("castShadows", (cLight->mType == aiLightSource_DIRECTIONAL) ? true : false);
170 atten->SetAttribute("range", ConversionTools::formatFloatToString(processRange(cLight)).c_str());
171 atten->SetAttribute("constant", ConversionTools::formatFloatToString(cLight->mAttenuationConstant).c_str());
172 atten->SetAttribute("linear", ConversionTools::formatFloatToString(cLight->mAttenuationLinear).c_str());
173 atten->SetAttribute("quadratic", ConversionTools::formatFloatToString(cLight->mAttenuationQuadratic).c_str());
179 lrange->SetAttribute("inner", ConversionTools::formatFloatToString(cLight->mAngleInnerCone).c_str());
180 lrange->SetAttribute("outer", ConversionTools::formatFloatToString(cLight->mAngleOuterCone).c_str());
209 xmlcam->SetAttribute("fov", ConversionTools::formatFloatToString(gfovY.valueRadians()).c_str());
212 clipping->SetAttribute("near", ConversionTools::formatFloatToString(cCamera->mClipPlaneNear).c_str());
213 clipping->SetAttribute("far", ConversionTools::formatFloatToString(cCamera->mClipPlaneFar).c_str());
411 SCamera* scolCam = mScene->getSScene()->CreateCamera(ALStringCleaner::cleanString(cCamera->mName.C_Str()));
416 scolCam->LookAt(Ogre::Vector3(cCamera->mLookAt.x, cCamera->mLookAt.y, cCamera->mLookAt.z), SNode::SO3_WORLD_TS);
436 SLight* scolLight = mScene->getSScene()->CreateLight(ALStringCleaner::cleanString(cLight->mName.C_Str()));
437 //scolLight->SetAttenuation(solveLightRange(light[n]), light[n]->mAttenuationConstant, light[n]->mAttenuationLinear, light[n]->mAttenuationQuadratic);
440 scolLight->SetDiffuseColour(Ogre::ColourValue(cLight->mColorDiffuse.r, cLight->mColorDiffuse.g, cLight->mColorDiffuse.b, 1.f));
441 scolLight->SetSpecularColour(Ogre::ColourValue(cLight->mColorSpecular.r, cLight->mColorSpecular.g, cLight->mColorSpecular.b, 1.f));
443 scolLight->SetDirection(Ogre::Vector3(cLight->mDirection.x, cLight->mDirection.y, cLight->mDirection.z));
static std::string curentUID()
return the current UID WITHOUT incrementing the UID.
Definition ALStringCleaner.cpp:116
static std::string cleanString(std::string str, bool toLower=true, bool clASCII=true, bool clSpaces=true, bool bUID=true)
Clean a string.
Definition ALStringCleaner.cpp:130
Definition ALMesh.h:26
ALNode(aiNode *asNode, SNode *pNode, ALScene *alscene, std::vector< aiCamera * > camerasNames, std::vector< aiLight * > lightsNames)
Definition ALNode.cpp:9
tinyxml2::XMLElement * convert(boost::filesystem::path expPath)
Definition ALNode.cpp:86
Definition ALScene.h:31
static std::string formatFloatToString(double val)
Definition SO3ConversionTools.cpp:700
static bool fequal(float a, float b)
Definition SO3ConversionTools.cpp:652
Definition SO3Camera.h:43
Definition SO3Entity.h:43
Definition SO3Light.h:44
void SetAttenuation(const float &range, const float &constant, const float &linear, const float &quadratic)
Definition SO3Light.cpp:172
Definition SO3NodeScol.h:43
virtual void SetOrientation(const Ogre::Quaternion &quat)
Definition SO3NodeScol.cpp:589
virtual void SetPosition(const Ogre::Vector3 &pos)
Definition SO3NodeScol.cpp:548
SNode * CreateNodeWithUniqueName(const std::string &basename)
Definition SO3Scene.cpp:611
SLight * CreateLight(const std::string &newLightName)
Definition SO3Scene.cpp:980
SCamera * CreateCamera(const std::string &newCameraName)
Definition SO3Scene.cpp:653
Definition tinyxml2.h:1502
XMLElement * NewElement(const char *name)
Definition tinyxml2.h:1130
void SetAttribute(const char *name, const char *value)
Sets the named attribute to value.
Definition tinyxml2.h:1303
const XMLDocument * GetDocument() const
Get the XMLDocument that owns this XMLNode.
Definition tinyxml2.h:592
XMLNode * InsertFirstChild(XMLNode *addThis)
XMLNode * InsertEndChild(XMLNode *addThis)
Definition SO3DataScol.h:38
Generated by 1.9.8