Skip to content

Commit ac1f06d

Browse files
authored
chore: Update BepuPhysics to 2.5.0-beta.27 (#3049)
1 parent 44565ac commit ac1f06d

File tree

7 files changed

+14
-13
lines changed

7 files changed

+14
-13
lines changed

sources/Directory.Packages.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
</PropertyGroup>
55
<!-- Runtime dependencies -->
66
<ItemGroup>
7-
<PackageVersion Include="BepuPhysics" Version="2.5.0-beta.25" />
7+
<PackageVersion Include="BepuPhysics" Version="2.5.0-beta.27" />
88
<PackageVersion Include="DotRecast.Core" Version="2025.2.1" />
99
<PackageVersion Include="DotRecast.Detour" Version="2025.2.1" />
1010
<PackageVersion Include="DotRecast.Recast" Version="2025.2.1" />

sources/engine/Stride.BepuPhysics/Stride.BepuPhysics/BepuSimulation.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ public bool ShouldPerformPhysicsTest(CollisionMask mask, CollidableReference col
366366
public bool RayCast(in Vector3 origin, in Vector3 dir, float maxDistance, out HitInfo result, CollisionMask collisionMask = CollisionMask.Everything)
367367
{
368368
var handler = new RayClosestHitHandler(this, collisionMask);
369-
Simulation.RayCast(origin.ToNumeric(), dir.ToNumeric(), maxDistance, ref handler);
369+
Simulation.RayCast(origin.ToNumeric(), dir.ToNumeric(), maxDistance, BufferPool, ref handler);
370370
if (handler.HitInformation.HasValue)
371371
{
372372
result = handler.HitInformation.Value;
@@ -397,7 +397,7 @@ public unsafe ConversionEnum<ManagedConverter, HitInfoStack, HitInfo> RayCastPen
397397
fixed (HitInfoStack* ptr = &buffer[0])
398398
{
399399
var handler = new RayHitsStackHandler(ptr, buffer.Length, this, collisionMask);
400-
Simulation.RayCast(origin.ToNumeric(), dir.ToNumeric(), maxDistance, ref handler);
400+
Simulation.RayCast(origin.ToNumeric(), dir.ToNumeric(), maxDistance, BufferPool, ref handler);
401401
return new (buffer[..handler.Head], new ManagedConverter(this));
402402
}
403403
}
@@ -414,7 +414,7 @@ public unsafe ConversionEnum<ManagedConverter, HitInfoStack, HitInfo> RayCastPen
414414
public void RayCastPenetrating(in Vector3 origin, in Vector3 dir, float maxDistance, ICollection<HitInfo> collection, CollisionMask collisionMask = CollisionMask.Everything)
415415
{
416416
var handler = new RayHitsCollectionHandler(this, collection, collisionMask);
417-
Simulation.RayCast(origin.ToNumeric(), dir.ToNumeric(), maxDistance, ref handler);
417+
Simulation.RayCast(origin.ToNumeric(), dir.ToNumeric(), maxDistance, BufferPool, ref handler);
418418
}
419419

420420
/// <summary>
@@ -622,7 +622,7 @@ private unsafe void OverlapInner<TShape, TCollector>(in TShape shape, in SRigidP
622622

623623
try
624624
{
625-
Simulation.BroadPhase.GetOverlaps(boundingBoxMin, boundingBoxMax, ref broadPhaseEnumerator);
625+
Simulation.BroadPhase.GetOverlaps(boundingBoxMin, boundingBoxMax, BufferPool, ref broadPhaseEnumerator);
626626

627627
var batcher = new CollisionBatcher<BatcherCallbacks<TCollector>>(BufferPool, Simulation.Shapes, Simulation.NarrowPhase.CollisionTaskRegistry, 0, new()
628628
{

sources/engine/Stride.BepuPhysics/Stride.BepuPhysics/CollidableComponent.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,6 @@ internal void RayTest<TRayHitHandler>(
464464
if (ShapeIndex.Exists == false || Simulation is null)
465465
return;
466466

467-
Collider.RayTest(Simulation.Simulation.Shapes, ShapeIndex, Pose!.Value, new RayData { Origin = origin, Direction = dir }, ref maximumT, ref hitHandler);
467+
Collider.RayTest(Simulation.Simulation.Shapes, ShapeIndex, Pose!.Value, new RayData { Origin = origin, Direction = dir }, ref maximumT, ref hitHandler, Simulation.BufferPool);
468468
}
469469
}

sources/engine/Stride.BepuPhysics/Stride.BepuPhysics/Definitions/Colliders/CompoundCollider.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,16 +127,16 @@ void ICollider.AppendModel(List<BasicMeshBuffers> buffer, ShapeCacheSystem shape
127127
}
128128
}
129129

130-
void ICollider.RayTest<TRayHitHandler>(Shapes shapes, TypedIndex shapeIndex, in NRigidPose pose, in RayData ray, ref float maximumT, ref TRayHitHandler hitHandler)
130+
void ICollider.RayTest<TRayHitHandler>(Shapes shapes, TypedIndex shapeIndex, in NRigidPose pose, in RayData ray, ref float maximumT, ref TRayHitHandler hitHandler, BufferPool pool)
131131
{
132132
if (shapeIndex.Type == Compound.TypeId)
133133
{
134-
shapes.GetShape<Compound>(shapeIndex.Index).RayTest(pose, in ray, ref maximumT, shapes, ref hitHandler);
134+
shapes.GetShape<Compound>(shapeIndex.Index).RayTest(pose, in ray, ref maximumT, shapes, pool, ref hitHandler);
135135
}
136136
else
137137
{
138138
Debug.Assert(shapeIndex.Type == BigCompound.TypeId);
139-
shapes.GetShape<BigCompound>(shapeIndex.Index).RayTest(pose, in ray, ref maximumT, shapes, ref hitHandler);
139+
shapes.GetShape<BigCompound>(shapeIndex.Index).RayTest(pose, in ray, ref maximumT, shapes, pool, ref hitHandler);
140140
}
141141
}
142142
}

sources/engine/Stride.BepuPhysics/Stride.BepuPhysics/Definitions/Colliders/EmptyCollider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ bool ICollider.TryAttach(Shapes shapes, BufferPool pool, ShapeCacheSystem shapeC
4444
return true;
4545
}
4646

47-
void ICollider.RayTest<TRayHitHandler>(Shapes shapes, TypedIndex shapeIndex, in NRigidPose pose, in RayData ray, ref float maximumT, ref TRayHitHandler hitHandler)
47+
void ICollider.RayTest<TRayHitHandler>(Shapes shapes, TypedIndex shapeIndex, in NRigidPose pose, in RayData ray, ref float maximumT, ref TRayHitHandler hitHandler, BufferPool pool)
4848
{
4949
}
5050
}

sources/engine/Stride.BepuPhysics/Stride.BepuPhysics/Definitions/Colliders/ICollider.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ internal void RayTest<TRayHitHandler>(
3333
in NRigidPose pose,
3434
in RayData ray,
3535
ref float maximumT,
36-
ref TRayHitHandler hitHandler)
36+
ref TRayHitHandler hitHandler,
37+
BufferPool pool)
3738
where TRayHitHandler : struct, IShapeRayHitHandler;
3839
}

sources/engine/Stride.BepuPhysics/Stride.BepuPhysics/Definitions/Colliders/MeshCollider.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,9 @@ void ICollider.AppendModel(List<BasicMeshBuffers> buffer, ShapeCacheSystem shape
118118
cacheOut = cache;
119119
}
120120

121-
void ICollider.RayTest<TRayHitHandler>(Shapes shapes, TypedIndex shapeIndex, in NRigidPose pose, in RayData ray, ref float maximumT, ref TRayHitHandler hitHandler)
121+
void ICollider.RayTest<TRayHitHandler>(Shapes shapes, TypedIndex shapeIndex, in NRigidPose pose, in RayData ray, ref float maximumT, ref TRayHitHandler hitHandler, BufferPool pool)
122122
{
123123
Debug.Assert(shapeIndex.Type == Mesh.TypeId);
124-
shapes.GetShape<Mesh>(shapeIndex.Index).RayTest(pose, in ray, ref maximumT, ref hitHandler);
124+
shapes.GetShape<Mesh>(shapeIndex.Index).RayTest(pose, in ray, ref maximumT, pool, ref hitHandler);
125125
}
126126
}

0 commit comments

Comments
 (0)