X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=laserbrain_demo;a=blobdiff_plain;f=src%2Fgeom.h;h=f28f878c12c1d643df66f2239c90efead96fd5db;hp=24a0b864bb3692f168dd275bc9a20f029e33facd;hb=ad052fc67fe4e76d2f4a01b2381a738da1708cdb;hpb=215f16e2f26cc2acc79255bab06f13452ec06ae5 diff --git a/src/geom.h b/src/geom.h index 24a0b86..f28f878 100644 --- a/src/geom.h +++ b/src/geom.h @@ -76,7 +76,9 @@ public: Mat4 xform; Box(); + Box(const AABox &aabox, const Mat4 &xform); Box(const Vec3 &min, const Vec3 &max); + Box(const Vec3 &min, const Vec3 &max, const Mat4 &xform); Box(const Vec3 &pos, const Vec3 &vi, const Vec3 &vj, const Vec3 &vk); Box(const Vec3 *varr, int vcount); @@ -143,6 +145,9 @@ bool calc_bounding_aabox(AABox *box, const GeomObject **objv, int num); //! calculate the bounding axis-aligned box of multiple points, optionally transformed by `xform` bool calc_bounding_aabox(AABox *box, const Vec3 *v, int num, const Mat4 &xform = Mat4::identity); +//! calculate the bounding box of any object +bool calc_bounding_box(Box *box, const GeomObject *obj); + //! calculate the intersection plane of two spheres. false if there is no plane or infinite planes. bool intersect_sphere_sphere(Plane *result, const Sphere &a, const Sphere &b); //! calculate the intersection line of two planes. returns false if planes are exactly parallel.