erebus
diff liberebus/src/object.cc @ 46:c4d48a21bc4a
in the middle of the vmath->gph-math port
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Wed, 24 Feb 2016 00:26:50 +0200 |
parents | 56d504cc555a |
children |
line diff
1.1 --- a/liberebus/src/object.cc Tue Dec 29 12:19:53 2015 +0200 1.2 +++ b/liberebus/src/object.cc Wed Feb 24 00:26:50 2016 +0200 1.3 @@ -10,25 +10,25 @@ 1.4 obj = subobj = 0; 1.5 } 1.6 1.7 -Vector3 RayHit::calc_normal() const 1.8 +Vec3 RayHit::calc_normal() const 1.9 { 1.10 assert(obj->get_type() == ObjType::geom); 1.11 - Vector3 norm = ((const GeomObject*)obj)->calc_normal(*this); 1.12 + Vec3 norm = ((const GeomObject*)obj)->calc_normal(*this); 1.13 1.14 - const Matrix4x4 &xform = node->get_inv_matrix(); 1.15 - return norm.transformed(Matrix3x3(xform).transposed()).normalized(); 1.16 + const Mat4x4 &xform = node->get_inv_matrix(); 1.17 + return norm.transformed(Mat3x3(xform).transposed()).normalized(); 1.18 } 1.19 1.20 -Vector3 RayHit::calc_tangent() const 1.21 +Vec3 RayHit::calc_tangent() const 1.22 { 1.23 assert(obj->get_type() == ObjType::geom); 1.24 - Vector3 tang = ((const GeomObject*)obj)->calc_tangent(*this); 1.25 + Vec3 tang = ((const GeomObject*)obj)->calc_tangent(*this); 1.26 1.27 - const Matrix4x4 &xform = node->get_matrix(); 1.28 - return tang.transformed(Matrix3x3(xform).transposed()); 1.29 + const Mat4x4 &xform = node->get_matrix(); 1.30 + return tang.transformed(Mat3x3(xform).transposed()); 1.31 } 1.32 1.33 -Vector2 RayHit::calc_texcoords() const 1.34 +Vec2 RayHit::calc_texcoords() const 1.35 { 1.36 assert(obj->get_type() == ObjType::geom); 1.37 return ((const GeomObject*)obj)->calc_texcoords(*this);