Table of Contents

Method b3DynamicTree_QueryClosest

Namespace
Box3D.Native
Assembly
Box3D.NET.Native.dll

b3DynamicTree_QueryClosest(b3DynamicTree*, Vector3, ulong, NativeBool, delegate* unmanaged[Cdecl]<float, int, ulong, void*, float>, void*, float*)

Query an AABB for the closest object. The callback function is called for each proxy that might be closest to the supplied point.

public static extern b3TreeStats b3DynamicTree_QueryClosest(b3DynamicTree* tree, Vector3 point, ulong maskBits, NativeBool requireAllBits, delegate* unmanaged[Cdecl]<float, int, ulong, void*, float> callback, void* context, float* minDistanceSqr)

Parameters

tree b3DynamicTree*

the dynamic tree to query

point Vector3

the query point

maskBits ulong

nodes are skipped if the bit-wise AND with the node category bits is zero

requireAllBits NativeBool

nodes are skipped if the bit-wise AND with the node category bits does not equal the maskBits

callback delegate* unmanaged[Cdecl]<float, int, ulong, void*, float>

a user provided instance of b3TreeQueryClosestCallbackFcn

context void*

a user context object that is provided to the callback

minDistanceSqr float*

the initial and final minimum squared distance. Provide a small initial to restrict the search and improve performance. If the value is large this query has performance that scales linearly with the number of proxies and would be slower than a brute force search.

Returns

b3TreeStats

performance data