| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Box3D.DynamicTree
Synopsis
- create :: Int -> Ptr DynamicTree -> IO ()
- destroy :: Ptr DynamicTree -> IO ()
- createProxy :: Ptr DynamicTree -> AABB -> Word64 -> Word64 -> IO Int
- destroyProxy :: Ptr DynamicTree -> Int -> IO ()
- moveProxy :: Ptr DynamicTree -> Int -> AABB -> IO ()
- enlargeProxy :: Ptr DynamicTree -> Int -> AABB -> IO ()
- setCategoryBits :: Ptr DynamicTree -> Int -> Word64 -> IO ()
- getCategoryBits :: Ptr DynamicTree -> Int -> IO Word64
- query :: Ptr DynamicTree -> AABB -> Word64 -> Bool -> FunPtr TreeQueryCallbackFcn -> Ptr () -> IO TreeStats
- queryClosest :: Ptr DynamicTree -> Vec3 -> Word64 -> Bool -> FunPtr TreeQueryClosestCallbackFcn -> Ptr () -> Ptr Float -> IO TreeStats
- rayCast :: Ptr DynamicTree -> RayCastInput -> Word64 -> Bool -> FunPtr TreeRayCastCallbackFcn -> Ptr () -> IO TreeStats
- boxCast :: Ptr DynamicTree -> Ptr BoxCastInput -> Word64 -> Bool -> FunPtr TreeBoxCastCallbackFcn -> Ptr () -> IO TreeStats
- boxCastInto :: Ptr DynamicTree -> Ptr BoxCastInput -> Word64 -> Bool -> FunPtr TreeBoxCastCallbackFcn -> Ptr () -> Ptr TreeStats -> IO ()
- validate :: Ptr DynamicTree -> IO ()
- getHeight :: Ptr DynamicTree -> IO Int
- getAreaRatio :: Ptr DynamicTree -> IO Float
- getRootBounds :: Ptr DynamicTree -> IO AABB
- getRootBoundsInto :: Ptr DynamicTree -> Ptr AABB -> IO ()
- getProxyCount :: Ptr DynamicTree -> IO Int
- rebuild :: Ptr DynamicTree -> Bool -> IO Int
- getByteCount :: Ptr DynamicTree -> IO Int
- validateNoEnlarged :: Ptr DynamicTree -> IO ()
- save :: Ptr DynamicTree -> CString -> IO ()
- load :: CString -> Float -> Ptr DynamicTree -> IO ()
Documentation
Arguments
| :: Int | proxyCapacity |
| -> Ptr DynamicTree | Result buffer. |
| -> IO () |
Constructing the tree initializes the node pool.
Binds b3DynamicTree_Create.
destroy :: Ptr DynamicTree -> IO () Source #
Destroy the tree, freeing the node pool.
Binds b3DynamicTree_Destroy.
Create a proxy. Provide an AABB and a userData value.
Binds b3DynamicTree_CreateProxy.
Arguments
| :: Ptr DynamicTree | |
| -> Int | proxyId |
| -> IO () |
Destroy a proxy. This asserts if the id is invalid.
Binds b3DynamicTree_DestroyProxy.
Arguments
| :: Ptr DynamicTree | |
| -> Int | proxyId |
| -> AABB | |
| -> IO () |
Move a proxy to a new AABB by removing and reinserting into the tree.
Binds b3DynamicTree_MoveProxy.
Arguments
| :: Ptr DynamicTree | |
| -> Int | proxyId |
| -> AABB | |
| -> IO () |
Enlarge a proxy and enlarge ancestors as necessary.
Binds b3DynamicTree_EnlargeProxy.
Arguments
| :: Ptr DynamicTree | |
| -> Int | proxyId |
| -> Word64 | categoryBits |
| -> IO () |
Modify the category bits on a proxy. This is an expensive operation.
Binds b3DynamicTree_SetCategoryBits.
Arguments
| :: Ptr DynamicTree | |
| -> Int | proxyId |
| -> IO Word64 |
Get the category bits on a proxy.
Binds b3DynamicTree_GetCategoryBits.
Arguments
| :: Ptr DynamicTree | |
| -> AABB | |
| -> Word64 | maskBits |
| -> Bool | requireAllBits |
| -> FunPtr TreeQueryCallbackFcn | |
| -> Ptr () | context |
| -> IO TreeStats |
Query an AABB for overlapping proxies. The callback function is called for each proxy that overlaps the supplied AABB.
Returns: performance data
Binds b3DynamicTree_Query.
Arguments
| :: Ptr DynamicTree |
|
| -> Vec3 |
|
| -> Word64 |
|
| -> Bool |
|
| -> FunPtr TreeQueryClosestCallbackFcn |
|
| -> Ptr () |
|
| -> Ptr Float |
|
| -> IO TreeStats |
Query an AABB for the closest object. The callback function is called for each proxy that might be closest to the supplied point.
Returns: performance data
Binds b3DynamicTree_QueryClosest.
Arguments
| :: Ptr DynamicTree |
|
| -> RayCastInput |
|
| -> Word64 |
|
| -> Bool |
|
| -> FunPtr TreeRayCastCallbackFcn |
|
| -> Ptr () |
|
| -> IO TreeStats |
Ray cast against the proxies in the tree. This relies on the callback to perform an exact ray cast in the case where the proxy contains a shape. The callback also performs any collision filtering. This has performance roughly equal to k * log(n), where k is the number of collisions and n is the number of proxies in the tree. Bit-wise filtering using mask bits can greatly improve performance in some scenarios. However, this filtering may be approximate, so the user should still apply filtering to results.
Returns: performance data
Binds b3DynamicTree_RayCast.
Arguments
| :: Ptr DynamicTree | |
| -> Ptr BoxCastInput | |
| -> Word64 | maskBits |
| -> Bool | requireAllBits |
| -> FunPtr TreeBoxCastCallbackFcn | |
| -> Ptr () | context |
| -> IO TreeStats |
Sweep an AABB through the tree. The box is in the tree's world float frame and the callback re-differences each shape at full precision against the query origin. Used by the large world spatial queries so the tree traversal stays float while the narrow phase stays precise.
Binds b3DynamicTree_BoxCast.
Arguments
| :: Ptr DynamicTree | |
| -> Ptr BoxCastInput | |
| -> Word64 | maskBits |
| -> Bool | requireAllBits |
| -> FunPtr TreeBoxCastCallbackFcn | |
| -> Ptr () | context |
| -> Ptr TreeStats | Result buffer. |
| -> IO () |
Like boxCast, but the result is written into a caller-supplied buffer.
validate :: Ptr DynamicTree -> IO () Source #
Validate this tree. For testing.
Binds b3DynamicTree_Validate.
getHeight :: Ptr DynamicTree -> IO Int Source #
Get the height of the binary tree.
Binds b3DynamicTree_GetHeight.
getAreaRatio :: Ptr DynamicTree -> IO Float Source #
Get the ratio of the sum of the node areas to the root area.
Binds b3DynamicTree_GetAreaRatio.
getRootBounds :: Ptr DynamicTree -> IO AABB Source #
Get the bounding box that contains the entire tree
Binds b3DynamicTree_GetRootBounds.
Arguments
| :: Ptr DynamicTree | |
| -> Ptr AABB | Result buffer. |
| -> IO () |
Like getRootBounds, but the result is written into a caller-supplied buffer.
getProxyCount :: Ptr DynamicTree -> IO Int Source #
Get the number of proxies created
Binds b3DynamicTree_GetProxyCount.
Arguments
| :: Ptr DynamicTree | |
| -> Bool | fullBuild |
| -> IO Int |
Rebuild the tree while retaining subtrees that haven't changed. Returns the number of boxes sorted.
Binds b3DynamicTree_Rebuild.
getByteCount :: Ptr DynamicTree -> IO Int Source #
Get the number of bytes used by this tree
Binds b3DynamicTree_GetByteCount.
validateNoEnlarged :: Ptr DynamicTree -> IO () Source #
Validate this tree has no enlarged AABBs. For testing.
Binds b3DynamicTree_ValidateNoEnlarged.
Arguments
| :: Ptr DynamicTree | |
| -> CString | fileName |
| -> IO () |
Save this tree to a file for debugging
Binds b3DynamicTree_Save.