mirror of
				https://github.com/OpenMW/openmw.git
				synced 2025-11-04 06:56:39 +00:00 
			
		
		
		
	Use proper check for distance
To avoid invalid results for r < 1.
This commit is contained in:
		
							parent
							
								
									a54c4bc2e9
								
							
						
					
					
						commit
						94e460ba1e
					
				
					 1 changed files with 1 additions and 2 deletions
				
			
		| 
						 | 
					@ -27,8 +27,7 @@ namespace DetourNavigator
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    inline bool inRange(const osg::Vec3f& v1, const osg::Vec3f& v2, const float r)
 | 
					    inline bool inRange(const osg::Vec3f& v1, const osg::Vec3f& v2, const float r)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        const auto d = v2 - v1;
 | 
					        return (osg::Vec2f(v1.x(), v1.z()) - osg::Vec2f(v2.x(), v2.z())).length() < r;
 | 
				
			||||||
        return (d.x() * d.x() + d.z() * d.z()) < r * r;
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    std::vector<dtPolyRef> fixupCorridor(const std::vector<dtPolyRef>& path, const std::vector<dtPolyRef>& visited);
 | 
					    std::vector<dtPolyRef> fixupCorridor(const std::vector<dtPolyRef>& path, const std::vector<dtPolyRef>& visited);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue