|
HDK
|
#include <GEO_ImplicitBasicSurface.h>
Public Member Functions | |
| GEO_ImplicitBasicSurface ()=default | |
| GEO_ImplicitBasicSurface (const char *name, const VEXvec3< PREC > &P, const VEXmat3< PREC > &transform, const VEXvec4< PREC > &shapevals) | |
| VEXfloat< PREC > | eval (const VEXvec3< PREC > &P) const |
| Evaluate SDF at point P (world space) More... | |
| VEXfloat< PREC > | eval (const VEXvec3< PREC > &P, VEXvec3< PREC > &grad) const |
| Evaluate SDF with spatial gradient. More... | |
| VEXfloat< PREC > | eval (const VEXvec3< PREC > &P, VEXvec3< PREC > &grad, UT_Vector4T< VEXfloat< PREC >> &parms_grad) const |
| Evaluate SDF with spatial and parameter gradients. More... | |
| template<bool WantGrad, bool WantParmGrad> | |
| void | evalBatched (int npts, const VEXvec3< PREC > *P, VEXfloat< PREC > *sdf, VEXvec3< PREC > *grad, UT_Vector4T< VEXfloat< PREC >> *parms_grad) const |
| Batched evaluation helper with compile-time output control. More... | |
| UT_IntervalT< VEXfloat< PREC > > | evalInterval (const UT_BoundingBoxT< VEXfloat< PREC >> &P) const |
| Evaluate SDF bounds for interval box (world space) More... | |
| UT_IntervalT< VEXfloat< PREC > > | evalInterval (const VEXvec3< PREC > ¢er, VEXfloat< PREC > radius) const |
| VEXfloat< PREC > | operator() (const VEXvec3< PREC > &P) const |
| Operator() overloads. More... | |
| VEXfloat< PREC > | operator() (const VEXvec3< PREC > &P, VEXvec3< PREC > &grad) const |
| VEXfloat< PREC > | operator() (const VEXvec3< PREC > &P, VEXvec3< PREC > &grad, UT_Vector4T< VEXfloat< PREC >> &parms_grad) const |
| UT_IntervalT< VEXfloat< PREC > > | operator() (const UT_BoundingBoxT< VEXfloat< PREC >> &P) const |
| UT_IntervalT< VEXfloat< PREC > > | operator() (const VEXvec3< PREC > ¢er, VEXfloat< PREC > radius) const |
| void | scale (VEXfloat< PREC > s) |
| Scale all distance-valued parameters by uniform factor. More... | |
| VEXvec3< PREC > | worldToLocal (const VEXvec3< PREC > &P) const |
| Transform world point to local reference frame. More... | |
| VEXvec3< PREC > | localToWorld (const VEXvec3< PREC > &P) const |
| Transform point from reference frame to world space. More... | |
| VEXvec3< PREC > | worldToLocalVec (const VEXvec3< PREC > &vec) const |
| Transform local gradient to world space. More... | |
| VEXvec3< PREC > | localToWorldVec (const VEXvec3< PREC > &vec) const |
| Transform local gradient to world space. More... | |
| UT_BoundingBoxT< VEXfloat< PREC > > | worldToLocalInterval (const UT_BoundingBoxT< VEXfloat< PREC >> &P) const |
| Transform world interval box to local reference frame. More... | |
Static Public Member Functions | |
| static GEO_ImplicitShapeID | shapeNameToID (const char *name) |
| Convert shape name string to ID. More... | |
| static const char * | shapeIDToName (GEO_ImplicitShapeID id) |
| Convert shape ID to name string. More... | |
Public Attributes | |
| VEXvec3< PREC > | myPos = {0, 0, 0} |
| Position of the shape in world space. More... | |
| VEXmat3< PREC > | myTransform = {1,0,0, 0,1,0, 0,0,1} |
| UT_Vector4T< VEXfloat< PREC > > | myParms = {1, 1, 1, 0} |
| Parameters describing the shape. More... | |
| GEO_ImplicitShapeID | myId = GEO_ImplicitShapeID::Empty |
Basic Implicit Surface - unified wrapper for elementary implicit surfaces. This class stores transform (position, orientation) and shape parameters, dispatching to the appropriate SDF based on shape ID.
Typically initialized from geometry point attributes: P, orient, shape_parms, shape_id, shape_invert
Definition at line 59 of file GEO_ImplicitBasicSurface.h.
|
default |
| GEO_ImplicitBasicSurface< PREC >::GEO_ImplicitBasicSurface | ( | const char * | name, |
| const VEXvec3< PREC > & | P, | ||
| const VEXmat3< PREC > & | transform, | ||
| const VEXvec4< PREC > & | shapevals | ||
| ) |
Make basic shape fron its name, position, transform and parameters
The transform does not have to be rotation matrix. Scales are extracted and applied to parameters Any shearing or non-uniform scaling is ignored
| VEXfloat<PREC> GEO_ImplicitBasicSurface< PREC >::eval | ( | const VEXvec3< PREC > & | P | ) | const |
Evaluate SDF at point P (world space)
| VEXfloat<PREC> GEO_ImplicitBasicSurface< PREC >::eval | ( | const VEXvec3< PREC > & | P, |
| VEXvec3< PREC > & | grad | ||
| ) | const |
Evaluate SDF with spatial gradient.
| VEXfloat<PREC> GEO_ImplicitBasicSurface< PREC >::eval | ( | const VEXvec3< PREC > & | P, |
| VEXvec3< PREC > & | grad, | ||
| UT_Vector4T< VEXfloat< PREC >> & | parms_grad | ||
| ) | const |
Evaluate SDF with spatial and parameter gradients.
| void GEO_ImplicitBasicSurface< PREC >::evalBatched | ( | int | npts, |
| const VEXvec3< PREC > * | P, | ||
| VEXfloat< PREC > * | sdf, | ||
| VEXvec3< PREC > * | grad, | ||
| UT_Vector4T< VEXfloat< PREC >> * | parms_grad | ||
| ) | const |
Batched evaluation helper with compile-time output control.
| UT_IntervalT<VEXfloat<PREC> > GEO_ImplicitBasicSurface< PREC >::evalInterval | ( | const UT_BoundingBoxT< VEXfloat< PREC >> & | P | ) | const |
Evaluate SDF bounds for interval box (world space)
| UT_IntervalT<VEXfloat<PREC> > GEO_ImplicitBasicSurface< PREC >::evalInterval | ( | const VEXvec3< PREC > & | center, |
| VEXfloat< PREC > | radius | ||
| ) | const |
Evaluate SDF bounds for bounding sphere (world space). Cheaper than evalInterval when P comes from a rotated region, since transforming a sphere to local space only rotates the center.
| VEXvec3<PREC> GEO_ImplicitBasicSurface< PREC >::localToWorld | ( | const VEXvec3< PREC > & | P | ) | const |
Transform point from reference frame to world space.
| VEXvec3<PREC> GEO_ImplicitBasicSurface< PREC >::localToWorldVec | ( | const VEXvec3< PREC > & | vec | ) | const |
Transform local gradient to world space.
|
inline |
Operator() overloads.
Definition at line 112 of file GEO_ImplicitBasicSurface.h.
|
inline |
Definition at line 116 of file GEO_ImplicitBasicSurface.h.
|
inline |
Definition at line 120 of file GEO_ImplicitBasicSurface.h.
|
inline |
Definition at line 125 of file GEO_ImplicitBasicSurface.h.
|
inline |
Definition at line 130 of file GEO_ImplicitBasicSurface.h.
|
inline |
Scale all distance-valued parameters by uniform factor.
Definition at line 141 of file GEO_ImplicitBasicSurface.h.
|
static |
Convert shape ID to name string.
|
static |
Convert shape name string to ID.
| VEXvec3<PREC> GEO_ImplicitBasicSurface< PREC >::worldToLocal | ( | const VEXvec3< PREC > & | P | ) | const |
Transform world point to local reference frame.
| UT_BoundingBoxT<VEXfloat<PREC> > GEO_ImplicitBasicSurface< PREC >::worldToLocalInterval | ( | const UT_BoundingBoxT< VEXfloat< PREC >> & | P | ) | const |
Transform world interval box to local reference frame.
| VEXvec3<PREC> GEO_ImplicitBasicSurface< PREC >::worldToLocalVec | ( | const VEXvec3< PREC > & | vec | ) | const |
Transform local gradient to world space.
| GEO_ImplicitShapeID GEO_ImplicitBasicSurface< PREC >::myId = GEO_ImplicitShapeID::Empty |
Definition at line 69 of file GEO_ImplicitBasicSurface.h.
| UT_Vector4T<VEXfloat<PREC> > GEO_ImplicitBasicSurface< PREC >::myParms = {1, 1, 1, 0} |
Parameters describing the shape.
Definition at line 68 of file GEO_ImplicitBasicSurface.h.
| VEXvec3<PREC> GEO_ImplicitBasicSurface< PREC >::myPos = {0, 0, 0} |
Position of the shape in world space.
Definition at line 63 of file GEO_ImplicitBasicSurface.h.
| VEXmat3<PREC> GEO_ImplicitBasicSurface< PREC >::myTransform = {1,0,0, 0,1,0, 0,0,1} |
Rotation matrix from reference frame to world space It is assumed that this matrix is rotation!
Definition at line 66 of file GEO_ImplicitBasicSurface.h.