Struct SimulationRayBatcher<TRayHitHandler>
- Namespace
- BepuPhysics.CollisionDetection
- Assembly
- BepuPhysics.dll
Tests batches of rays against the simulation.
public struct SimulationRayBatcher<TRayHitHandler> : IDisposable where TRayHitHandler : struct, IRayHitHandler
Type Parameters
TRayHitHandler
Type used to handle hits against objects in the simulation.
- Implements
- Inherited Members
Constructors
SimulationRayBatcher(BufferPool, Simulation, TRayHitHandler, int)
public SimulationRayBatcher(BufferPool pool, Simulation simulation, TRayHitHandler hitHandler, int batcherRayCapacity = 2048)
Parameters
pool
BufferPoolsimulation
SimulationhitHandler
TRayHitHandlerbatcherRayCapacity
int
Methods
Add(ref Vector3, ref Vector3, float, int)
Adds a ray to the batcher to test against the simulation. If the underlying ray batcher hits its maximum capacity, all the accumulated rays will be tested against the simulation and the accumulator will be reset.
public void Add(ref Vector3 origin, ref Vector3 direction, float maximumT, int id = 0)
Parameters
origin
Vector3Origin of the ray to test against the simulation.
direction
Vector3Direction of the ray to test against the simulation.
maximumT
floatMaximum distance that the ray will travel in units of the ray's length.
id
intIdentifier value for the ray. Callbacks will have access to the id.
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
Flush()
Tests any accumulated rays against the broad phase trees and then resets the batcher.
public void Flush()