HDK
|
#include <GU_BVH.h>
Classes | |
class | gu_HeightIsect |
struct | Options |
Public Types | |
using | DataIdCombo = UT_SmallArray< GA_DataId, 32 > |
![]() | |
using | VectorType = typename SYS_SelectType< UT_Vector2, UT_Vector3, NAXES==3 >::type |
using | UintVectorType = typename SYS_SelectType< UT_FixedVector< uint, 2 >, UT_FixedVector< uint, 3 >, NAXES==3 >::type |
using | SingleBoxType = UT::Box< float, NAXES > |
using | BoxType = UT::Box< v4uf, NAXES > |
using | PosAttribType = GA_ROHandleT< VectorType > |
using | RadAttribType = GA_ROHandleF |
Public Member Functions | |
SYS_FORCE_INLINE | BVH () noexcept |
SYS_FORCE_INLINE | ~BVH () noexcept |
SYS_FORCE_INLINE GA_Offset | primitiveOffset (exint prim_index) const noexcept |
void | clear () noexcept |
SYS_FORCE_INLINE GA_Size | numItems () const noexcept |
GA_DataId | topologyId () const |
GA_DataId | primlistId () const |
const DataIdCombo & | primRangeIds () const |
void | init (const GEO_Detail &detail, const GA_ROHandleT< VectorType > &P, const Options &options, const GA_ROHandleF &pscale, const float radscale=1.0f, const bool force_rebalance=false, SecondaryTreeMap *secondary_trees=nullptr, SecondaryDetailMap *secondary_details=nullptr, UT_Lock *secondary_lock=nullptr) noexcept |
void | init (const GEO_Detail &detail, const GA_ROHandleT< VectorType > &P, const Options &options, const float radius=0.0f, const bool force_rebalance=false) noexcept |
NOTE: With this signature, radius is the point radius. More... | |
SYS_FORCE_INLINE bool | isNGon (exint index) const noexcept |
UT_Vector3 | findNGonUVW (exint index, const UT_Vector3 &position, const GEO_Detail &detail) const noexcept |
SYS_FORCE_INLINE bool | isPacked (exint index) const noexcept |
![]() | |
BVHBase () noexcept | |
~BVHBase () noexcept | |
SYS_FORCE_INLINE bool | isEmpty () const noexcept |
template<bool farthest = false, bool rm_backface = false, bool reverse = false, typename HitInfoType > | |
void | sendRay (const VectorType &origin, const VectorType &direction, HitInfoType &hit_info, float tmin=0, float tmax=std::numeric_limits< float >::max()) const noexcept |
template<bool farthest = false, bool rm_backface = false, bool reverse = false, typename HitInfoType > | |
void | sendRayRad (const VectorType &origin, const VectorType &direction, HitInfoType &hit_info, float default_radius, float tmin=0, float tmax=std::numeric_limits< float >::max()) const noexcept |
template<bool rm_backface = false, bool reverse = false, bool sort = true, typename HitInfoType > | |
void | sendRayAll (const VectorType &origin, const VectorType &direction, UT_Array< HitInfoType > &hit_info, UT_Array< exint > *nesting_temp_array=nullptr, float duplicate_tolerance=0, float tmin=0, float tmax=std::numeric_limits< float >::max()) const noexcept |
template<bool rm_backface = false, bool reverse = false, bool sort = true, typename HitInfoType > | |
void | sendRayAllRad (const VectorType &origin, const VectorType &direction, UT_Array< HitInfoType > &hit_info, float default_radius, UT_Array< exint > *nesting_temp_array=nullptr, float duplicate_tolerance=0, float tmin=0, float tmax=std::numeric_limits< float >::max()) const noexcept |
template<bool farthest, bool rm_backface, bool reverse, typename FUNCTOR > | |
void | sendRayGeneric (VectorType origin, VectorType direction, FUNCTOR &hit_info, float tmin=0, float tmax=std::numeric_limits< float >::max()) const noexcept |
void | findClosestToLine (VectorType origin, VectorType direction, const exint max_points, const float max_dist_squared, UT::BVHOrderedStack &output_queue) const noexcept |
Finds the closest points to the infinite line containing origin with direction direction . More... | |
void | findClosestToSegment (VectorType p0, VectorType p1, const exint max_points, const float max_dist_squared, UT::BVHOrderedStack &output_queue) const noexcept |
Finds the closest points to the line segment with endpoints p0 and p1 . More... | |
void | findClosestInCone (VectorType origin, VectorType direction, const float angle, const exint max_points, const float max_dist_squared, UT::BVHOrderedStack &output_queue) const noexcept |
template<bool farthest> | |
void | findClosest (VectorType origin, MinInfo &min_info, float max_dist_squared=std::numeric_limits< float >::max()) const noexcept |
void | getIntersectingBoxes (const SingleBoxType &query_box, UT_Array< exint > &box_indices) const noexcept |
SYS_FORCE_INLINE exint | numPoints () const noexcept |
SYS_FORCE_INLINE GA_Offset | pointOffset (exint item_index) const noexcept |
template<bool normalize = true> | |
VectorType | getGeometricNormal (const CommonHitInfo &hit_info) const noexcept |
void | getDerivs (const CommonHitInfo &hit_info, VectorType &dP_du, VectorType &dP_dv) const noexcept |
Fills in the values of dP/du and dP/dv for the hit surface. More... | |
template<GA_AttributeOwner owner, typename T , typename DEST_T > | |
bool | getAttribute (const CommonHitInfo &hit_info, const GA_ROHandleT< T > &attrib, const GEO_Detail &detail, DEST_T &value) const noexcept |
SingleBoxType | getBBox () const noexcept |
template<bool normalize> | |
BVHBase< NAXES, SUBCLASS > ::VectorType | getGeometricNormal (const CommonHitInfo &hit_info) const noexcept |
Protected Member Functions | |
template<bool farthest, bool rm_backface, bool reverse, typename FUNCTOR > | |
bool | intersectPrim (uint index, const VectorType &origin, const VectorType &direction, const VectorType &inverse_direction, int &max_dir, VectorType &N0, VectorType &N1, float &outer_tmax, float &outer_tmin, FUNCTOR &hit_info) const noexcept |
template<bool farthest> | |
void | closestPrim (uint index, const VectorType &origin, float &max_dist_squared, exint &hit_index, UT_Vector3 &hit_uvw, VectorType &hit_position, const UT_FixedVector< v4uf, NAXES > &vorigin, UT_Array< exint > *nesting_array, exint nesting_array_base) const noexcept |
template<bool normalize> | |
VectorType | primGeometricNormal (const CommonHitInfo &hit_info) const noexcept |
SYS_FORCE_INLINE void | primDerivs (const CommonHitInfo &hit_info, VectorType &dP_du, VectorType &dP_dv) const noexcept |
template<GA_AttributeOwner owner, typename T , typename DEST_T > | |
SYS_FORCE_INLINE bool | primAttribute (const CommonHitInfo &hit_info, const GA_ROHandleT< T > &attrib, const GEO_Detail &detail, DEST_T &value) const noexcept |
void | clearPrimDataAllocations () noexcept |
void | clearSecondary () noexcept |
![]() | |
void | clear () noexcept |
SYS_FORCE_INLINE SUBCLASS * | subclass () noexcept |
SYS_FORCE_INLINE const SUBCLASS * | subclass () const noexcept |
template<bool farthest, typename QUERY_POINT > | |
void | findMaximalPointsCommon (const QUERY_POINT &query_point, UT::BVHOrderedStack &stack, UT::BVHOrderedStack &output_queue, exint max_points, float max_dist_squared) const noexcept |
Static Protected Member Functions | |
template<bool farthest, bool rm_backface, bool reverse, bool bidirectional = false, typename FUNCTOR > | |
static SYS_FORCE_INLINE bool | intersectQuad (const UT_Vector3 &origin, const UT_Vector3 &inverse_direction, const UT_Vector3 pos[4], const int max_dir, const UT_Vector3 &N0, const UT_Vector3 &N1, const PrimData &prim_data, float &outer_tmin, float &outer_tmax, const uint index, FUNCTOR &hit_info) |
template<bool farthest, bool rm_backface, bool reverse, bool bidirectional = false, typename FUNCTOR > | |
static SYS_FORCE_INLINE bool | intersectTet (const UT_Vector3 &origin, const UT_Vector3 &inverse_direction, const UT_Vector3 pos[4], const PrimData &prim_data, float &outer_tmin, float &outer_tmax, const uint index, FUNCTOR &hit_info) |
template<bool farthest, bool rm_backface, bool reverse, typename FUNCTOR > | |
static SYS_FORCE_INLINE bool | intersectHex (const UT_Vector3 &origin, const UT_Vector3 &direction, const UT_Vector3 &inverse_direction, const UT_Vector3 pos[8], int &max_dir, UT_Vector3 &N0, UT_Vector3 &N1, const PrimData &prim_data, float &outer_tmin, float &outer_tmax, const uint index, FUNCTOR &hit_info) |
template<bool farthest> | |
static SYS_FORCE_INLINE bool | triClosestPoint (uint index, const VectorType &origin, const VectorType pos[3], const PrimData &prim_data, const UT_Vector3 &normal, float &max_dist_squared, exint &hit_index, UT_Vector3 &hit_uvw, UT_Vector3 &hit_position) |
template<bool farthest> | |
static SYS_FORCE_INLINE bool | quadClosestPoint (uint index, const VectorType &origin, const UT_FixedVector< v4uf, 3 > &vorigin, const VectorType pos[4], const PrimData &prim_data, float &max_dist_squared, exint &hit_index, UT_Vector3 &hit_uvw, UT_Vector3 &hit_position) |
static bool | hexClosestPoint (uint index, const VectorType &origin, const UT_FixedVector< v4uf, 3 > &vorigin, const VectorType pos[8], float &max_dist_squared, exint &hit_index, UT_Vector3 &hit_uvw, UT_Vector3 &hit_position) |
template<typename V3_ARRAY > | |
static SYS_FORCE_INLINE void | addTriangleData (GA_Offset *&tri_points, const V3_ARRAY &positions, const GA_ROHandleT< VectorType > &posattrib, PrimData *primdata, SingleBoxType *prim_box_start, exint &tri_primnum, GA_Offset primoff, int data_int=-1, float data_float=0) noexcept |
template<typename V3_ARRAY > | |
static SYS_FORCE_INLINE void | addQuadData (GA_Offset *&quad_points, const V3_ARRAY &positions, const GA_ROHandleT< VectorType > &posattrib, PrimData *primdata, SingleBoxType *prim_box_start, exint &quad_primnum, GA_Offset primoff, int data_int=-1, float data_float=0) noexcept |
static SYS_FORCE_INLINE void | addRayPrimInfo (PrimData &primdata, GA_Offset primoff, SingleBoxType &primbox, GU_RayPrimInfo *rayprim, exint &other_primnum, const GEO_Detail &detail, float w=0) noexcept |
Friends | |
class | ::GU_RayHeightFieldInfo |
Additional Inherited Members | |
![]() | |
static void | pointUVWToPolar (VectorType &uvw) noexcept |
![]() | |
using | NodeData = BoxType |
![]() | |
UT_BVH< BVH_N > | myTree |
UT_UniquePtr< BoxType[]> | myNodeBoxes |
UT_UniquePtr< UT_FixedVector < int32, BVH_N >[]> | myNodeNItems |
UT_Array< VectorType > | myPositions |
Positions for points. More... | |
UT_Array< float > | myRadii |
Radii for disconnected points. More... | |
PosAttribType | myPosAttrib |
RadAttribType | myRadAttrib |
GA_OffsetList | myPoints |
Disconnected points. More... | |
bool | myHasCurvesOrPoints |
GA_DataId | myPositionsDataId |
GA_DataId | myRadiiDataId |
![]() | |
static constexpr uint | BVH_N = 4 |
using GU::BVH::DataIdCombo = UT_SmallArray<GA_DataId, 32> |
Combination of data ids that together can be used to detect when an entity built from sources with those data ids has changed. GA_INVALID_DATAID entries are interpreted as an optional source being absent and should not be used for sources without a valid data id. Instead, use any empty array when any source does not have a valid data id.
|
inlinenoexcept |
|
inlinenoexcept |
|
staticprotectednoexcept |
|
staticprotectednoexcept |
|
staticprotectednoexcept |
|
noexcept |
|
protectednoexcept |
These are just used in the init function to change the decision about clearing after some things have been initialized.
|
protectednoexcept |
These are just used in the init function to change the decision about clearing after some things have been initialized.
|
protectednoexcept |
|
noexcept |
The UVWs returned for n-gons are for the sub-polygons, so we need to compute the true UVWs from the positions.
|
staticprotected |
|
noexcept |
NOTE: If options is different from what it was before, you must set force_rebalance to true. NOTE: With this signature, radscale scales the pscale attribute if it's a valid attribute, else it's the point radius.
|
inlinenoexcept |
|
staticprotected |
|
protectednoexcept |
|
staticprotected |
|
staticprotected |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
protectednoexcept |
|
protectednoexcept |
|
protectednoexcept |
|
inlinenoexcept |
|
inline |
|
staticprotected |
|
staticprotected |
|
friend |