/usr/include/OpenLayer/Matrix.hpp is in libopenlayer-dev 2.1-2.1+b1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | #ifndef OL_MATRIX_HPP
#define OL_MATRIX_HPP
#include "Vec2D.hpp"
#include "Declspec.hpp"
namespace ol {
class OL_LIB_DECLSPEC Matrix2D {
public:
enum {
SIDE_LENGTH = 2,
NUM_VALUES = SIDE_LENGTH * SIDE_LENGTH
};
inline float Get( int x, int y ) const {
return values[SIDE_LENGTH * y + x];
}
inline void Set( int x, int y, float val ) {
values[SIDE_LENGTH * y + x] = val;
}
inline Vec2D Transform( const Vec2D &vec ) {
return Vec2D( Get( 0, 0 ) * vec.x + Get( 1, 0 ) * vec.y,
Get( 0, 1 ) * vec.x + Get( 1, 1 ) * vec.y );
}
float values[NUM_VALUES];
};
Matrix2D operator*( const Matrix2D &first, const Matrix2D &second );
}
#endif // OL_MATRIX_HPP
|