goat3d

diff src/goat3d.cc @ 88:7941e89798e5

selections
author John Tsiombikas <nuclear@member.fsf.org>
date Thu, 15 May 2014 06:52:01 +0300
parents f0277d348c2c
children da100bf13f7f
line diff
     1.1 --- a/src/goat3d.cc	Wed May 14 18:28:38 2014 +0300
     1.2 +++ b/src/goat3d.cc	Thu May 15 06:52:01 2014 +0300
     1.3 @@ -676,6 +676,17 @@
     1.4  	im_use[GOAT3D_MESH_ATTR_COLOR] = true;
     1.5  }
     1.6  
     1.7 +
     1.8 +GOAT3DAPI void goat3d_get_mesh_bounds(const struct goat3d_mesh *mesh, float *bmin, float *bmax)
     1.9 +{
    1.10 +	AABox box = mesh->get_bounds(Matrix4x4::identity);
    1.11 +
    1.12 +	for(int i=0; i<3; i++) {
    1.13 +		bmin[i] = box.bmin[i];
    1.14 +		bmax[i] = box.bmax[i];
    1.15 +	}
    1.16 +}
    1.17 +
    1.18  /* lights */
    1.19  GOAT3DAPI void goat3d_add_light(struct goat3d *g, struct goat3d_light *lt)
    1.20  {
    1.21 @@ -934,6 +945,15 @@
    1.22  	node->get_node_xform(tmsec, (Matrix4x4*)matrix);
    1.23  }
    1.24  
    1.25 +GOAT3DAPI void goat3d_get_node_bounds(const struct goat3d_node *node, float *bmin, float *bmax)
    1.26 +{
    1.27 +	AABox box = node->get_bounds();
    1.28 +
    1.29 +	for(int i=0; i<3; i++) {
    1.30 +		bmin[i] = box.bmin[i];
    1.31 +		bmax[i] = box.bmax[i];
    1.32 +	}
    1.33 +}
    1.34  
    1.35  }	// extern "C"
    1.36