1 #ifndef TRANSFORMATIONS_HPP
2 #define TRANSFORMATIONS_HPP
6 #include <steeriously/Matrix.hpp>
7 #include <steeriously/Vector2.hpp>
8 #include <steeriously/VectorMath.hpp>
26 inline std::vector<steer::Vector2>
WorldTransform(std::vector<steer::Vector2> &points,
33 std::vector<steer::Vector2> TranVector2Ds = points;
39 if ( (scale.x != 1.0) || (scale.y != 1.0) )
41 matTransform.
Scale(scale.x, scale.y);
45 matTransform.
Rotate(forward, side);
67 inline std::vector<steer::Vector2>
WorldTransform(std::vector<steer::Vector2> &points,
73 std::vector<steer::Vector2> TranVector2Ds = points;
79 matTransform.
Rotate(forward, side);
113 matTransform.
Rotate(AgentHeading, AgentSide);
116 matTransform.
Translate(AgentPosition.x, AgentPosition.y);
144 matTransform.
Rotate(AgentHeading, AgentSide);
179 matTransform._11(AgentHeading.x); matTransform._12(AgentSide.x);
180 matTransform._21(AgentHeading.y); matTransform._22(AgentSide.y);
181 matTransform._31(Tx); matTransform._32(Ty);
210 matTransform._11(AgentHeading.x); matTransform._12(AgentSide.x);
211 matTransform._21(AgentHeading.y); matTransform._22(AgentSide.y);
260 float SectorSize = fov/(float)(NumWhiskers-1);
262 std::vector<steer::Vector2> whiskers;
264 float angle = -fov*0.5;
266 for (
unsigned int w=0; w<NumWhiskers; ++w)
271 whiskers.push_back(origin + WhiskerLength * temp);
281 #endif //TRANSFORMATIONS_HPP