@@ -15,16 +15,19 @@ public class RaycastTests : PhysicsSystemsTests
1515 [ Test ]
1616 public unsafe void RaycastAgainstStaticFloor ( )
1717 {
18- Body floorBody = new ( world , new CubeShape ( 0.5f ) , BodyType . Static ) ;
19- Transform floorTransform = floorBody ;
20- floorTransform . LocalScale = new ( 100 , 1 , 1 ) ;
21- floorTransform . LocalPosition = new ( 0 , - 2 , 0 ) ;
18+ Body floorBody = new ( world , new CubeShape ( 0.5f , 0.5f , 0.5f ) , BodyType . Static ) ;
19+ floorBody . As < Transform > ( ) . LocalPosition = new ( 0f , - 5f , 0f ) ;
20+ floorBody . As < Transform > ( ) . LocalScale = new ( 100f , 1f , 1f ) ;
2221
2322 simulator . Update ( TimeSpan . FromSeconds ( 0.01f ) ) ;
2423
24+ Vector3 origin = new ( 0.00013398135f , - 4.000277f , 0.00049429137f ) ;
25+ Vector3 direction = - Vector3 . UnitY ;
26+ float distance = 0.5f ;
2527 using MemoryAddress temp = MemoryAddress . AllocateValue < ( uint , bool ) > ( default ) ;
2628 ref ( uint entity , bool hit ) result = ref temp . Read < ( uint , bool ) > ( ) ;
27- simulator . TryHandleMessage ( new RaycastRequest ( world , Vector3 . Zero , - Vector3 . UnitY , new ( & HitCallback ) , 1.501f , ( ulong ) temp . Address ) ) ;
29+ Assert . That ( result . hit , Is . False ) ;
30+ simulator . TryHandleMessage ( new RaycastRequest ( world , origin , direction , new ( & HitCallback ) , distance , ( ulong ) temp . Address ) ) ;
2831 Assert . That ( result . hit , Is . True ) ;
2932
3033 [ UnmanagedCallersOnly ]
0 commit comments