goat3d

diff src/goat3d.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 ab66cdabf6f2
children 70b7c41a4f17
line diff
     1.1 --- a/src/goat3d.cc	Thu May 08 00:50:16 2014 +0300
     1.2 +++ b/src/goat3d.cc	Thu May 08 13:43:45 2014 +0300
     1.3 @@ -253,6 +253,15 @@
     1.4  	return &g->scn->get_ambient().x;
     1.5  }
     1.6  
     1.7 +GOAT3DAPI void goat3d_get_bounds(const struct goat3d *g, float *bmin, float *bmax)
     1.8 +{
     1.9 +	AABox bbox = g->scn->get_bounds();
    1.10 +	for(int i=0; i<3; i++) {
    1.11 +		bmin[i] = bbox.bmin[i];
    1.12 +		bmax[i] = bbox.bmax[i];
    1.13 +	}
    1.14 +}
    1.15 +
    1.16  // ---- materials ----
    1.17  GOAT3DAPI void goat3d_add_mtl(struct goat3d *g, struct goat3d_material *mtl)
    1.18  {