CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
hrydgard

CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!

GitHub Repository: hrydgard/ppsspp
Path: blob/master/Common/Math/lin/vec3.cpp
Views: 1401
1
#include <stdio.h>
2
3
#include "Common/Math/lin/vec3.h"
4
#include "Common/Math/lin/matrix4x4.h"
5
6
namespace Lin {
7
8
Vec3 Vec3::operator *(const Matrix4x4 &m) const {
9
return Vec3(x*m.xx + y*m.yx + z*m.zx + m.wx,
10
x*m.xy + y*m.yy + z*m.zy + m.wy,
11
x*m.xz + y*m.yz + z*m.zz + m.wz);
12
}
13
14
Vec3 Vec3::rotatedBy(const Matrix4x4 &m) const {
15
return Vec3(x*m.xx + y*m.yx + z*m.zx,
16
x*m.xy + y*m.yy + z*m.zy,
17
x*m.xz + y*m.yz + z*m.zz);
18
}
19
20
} // namespace Lin
21
22