You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The geom:: namespace seems to have a pretty complete listing of GPU representations of shapes, but there's very few of the corresponding classes in the ci:: namespace. There's ci::Rect<T>, ci::Sphere, and ci::AxisAlignedBox, and I'm not sure there's much else...
For 2D Shapes it'd be great if they had a similar interface to Rect:
and for 3D Shapes if they followed the Sphere interface:
bool intersects( const AxisAlignedBox &box ) const;
bool intersects( const Ray &ray ) const;
int intersect( const Ray &ray, float *intersection ) const;
int intersect( const Ray &ray, float *min, float *max ) const;
vec3 closestPoint( const Ray &ray ) const;
Sphere transformed( const mat4 &transform ) const;
I'm imagining that these would be useful for hit-testing in various applications, where perhaps you don't want an entire physics system just to figure out if objects overlap / intersect / contain a point.
Based off of some threads I've read here, it seems that other primitives are missing mostly because they haven't been a priority / need for anyone yet, not because anyone is against them existing -- if this is correct, then I may go ahead and build a few for a current project and add them.
It'd be great to collate thoughts on what the consistent interface might be across multiples of these objects (and if perhaps they should inherit from a parent class that defines this interface?).
A preliminary list of ideas:
2D Shapes
ci::Circle
ci::RotatedRect
ci::Triangle
3D Shapes
ci::Box
ci::Capsule
ci::Cylinder
The text was updated successfully, but these errors were encountered:
The
geom::
namespace seems to have a pretty complete listing of GPU representations of shapes, but there's very few of the corresponding classes in theci::
namespace. There'sci::Rect<T>
,ci::Sphere
, andci::AxisAlignedBox
, and I'm not sure there's much else...For 2D Shapes it'd be great if they had a similar interface to
Rect
:and for 3D Shapes if they followed the
Sphere
interface:I'm imagining that these would be useful for hit-testing in various applications, where perhaps you don't want an entire physics system just to figure out if objects overlap / intersect / contain a point.
Based off of some threads I've read here, it seems that other primitives are missing mostly because they haven't been a priority / need for anyone yet, not because anyone is against them existing -- if this is correct, then I may go ahead and build a few for a current project and add them.
It'd be great to collate thoughts on what the consistent interface might be across multiples of these objects (and if perhaps they should inherit from a parent class that defines this interface?).
A preliminary list of ideas:
2D Shapes
3D Shapes
The text was updated successfully, but these errors were encountered: