Files
ppsspp/Common/Math/lin/vec3.cpp

21 lines
449 B
C++
Raw Permalink Normal View History

2012-03-24 23:39:19 +01:00
#include <stdio.h>
#include "Common/Math/lin/vec3.h"
#include "Common/Math/lin/matrix4x4.h"
2012-03-24 23:39:19 +01:00
namespace Lin {
2012-03-24 23:39:19 +01:00
Vec3 Vec3::operator *(const Matrix4x4 &m) const {
2012-10-30 13:20:55 +01:00
return Vec3(x*m.xx + y*m.yx + z*m.zx + m.wx,
x*m.xy + y*m.yy + z*m.zy + m.wy,
x*m.xz + y*m.yz + z*m.zz + m.wz);
2012-03-24 23:39:19 +01:00
}
Vec3 Vec3::rotatedBy(const Matrix4x4 &m) const {
2012-10-30 13:20:55 +01:00
return Vec3(x*m.xx + y*m.yx + z*m.zx,
x*m.xy + y*m.yy + z*m.zy,
x*m.xz + y*m.yz + z*m.zz);
2012-03-24 23:39:19 +01:00
}
} // namespace Lin