@@ -192,7 +192,7 @@ B2_API b2Polygon b2MakeBox( float hx, float hy );
192
192
B2_API b2Polygon b2MakeRoundedBox ( float hx , float hy , float radius );
193
193
194
194
/// Make an offset box, bypassing the need for a convex hull.
195
- B2_API b2Polygon b2MakeOffsetBox ( float hx , float hy , b2Vec2 center , float angle );
195
+ B2_API b2Polygon b2MakeOffsetBox ( float hx , float hy , b2Vec2 center , b2Rot rotation );
196
196
197
197
/// Transform a polygon. This is useful for transferring a shape from one body to another.
198
198
B2_API b2Polygon b2TransformPolygon ( b2Transform transform , const b2Polygon * polygon );
@@ -589,21 +589,20 @@ B2_API b2Manifold b2CollideSmoothSegmentAndPolygon( const b2SmoothSegment* smoot
589
589
*/
590
590
591
591
/// The default category bit for a tree proxy. Used for collision filtering.
592
- #define b2_defaultCategoryBits ( 0x00000001 )
592
+ #define b2_defaultCategoryBits ( 1 )
593
593
594
594
/// Convenience mask bits to use when you don't need collision filtering and just want
595
595
/// all results.
596
- #define b2_defaultMaskBits ( 0xFFFFFFFF )
596
+ #define b2_defaultMaskBits ( UINT64_MAX )
597
597
598
598
/// A node in the dynamic tree. This is private data placed here for performance reasons.
599
- /// 16 + 16 + 8 + pad(8)
600
599
typedef struct b2TreeNode
601
600
{
602
601
/// The node bounding box
603
602
b2AABB aabb ; // 16
604
603
605
604
/// Category bits for collision filtering
606
- uint32_t categoryBits ; // 4
605
+ uint64_t categoryBits ; // 8
607
606
608
607
union
609
608
{
@@ -631,7 +630,7 @@ typedef struct b2TreeNode
631
630
bool enlarged ; // 1
632
631
633
632
/// Padding for clarity
634
- char pad [9 ];
633
+ char pad [5 ];
635
634
} b2TreeNode ;
636
635
637
636
/// The dynamic tree structure. This should be considered private data.
@@ -679,7 +678,7 @@ B2_API b2DynamicTree b2DynamicTree_Create( void );
679
678
B2_API void b2DynamicTree_Destroy ( b2DynamicTree * tree );
680
679
681
680
/// Create a proxy. Provide an AABB and a userData value.
682
- B2_API int32_t b2DynamicTree_CreateProxy ( b2DynamicTree * tree , b2AABB aabb , uint32_t categoryBits , int32_t userData );
681
+ B2_API int32_t b2DynamicTree_CreateProxy ( b2DynamicTree * tree , b2AABB aabb , uint64_t categoryBits , int32_t userData );
683
682
684
683
/// Destroy a proxy. This asserts if the id is invalid.
685
684
B2_API void b2DynamicTree_DestroyProxy ( b2DynamicTree * tree , int32_t proxyId );
@@ -694,9 +693,8 @@ B2_API void b2DynamicTree_EnlargeProxy( b2DynamicTree* tree, int32_t proxyId, b2
694
693
/// @return true if the query should continue
695
694
typedef bool b2TreeQueryCallbackFcn ( int32_t proxyId , int32_t userData , void * context );
696
695
697
- /// Query an AABB for overlapping proxies. The callback class
698
- /// is called for each proxy that overlaps the supplied AABB.
699
- B2_API void b2DynamicTree_Query ( const b2DynamicTree * tree , b2AABB aabb , uint32_t maskBits , b2TreeQueryCallbackFcn * callback ,
696
+ /// Query an AABB for overlapping proxies. The callback class is called for each proxy that overlaps the supplied AABB.
697
+ B2_API void b2DynamicTree_Query ( const b2DynamicTree * tree , b2AABB aabb , uint64_t maskBits , b2TreeQueryCallbackFcn * callback ,
700
698
void * context );
701
699
702
700
/// This function receives clipped raycast input for a proxy. The function
@@ -717,7 +715,7 @@ typedef float b2TreeRayCastCallbackFcn( const b2RayCastInput* input, int32_t pro
717
715
/// @param maskBits filter bits: `bool accept = (maskBits & node->categoryBits) != 0;`
718
716
/// @param callback a callback class that is called for each proxy that is hit by the ray
719
717
/// @param context user context that is passed to the callback
720
- B2_API void b2DynamicTree_RayCast ( const b2DynamicTree * tree , const b2RayCastInput * input , uint32_t maskBits ,
718
+ B2_API void b2DynamicTree_RayCast ( const b2DynamicTree * tree , const b2RayCastInput * input , uint64_t maskBits ,
721
719
b2TreeRayCastCallbackFcn * callback , void * context );
722
720
723
721
/// This function receives clipped ray-cast input for a proxy. The function
@@ -737,7 +735,7 @@ typedef float b2TreeShapeCastCallbackFcn( const b2ShapeCastInput* input, int32_t
737
735
/// @param maskBits filter bits: `bool accept = (maskBits & node->categoryBits) != 0;`
738
736
/// @param callback a callback class that is called for each proxy that is hit by the shape
739
737
/// @param context user context that is passed to the callback
740
- B2_API void b2DynamicTree_ShapeCast ( const b2DynamicTree * tree , const b2ShapeCastInput * input , uint32_t maskBits ,
738
+ B2_API void b2DynamicTree_ShapeCast ( const b2DynamicTree * tree , const b2ShapeCastInput * input , uint64_t maskBits ,
741
739
b2TreeShapeCastCallbackFcn * callback , void * context );
742
740
743
741
/// Validate this tree. For testing.
0 commit comments