Table of Contents

Class DynamicTree

Namespace
Jitter2.Collision
Assembly
Jitter2.dll

Represents a dynamic AABB tree for broadphase collision detection.

public class DynamicTree
Inheritance
DynamicTree
Inherited Members

Remarks

Uses a bounding volume hierarchy with Surface Area Heuristic (SAH) for efficient insertion and query operations. Supports incremental updates for moving objects.

Complexity: O(log n) for insertion/removal, O(n) worst-case for overlap queries.

Constructors

DynamicTree(Func<IDynamicTreeProxy, IDynamicTreeProxy, bool>)

Initializes a new instance of the DynamicTree class.

public DynamicTree(Func<IDynamicTreeProxy, IDynamicTreeProxy, bool> filter)

Parameters

filter Func<IDynamicTreeProxy, IDynamicTreeProxy, bool>

A collision filter function, used in Jitter to exclude collisions between Shapes belonging to the same body. The collision is filtered out if the function returns false.

Fields

ExpandEps

Specifies a small additional expansion of the bounding box which is constant.

public const float ExpandEps = 0.1

Field Value

float

ExpandFactor

Specifies the factor by which the bounding box in the dynamic tree structure is expanded. The expansion is calculated as Velocity * ExpandFactor * (1 + alpha), where alpha is a pseudo-random number in the range [0, 1).

public const float ExpandFactor = 0.1

Field Value

float

InitialSize

Initial capacity of the internal node array.

public const int InitialSize = 1024

Field Value

int

NullNode

Sentinel value indicating a null/invalid node index.

public const int NullNode = -1

Field Value

int

PruningFraction

Fraction of the potential pairs hash set to scan per update for pruning invalid entries. A value of 128 means 1/128th of the hash set is scanned each update.

public const int PruningFraction = 128

Field Value

int

Properties

DebugTimings

Contains timings for the stages of the last call to Update(bool, float). Values are in milliseconds. Index using (int)Timings.XYZ.

public ReadOnlySpan<double> DebugTimings { get; }

Property Value

ReadOnlySpan<double>

Filter

Gets or sets the filter function used to exclude proxy pairs from collision detection.

public Func<IDynamicTreeProxy, IDynamicTreeProxy, bool> Filter { get; set; }

Property Value

Func<IDynamicTreeProxy, IDynamicTreeProxy, bool>

Remarks

The filter is called during overlap enumeration. Return false to exclude a pair. In Jitter, this is typically used to exclude shapes belonging to the same rigid body.

Exceptions

ArgumentNullException

Thrown when the value is null.

HashSetInfo

Retrieve information of the size and filling of the internal hash set used to store potential overlaps.

public (int TotalSize, int Count) HashSetInfo { get; }

Property Value

(int solver, int relaxation)

Nodes

Read-only view of the internal tree nodes for debugging or visualization. Do not cache the returned span across tree operations.

public ReadOnlySpan<DynamicTree.Node> Nodes { get; }

Property Value

ReadOnlySpan<DynamicTree.Node>

Proxies

Gets a read-only view of all proxies registered with this tree.

public ReadOnlyPartitionedSet<IDynamicTreeProxy> Proxies { get; }

Property Value

ReadOnlyPartitionedSet<IDynamicTreeProxy>

Root

Gets the index of the root node, or NullNode if the tree is empty.

public int Root { get; }

Property Value

int

UpdatedProxyCount

Gets the number of updated proxies during the last call to Update(bool, float).

public int UpdatedProxyCount { get; }

Property Value

int

Methods

ActivateProxy<T>(T)

Marks a proxy as active, causing it to be tracked for movement during updates.

public void ActivateProxy<T>(T proxy) where T : class, IDynamicTreeProxy

Parameters

proxy T

The proxy to activate.

Type Parameters

T

The proxy type.

AddProxy<T>(T, bool)

Adds a proxy to the tree.

public void AddProxy<T>(T proxy, bool active = true) where T : class, IDynamicTreeProxy

Parameters

proxy T

The proxy to add.

active bool

If true, the proxy is tracked for movement each update.

Type Parameters

T

The proxy type.

Exceptions

InvalidOperationException

Thrown if the proxy is already in this tree.

CalculateCost()

Calculates the SAH cost of the tree (sum of all node surface areas).

public double CalculateCost()

Returns

double

The total cost. Lower values indicate a more balanced tree.

DeactivateProxy<T>(T)

Marks a proxy as inactive, assuming it will not move outside its expanded bounding box.

public void DeactivateProxy<T>(T proxy) where T : class, IDynamicTreeProxy

Parameters

proxy T

The proxy to deactivate.

Type Parameters

T

The proxy type.

EnumerateOverlaps(Action<IDynamicTreeProxy, IDynamicTreeProxy>, bool)

Enumerates all potential collision pairs and invokes the specified action for each.

public void EnumerateOverlaps(Action<IDynamicTreeProxy, IDynamicTreeProxy> action, bool multiThread = false)

Parameters

action Action<IDynamicTreeProxy, IDynamicTreeProxy>

The action to invoke for each overlapping pair.

multiThread bool

If true, uses multithreading for enumeration.

EnumerateTreeBoxes(Action<TreeBox, int>)

Enumerates all axis-aligned bounding boxes in the tree.

public void EnumerateTreeBoxes(Action<TreeBox, int> action)

Parameters

action Action<TreeBox, int>

The action to perform on each bounding box and node height in the tree.

FindNearestPoint(in JVector, FindNearestFilterPre?, FindNearestFilterPost?, out IDynamicTreeProxy?, out JVector, out JVector, out JVector, out float)

public bool FindNearestPoint(in JVector position, DynamicTree.FindNearestFilterPre? pre, DynamicTree.FindNearestFilterPost? post, out IDynamicTreeProxy? proxy, out JVector pointA, out JVector pointB, out JVector normal, out float distance)

Parameters

position JVector
pre DynamicTree.FindNearestFilterPre
post DynamicTree.FindNearestFilterPost
proxy IDynamicTreeProxy
pointA JVector
pointB JVector
normal JVector
distance float

Returns

bool

FindNearestPoint(in JVector, float, FindNearestFilterPre?, FindNearestFilterPost?, out IDynamicTreeProxy?, out JVector, out JVector, out JVector, out float)

public bool FindNearestPoint(in JVector position, float maxDistance, DynamicTree.FindNearestFilterPre? pre, DynamicTree.FindNearestFilterPost? post, out IDynamicTreeProxy? proxy, out JVector pointA, out JVector pointB, out JVector normal, out float distance)

Parameters

position JVector
maxDistance float
pre DynamicTree.FindNearestFilterPre
post DynamicTree.FindNearestFilterPost
proxy IDynamicTreeProxy
pointA JVector
pointB JVector
normal JVector
distance float

Returns

bool

FindNearestSphere(float, in JVector, FindNearestFilterPre?, FindNearestFilterPost?, out IDynamicTreeProxy?, out JVector, out JVector, out JVector, out float)

public bool FindNearestSphere(float radius, in JVector position, DynamicTree.FindNearestFilterPre? pre, DynamicTree.FindNearestFilterPost? post, out IDynamicTreeProxy? proxy, out JVector pointA, out JVector pointB, out JVector normal, out float distance)

Parameters

radius float

The sphere radius.

position JVector
pre DynamicTree.FindNearestFilterPre
post DynamicTree.FindNearestFilterPost
proxy IDynamicTreeProxy
pointA JVector
pointB JVector
normal JVector
distance float

Returns

bool

FindNearestSphere(float, in JVector, float, FindNearestFilterPre?, FindNearestFilterPost?, out IDynamicTreeProxy?, out JVector, out JVector, out JVector, out float)

public bool FindNearestSphere(float radius, in JVector position, float maxDistance, DynamicTree.FindNearestFilterPre? pre, DynamicTree.FindNearestFilterPost? post, out IDynamicTreeProxy? proxy, out JVector pointA, out JVector pointB, out JVector normal, out float distance)

Parameters

radius float

The sphere radius.

position JVector
maxDistance float
pre DynamicTree.FindNearestFilterPre
post DynamicTree.FindNearestFilterPost
proxy IDynamicTreeProxy
pointA JVector
pointB JVector
normal JVector
distance float

Returns

bool

FindNearest<T>(in T, in JQuaternion, in JVector, FindNearestFilterPre?, FindNearestFilterPost?, out IDynamicTreeProxy?, out JVector, out JVector, out JVector, out float)

Finds the closest IDistanceTestable proxy in the tree to the query shape and returns the exact closest points.

public bool FindNearest<T>(in T support, in JQuaternion orientation, in JVector position, DynamicTree.FindNearestFilterPre? pre, DynamicTree.FindNearestFilterPost? post, out IDynamicTreeProxy? proxy, out JVector pointA, out JVector pointB, out JVector normal, out float distance) where T : ISupportMappable

Parameters

support T

The query shape.

orientation JQuaternion

The query shape orientation in world space.

position JVector

The query shape position in world space.

pre DynamicTree.FindNearestFilterPre

Optional pre-filter that can skip candidate proxies before the exact distance test.

post DynamicTree.FindNearestFilterPost

Optional post-filter that can reject exact results and continue the search.

proxy IDynamicTreeProxy

The nearest accepted proxy, or null if no proxy is found.

pointA JVector

Closest point on the query shape in world space. Undefined when the shapes overlap.

pointB JVector

Closest point on the found proxy in world space. Undefined when the shapes overlap.

normal JVector

Unit direction from the query shape toward the found proxy, or Zero when the shapes overlap.

distance float

Separation distance between the query shape and the found proxy. Zero when they overlap.

Returns

bool

true if an accepted proxy is found. This includes the overlapping case, where distance is zero. false if no accepted proxy is found, in which case proxy is null.

Type Parameters

T

Remarks

This overload is unbounded and considers all IDistanceTestable proxies in the tree. To skip overlapping proxies and continue searching for separated ones, use a post filter that returns false for results with distance == 0.

FindNearest<T>(in T, in JQuaternion, in JVector, float, FindNearestFilterPre?, FindNearestFilterPost?, out IDynamicTreeProxy?, out JVector, out JVector, out JVector, out float)

public bool FindNearest<T>(in T support, in JQuaternion orientation, in JVector position, float maxDistance, DynamicTree.FindNearestFilterPre? pre, DynamicTree.FindNearestFilterPost? post, out IDynamicTreeProxy? proxy, out JVector pointA, out JVector pointB, out JVector normal, out float distance) where T : ISupportMappable

Parameters

support T
orientation JQuaternion
position JVector
maxDistance float

Maximum separation distance to consider. Proxies farther than this are ignored.

pre DynamicTree.FindNearestFilterPre
post DynamicTree.FindNearestFilterPost
proxy IDynamicTreeProxy
pointA JVector
pointB JVector
normal JVector
distance float

Returns

bool

Type Parameters

T

IsActive<T>(T)

Checks whether the specified proxy is currently active.

public bool IsActive<T>(T proxy) where T : class, IDynamicTreeProxy

Parameters

proxy T

The proxy to check.

Returns

bool

true if the proxy is active; otherwise, false.

Type Parameters

T

The proxy type.

Optimize(Func<double>, int, float, bool)

Optimizes the tree structure by randomly reinserting proxies.

public void Optimize(Func<double> getNextRandom, int sweeps, float chance, bool incremental)

Parameters

getNextRandom Func<double>

A function returning random values in [0, 1).

sweeps int

Number of optimization passes. Must be greater than zero.

chance float

Probability of reinserting each proxy per sweep. Range: [0, 1].

incremental bool

If false, all proxies are reinserted in random order on the first sweep.

Optimize(int, float, bool)

Optimizes the tree structure by randomly reinserting proxies.

public void Optimize(int sweeps = 100, float chance = 0.01, bool incremental = false)

Parameters

sweeps int

Number of optimization passes. Must be greater than zero.

chance float

Probability of reinserting each proxy per sweep. Range: [0, 1].

incremental bool

If false, all proxies are reinserted in random order on the first sweep.

Query<T>(T, in JBoundingBox)

Queries the tree for proxies overlapping an axis-aligned bounding box.

public void Query<T>(T hits, in JBoundingBox box) where T : class, ICollection<IDynamicTreeProxy>

Parameters

hits T

Collection to store overlapping proxies.

box JBoundingBox

The bounding box to query.

Type Parameters

T

The collection type.

Query<T>(T, in JVector, in JVector)

Queries the tree for proxies intersecting a ray.

public void Query<T>(T hits, in JVector rayOrigin, in JVector rayDirection) where T : class, ICollection<IDynamicTreeProxy>

Parameters

hits T

Collection to store intersected proxies.

rayOrigin JVector

The origin of the ray.

rayDirection JVector

The direction of the ray.

Type Parameters

T

The collection type.

Query<TSink>(ref TSink, in JBoundingBox)

Queries the tree for proxies overlapping an axis-aligned bounding box and appends all hits to the specified sink.

public void Query<TSink>(ref TSink hits, in JBoundingBox box) where TSink : ISink<IDynamicTreeProxy>

Parameters

hits TSink

The sink receiving all overlapping proxies.

box JBoundingBox

The bounding box to query.

Type Parameters

TSink

The sink type receiving all overlapping proxies.

Query<TSink>(ref TSink, in JVector, in JVector)

Queries the tree for proxies intersecting a ray and appends all hits to the specified sink.

public void Query<TSink>(ref TSink hits, in JVector rayOrigin, in JVector rayDirection) where TSink : ISink<IDynamicTreeProxy>

Parameters

hits TSink

The sink receiving all intersected proxies.

rayOrigin JVector

The origin of the ray.

rayDirection JVector

The direction of the ray.

Type Parameters

TSink

The sink type receiving all intersected proxies.

RayCast(JVector, JVector, RayCastFilterPre?, RayCastFilterPost?, out IDynamicTreeProxy?, out JVector, out float)

Ray cast against the world.

public bool RayCast(JVector origin, JVector direction, DynamicTree.RayCastFilterPre? pre, DynamicTree.RayCastFilterPost? post, out IDynamicTreeProxy? proxy, out JVector normal, out float lambda)

Parameters

origin JVector

Origin of the ray.

direction JVector

Direction of the ray. Does not have to be normalized.

pre DynamicTree.RayCastFilterPre

Optional pre-filter which allows to skip shapes in the detection.

post DynamicTree.RayCastFilterPost

Optional post-filter which allows to skip detections.

proxy IDynamicTreeProxy

The shape which was hit.

normal JVector

The surface normal at the hit point. Zero if the ray does not hit, or if the ray origin is inside the hit shape. Use the return value to determine whether a hit occurred; do not rely on this being non-zero as a hit indicator.

lambda float

Distance from the origin to the hit point in units of the ray direction. Zero if the origin is inside the hit shape.

Returns

bool

True if the ray hits, false otherwise.

RayCast(JVector, JVector, float, RayCastFilterPre?, RayCastFilterPost?, out IDynamicTreeProxy?, out JVector, out float)

Ray cast against the world.

public bool RayCast(JVector origin, JVector direction, float maxLambda, DynamicTree.RayCastFilterPre? pre, DynamicTree.RayCastFilterPost? post, out IDynamicTreeProxy? proxy, out JVector normal, out float lambda)

Parameters

origin JVector

Origin of the ray.

direction JVector

Direction of the ray. Does not have to be normalized.

maxLambda float

Maximum lambda of the ray's length to consider for intersections.

pre DynamicTree.RayCastFilterPre

Optional pre-filter which allows to skip shapes in the detection.

post DynamicTree.RayCastFilterPost

Optional post-filter which allows to skip detections.

proxy IDynamicTreeProxy

The shape which was hit.

normal JVector

The surface normal at the hit point. Zero if the ray does not hit, or if the ray origin is inside the hit shape. Use the return value to determine whether a hit occurred; do not rely on this being non-zero as a hit indicator.

lambda float

Distance from the origin to the hit point in units of the ray direction. Zero if the origin is inside the hit shape.

Returns

bool

True if the ray hits, false otherwise.

RemoveProxy(IDynamicTreeProxy)

Removes a proxy from the tree.

public void RemoveProxy(IDynamicTreeProxy proxy)

Parameters

proxy IDynamicTreeProxy

The proxy to remove.

Exceptions

InvalidOperationException

Thrown if the proxy is not in this tree.

SweepCastBox(in JVector, in JQuaternion, in JVector, in JVector, SweepCastFilterPre?, SweepCastFilterPost?, out IDynamicTreeProxy?, out JVector, out JVector, out JVector, out float)

public bool SweepCastBox(in JVector halfExtents, in JQuaternion orientation, in JVector position, in JVector direction, DynamicTree.SweepCastFilterPre? pre, DynamicTree.SweepCastFilterPost? post, out IDynamicTreeProxy? proxy, out JVector pointA, out JVector pointB, out JVector normal, out float lambda)

Parameters

halfExtents JVector

The half extents of the box.

orientation JQuaternion
position JVector
direction JVector
pre DynamicTree.SweepCastFilterPre
post DynamicTree.SweepCastFilterPost
proxy IDynamicTreeProxy
pointA JVector
pointB JVector
normal JVector
lambda float

Returns

bool

SweepCastBox(in JVector, in JQuaternion, in JVector, in JVector, float, SweepCastFilterPre?, SweepCastFilterPost?, out IDynamicTreeProxy?, out JVector, out JVector, out JVector, out float)

public bool SweepCastBox(in JVector halfExtents, in JQuaternion orientation, in JVector position, in JVector direction, float maxLambda, DynamicTree.SweepCastFilterPre? pre, DynamicTree.SweepCastFilterPost? post, out IDynamicTreeProxy? proxy, out JVector pointA, out JVector pointB, out JVector normal, out float lambda)

Parameters

halfExtents JVector

The half extents of the box.

orientation JQuaternion
position JVector
direction JVector
maxLambda float
pre DynamicTree.SweepCastFilterPre
post DynamicTree.SweepCastFilterPost
proxy IDynamicTreeProxy
pointA JVector
pointB JVector
normal JVector
lambda float

Returns

bool

SweepCastCapsule(float, float, in JQuaternion, in JVector, in JVector, SweepCastFilterPre?, SweepCastFilterPost?, out IDynamicTreeProxy?, out JVector, out JVector, out JVector, out float)

public bool SweepCastCapsule(float radius, float halfLength, in JQuaternion orientation, in JVector position, in JVector direction, DynamicTree.SweepCastFilterPre? pre, DynamicTree.SweepCastFilterPost? post, out IDynamicTreeProxy? proxy, out JVector pointA, out JVector pointB, out JVector normal, out float lambda)

Parameters

radius float

The capsule radius.

halfLength float

Half the cylindrical section length of the capsule.

orientation JQuaternion
position JVector
direction JVector
pre DynamicTree.SweepCastFilterPre
post DynamicTree.SweepCastFilterPost
proxy IDynamicTreeProxy
pointA JVector
pointB JVector
normal JVector
lambda float

Returns

bool

SweepCastCapsule(float, float, in JQuaternion, in JVector, in JVector, float, SweepCastFilterPre?, SweepCastFilterPost?, out IDynamicTreeProxy?, out JVector, out JVector, out JVector, out float)

public bool SweepCastCapsule(float radius, float halfLength, in JQuaternion orientation, in JVector position, in JVector direction, float maxLambda, DynamicTree.SweepCastFilterPre? pre, DynamicTree.SweepCastFilterPost? post, out IDynamicTreeProxy? proxy, out JVector pointA, out JVector pointB, out JVector normal, out float lambda)

Parameters

radius float

The capsule radius.

halfLength float

Half the cylindrical section length of the capsule.

orientation JQuaternion
position JVector
direction JVector
maxLambda float
pre DynamicTree.SweepCastFilterPre
post DynamicTree.SweepCastFilterPost
proxy IDynamicTreeProxy
pointA JVector
pointB JVector
normal JVector
lambda float

Returns

bool

SweepCastCylinder(float, float, in JQuaternion, in JVector, in JVector, SweepCastFilterPre?, SweepCastFilterPost?, out IDynamicTreeProxy?, out JVector, out JVector, out JVector, out float)

public bool SweepCastCylinder(float radius, float halfHeight, in JQuaternion orientation, in JVector position, in JVector direction, DynamicTree.SweepCastFilterPre? pre, DynamicTree.SweepCastFilterPost? post, out IDynamicTreeProxy? proxy, out JVector pointA, out JVector pointB, out JVector normal, out float lambda)

Parameters

radius float

The cylinder radius.

halfHeight float

Half the cylinder height.

orientation JQuaternion
position JVector
direction JVector
pre DynamicTree.SweepCastFilterPre
post DynamicTree.SweepCastFilterPost
proxy IDynamicTreeProxy
pointA JVector
pointB JVector
normal JVector
lambda float

Returns

bool

SweepCastCylinder(float, float, in JQuaternion, in JVector, in JVector, float, SweepCastFilterPre?, SweepCastFilterPost?, out IDynamicTreeProxy?, out JVector, out JVector, out JVector, out float)

public bool SweepCastCylinder(float radius, float halfHeight, in JQuaternion orientation, in JVector position, in JVector direction, float maxLambda, DynamicTree.SweepCastFilterPre? pre, DynamicTree.SweepCastFilterPost? post, out IDynamicTreeProxy? proxy, out JVector pointA, out JVector pointB, out JVector normal, out float lambda)

Parameters

radius float

The cylinder radius.

halfHeight float

Half the cylinder height.

orientation JQuaternion
position JVector
direction JVector
maxLambda float
pre DynamicTree.SweepCastFilterPre
post DynamicTree.SweepCastFilterPost
proxy IDynamicTreeProxy
pointA JVector
pointB JVector
normal JVector
lambda float

Returns

bool

SweepCastSphere(float, in JVector, in JVector, SweepCastFilterPre?, SweepCastFilterPost?, out IDynamicTreeProxy?, out JVector, out JVector, out JVector, out float)

public bool SweepCastSphere(float radius, in JVector position, in JVector direction, DynamicTree.SweepCastFilterPre? pre, DynamicTree.SweepCastFilterPost? post, out IDynamicTreeProxy? proxy, out JVector pointA, out JVector pointB, out JVector normal, out float lambda)

Parameters

radius float

The sphere radius.

position JVector
direction JVector
pre DynamicTree.SweepCastFilterPre
post DynamicTree.SweepCastFilterPost
proxy IDynamicTreeProxy
pointA JVector
pointB JVector
normal JVector
lambda float

Returns

bool

SweepCastSphere(float, in JVector, in JVector, float, SweepCastFilterPre?, SweepCastFilterPost?, out IDynamicTreeProxy?, out JVector, out JVector, out JVector, out float)

public bool SweepCastSphere(float radius, in JVector position, in JVector direction, float maxLambda, DynamicTree.SweepCastFilterPre? pre, DynamicTree.SweepCastFilterPost? post, out IDynamicTreeProxy? proxy, out JVector pointA, out JVector pointB, out JVector normal, out float lambda)

Parameters

radius float

The sphere radius.

position JVector
direction JVector
maxLambda float
pre DynamicTree.SweepCastFilterPre
post DynamicTree.SweepCastFilterPost
proxy IDynamicTreeProxy
pointA JVector
pointB JVector
normal JVector
lambda float

Returns

bool

SweepCast<T>(in T, in JQuaternion, in JVector, in JVector, SweepCastFilterPre?, SweepCastFilterPost?, out IDynamicTreeProxy?, out JVector, out JVector, out JVector, out float)

Sweeps a support-mapped query shape against all ISweepTestable proxies in the tree and returns the closest exact hit.

public bool SweepCast<T>(in T support, in JQuaternion orientation, in JVector position, in JVector direction, DynamicTree.SweepCastFilterPre? pre, DynamicTree.SweepCastFilterPost? post, out IDynamicTreeProxy? proxy, out JVector pointA, out JVector pointB, out JVector normal, out float lambda) where T : ISupportMappable

Parameters

support T

The query shape.

orientation JQuaternion

The query shape orientation in world space.

position JVector

The query shape position in world space at the start of the sweep.

direction JVector

The sweep direction vector in world space.

pre DynamicTree.SweepCastFilterPre

Optional pre-filter that can skip candidate proxies before the exact sweep test.

post DynamicTree.SweepCastFilterPost

Optional post-filter that can reject exact results and continue the search.

proxy IDynamicTreeProxy

The closest accepted hit proxy, or null if no hit is found.

pointA JVector

Collision point on the query shape in world space at the sweep origin. Undefined when the shapes already overlap.

pointB JVector

Collision point on the hit proxy in world space at the sweep origin. Undefined when the shapes already overlap.

normal JVector

Collision normal in world space, or Zero when the shapes already overlap.

lambda float

Time of impact in units of direction. Zero when the shapes already overlap.

Returns

bool

true if an accepted hit is found. This includes the overlapping case, where lambda is zero. false if no accepted hit is found, in which case proxy is null.

Type Parameters

T

SweepCast<T>(in T, in JQuaternion, in JVector, in JVector, float, SweepCastFilterPre?, SweepCastFilterPost?, out IDynamicTreeProxy?, out JVector, out JVector, out JVector, out float)

public bool SweepCast<T>(in T support, in JQuaternion orientation, in JVector position, in JVector direction, float maxLambda, DynamicTree.SweepCastFilterPre? pre, DynamicTree.SweepCastFilterPost? post, out IDynamicTreeProxy? proxy, out JVector pointA, out JVector pointB, out JVector normal, out float lambda) where T : ISupportMappable

Parameters

support T
orientation JQuaternion
position JVector
direction JVector
maxLambda float

Maximum sweep parameter to consider along direction.

pre DynamicTree.SweepCastFilterPre
post DynamicTree.SweepCastFilterPost
proxy IDynamicTreeProxy
pointA JVector
pointB JVector
normal JVector
lambda float

Returns

bool

Type Parameters

T

Update(bool, float)

Updates all active proxies in the tree.

public void Update(bool multiThread, float dt)

Parameters

multiThread bool

If true, uses multithreading for the update.

dt float

The timestep in seconds, used for velocity-based bounding box expansion.

Update<T>(T)

Forces an immediate update of a single proxy in the tree.

public void Update<T>(T proxy) where T : class, IDynamicTreeProxy

Parameters

proxy T

The proxy to update.

Type Parameters

T

The proxy type.