goat3d

diff src/node.cc @ 76:9785847d52d4

bounding boxes calculation (untested) and automatic camera placement in goatview
author John Tsiombikas <nuclear@member.fsf.org>
date Thu, 08 May 2014 13:43:45 +0300
parents 76dea247f75c
children
line diff
     1.1 --- a/src/node.cc	Thu May 08 00:50:16 2014 +0300
     1.2 +++ b/src/node.cc	Thu May 08 13:43:45 2014 +0300
     1.3 @@ -47,7 +47,9 @@
     1.4  const AABox &Node::get_bounds() const
     1.5  {
     1.6  	if(!bbox_valid) {
     1.7 -		bbox = obj ? obj->get_bounds() : AABox();
     1.8 +		Matrix4x4 xform;
     1.9 +		get_xform(0, &xform);
    1.10 +		bbox = obj ? obj->get_bounds(xform) : AABox();
    1.11  
    1.12  		for(int i=0; i<get_children_count(); i++) {
    1.13  			bbox = aabox_union(bbox, ((Node*)get_child(i))->get_bounds());