src/vertex.cpp

changeset 21
0133e565e072
parent 20
cef43609a374
child 24
1a0faaaceb84
equal deleted inserted replaced
20:cef43609a374 21:0133e565e072
155 else 155 else
156 return point.z < other.z; 156 return point.z < other.z;
157 } 157 }
158 158
159 /* 159 /*
160 * Transforms this vertex with a tranformation matrix and returns the result. 160 * Transforms the specified vertex with a transformation matrix
161 */ 161 */
162 Point3D math::transform(const Point3D point, const GLRotationMatrix& matrix) 162 Point3D math::transform(const Point3D& point, const Matrix4x4& matrix)
163 { 163 {
164 return { 164 return {
165 matrix(0, 0) * point.x 165 matrix(0, 0) * point.x
166 + matrix(0, 1) * point.y 166 + matrix(0, 1) * point.y
167 + matrix(0, 2) * point.z, 167 + matrix(0, 2) * point.z
168 + matrix(0, 3),
168 matrix(1, 0) * point.x 169 matrix(1, 0) * point.x
169 + matrix(1, 1) * point.y 170 + matrix(1, 1) * point.y
170 + matrix(1, 2) * point.z, 171 + matrix(1, 2) * point.z
172 + matrix(1, 3),
171 matrix(2, 0) * point.x 173 matrix(2, 0) * point.x
172 + matrix(2, 1) * point.y 174 + matrix(2, 1) * point.y
173 + matrix(2, 2) * point.z, 175 + matrix(2, 2) * point.z
176 + matrix(2, 3),
174 }; 177 };
175 } 178 }
176 179
177 /* 180 /*
178 * Returns the distance from one vertex to another. 181 * Returns the distance from one vertex to another.

mercurial