erebus

diff liberebus/src/snode.cc @ 3:a932848de652

foo
author John Tsiombikas <nuclear@member.fsf.org>
date Mon, 28 Apr 2014 15:44:59 +0300
parents 59a72293f9bd
children 93894c232d65
line diff
     1.1 --- a/liberebus/src/snode.cc	Mon Apr 28 06:31:10 2014 +0300
     1.2 +++ b/liberebus/src/snode.cc	Mon Apr 28 15:44:59 2014 +0300
     1.3 @@ -84,12 +84,15 @@
     1.4  
     1.5  void SceneNode::update_node(long msec)
     1.6  {
     1.7 -	node_xform.reset_identity();
     1.8 -	node_xform.translate(pos);
     1.9 -	node_xform.rotate(rot);
    1.10 -	node_xform.scale(scale);
    1.11 +	xform.reset_identity();
    1.12 +	xform.translate(pos);
    1.13 +	xform.rotate(rot);
    1.14 +	xform.scale(scale);
    1.15  
    1.16 -	xform = parent ? parent->xform * node_xform : node_xform;
    1.17 +	if(parent) {
    1.18 +		xform = parent->xform * xform;
    1.19 +	}
    1.20 +	inv_xform = xform.inverse();
    1.21  }
    1.22  
    1.23  void SceneNode::update(long msec)
    1.24 @@ -104,4 +107,5 @@
    1.25  
    1.26  bool SceneNode::intersect(const Ray &ray, RayHit *hit) const
    1.27  {
    1.28 +	Ray local_ray = ray.transformed(inv_xform);
    1.29  }
    1.30 \ No newline at end of file