mirror of
				https://github.com/TES3MP/openmw-tes3mp.git
				synced 2025-10-31 14:56:44 +00:00 
			
		
		
		
	clean up
This commit is contained in:
		
							parent
							
								
									c8bb32c40d
								
							
						
					
					
						commit
						a23e7fac93
					
				
					 1 changed files with 5 additions and 12 deletions
				
			
		|  | @ -316,30 +316,23 @@ namespace MWWorld | |||
|         Ogre::Vector3 dest_ = origin_ +  orient_.yAxis()*queryDistance; | ||||
| 
 | ||||
|         btVector3 origin(origin_.x, origin_.y, origin_.z); | ||||
|         btVector3 dest(dest_.x, dest_.y, dest_.z); | ||||
| 
 | ||||
|         std::pair<std::string,float> result = mEngine->rayTest(origin, dest); | ||||
|         result.second *= queryDistance; | ||||
| 
 | ||||
|         std::pair<std::string,btVector3> result2 = mEngine->sphereTest(queryDistance,origin); | ||||
|         //std::cout << "physic system: getFacedHandle" << result2.first << result2.second.length();
 | ||||
|         if(result2.first == "") return std::make_pair("",0); | ||||
|         btVector3 a = result2.second - origin; | ||||
|         std::pair<std::string,btVector3> result = mEngine->sphereTest(queryDistance,origin); | ||||
|         if(result.first == "") return std::make_pair("",0); | ||||
|         btVector3 a = result.second - origin; | ||||
|         Ogre::Vector3 a_ = Ogre::Vector3(a.x(),a.y(),a.z()); | ||||
|         a_ = orient_.Inverse()*a_; | ||||
|         Ogre::Vector2 a_xy = Ogre::Vector2(a_.x,a_.y); | ||||
|         Ogre::Vector2 a_yz = Ogre::Vector2(a_xy.length(),a_.z); | ||||
|         float axy = a_xy.angleBetween(Ogre::Vector2::UNIT_Y).valueDegrees(); | ||||
|         float az = a_yz.angleBetween(Ogre::Vector2::UNIT_X).valueDegrees(); | ||||
|         std::cout << axy << " " << az << "\n"; | ||||
|         //MWBase::Environment::get().getWorld()->getStore();
 | ||||
| 
 | ||||
|         float fCombatAngleXY = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("fCombatAngleXY")->getFloat(); | ||||
|         float fCombatAngleZ = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("fCombatAngleZ")->getFloat(); | ||||
|         if(abs(axy) < fCombatAngleXY && abs(az) < fCombatAngleZ) | ||||
|             return std::make_pair (result2.first,result2.second.length()); | ||||
|             return std::make_pair (result.first,result.second.length()); | ||||
|         else | ||||
|             return std::make_pair("",0); | ||||
|         //return result;
 | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue