mirror of https://github.com/OpenMW/openmw.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
358 B
C++
17 lines
358 B
C++
3 years ago
|
#ifndef OPENMW_COMPONENTS_MISC_MATH_H
|
||
|
#define OPENMW_COMPONENTS_MISC_MATH_H
|
||
|
|
||
|
#include <osg/Vec3f>
|
||
|
|
||
|
namespace Misc
|
||
|
{
|
||
|
inline osg::Vec3f getVectorToLine(const osg::Vec3f& position, const osg::Vec3f& a, const osg::Vec3f& b)
|
||
|
{
|
||
|
osg::Vec3f direction = b - a;
|
||
|
direction.normalize();
|
||
|
return (position - a) ^ direction;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
#endif
|