erebus

diff liberebus/src/object.cc @ 2:474a0244f57d

fixed specialization mistake fixed line endings added makefiles
author John Tsiombikas <nuclear@member.fsf.org>
date Mon, 28 Apr 2014 06:31:10 +0300
parents 4abdce1361b9
children a932848de652
line diff
     1.1 --- a/liberebus/src/object.cc	Mon Apr 28 05:58:22 2014 +0300
     1.2 +++ b/liberebus/src/object.cc	Mon Apr 28 06:31:10 2014 +0300
     1.3 @@ -1,60 +1,60 @@
     1.4 -#include "object.h"
     1.5 -
     1.6 -Object::Object()
     1.7 -{
     1.8 -	name = "<unnamed>";
     1.9 -	inv_xform_valid = false;
    1.10 -}
    1.11 -
    1.12 -ObjType Object::get_type() const
    1.13 -{
    1.14 -	return ObjType::null;
    1.15 -}
    1.16 -
    1.17 -void Object::set_name(const char *name)
    1.18 -{
    1.19 -	this->name = name;
    1.20 -}
    1.21 -
    1.22 -const char *Object::get_name() const
    1.23 -{
    1.24 -	return name.c_str();
    1.25 -}
    1.26 -
    1.27 -void Object::set_xform(const Matrix4x4 &mat)
    1.28 -{
    1.29 -	xform = mat;
    1.30 -	inv_xform_valid = false;
    1.31 -}
    1.32 -
    1.33 -void Object::set_xform(const Matrix4x4 &mat, const Matrix4x4 &inv_mat)
    1.34 -{
    1.35 -	xform = mat;
    1.36 -	inv_xform = inv_mat;
    1.37 -	inv_xform_valid = true;
    1.38 -}
    1.39 -
    1.40 -Matrix4x4 &Object::get_xform()
    1.41 -{
    1.42 -	inv_xform_valid = false;
    1.43 -	return xform;
    1.44 -}
    1.45 -
    1.46 -const Matrix4x4 &Object::get_xform() const
    1.47 -{
    1.48 -	return xform;
    1.49 -}
    1.50 -
    1.51 -const Matrix4x4 &Object::get_inv_xform() const
    1.52 -{
    1.53 -	if(!inv_xform_valid) {
    1.54 -		inv_xform = xform.inverse();
    1.55 -		inv_xform_valid = true;
    1.56 -	}
    1.57 -	return inv_xform;
    1.58 -}
    1.59 -
    1.60 -bool Object::intersect(const Ray &ray, RayHit *hit) const
    1.61 -{
    1.62 -	return false;
    1.63 -}
    1.64 \ No newline at end of file
    1.65 +#include "object.h"
    1.66 +
    1.67 +Object::Object()
    1.68 +{
    1.69 +	name = "<unnamed>";
    1.70 +	inv_xform_valid = false;
    1.71 +}
    1.72 +
    1.73 +ObjType Object::get_type() const
    1.74 +{
    1.75 +	return ObjType::null;
    1.76 +}
    1.77 +
    1.78 +void Object::set_name(const char *name)
    1.79 +{
    1.80 +	this->name = name;
    1.81 +}
    1.82 +
    1.83 +const char *Object::get_name() const
    1.84 +{
    1.85 +	return name.c_str();
    1.86 +}
    1.87 +
    1.88 +void Object::set_xform(const Matrix4x4 &mat)
    1.89 +{
    1.90 +	xform = mat;
    1.91 +	inv_xform_valid = false;
    1.92 +}
    1.93 +
    1.94 +void Object::set_xform(const Matrix4x4 &mat, const Matrix4x4 &inv_mat)
    1.95 +{
    1.96 +	xform = mat;
    1.97 +	inv_xform = inv_mat;
    1.98 +	inv_xform_valid = true;
    1.99 +}
   1.100 +
   1.101 +Matrix4x4 &Object::get_xform()
   1.102 +{
   1.103 +	inv_xform_valid = false;
   1.104 +	return xform;
   1.105 +}
   1.106 +
   1.107 +const Matrix4x4 &Object::get_xform() const
   1.108 +{
   1.109 +	return xform;
   1.110 +}
   1.111 +
   1.112 +const Matrix4x4 &Object::get_inv_xform() const
   1.113 +{
   1.114 +	if(!inv_xform_valid) {
   1.115 +		inv_xform = xform.inverse();
   1.116 +		inv_xform_valid = true;
   1.117 +	}
   1.118 +	return inv_xform;
   1.119 +}
   1.120 +
   1.121 +bool Object::intersect(const Ray &ray, RayHit *hit) const
   1.122 +{
   1.123 +	return false;
   1.124 +}