File tree Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " ecctrl" ,
3
- "version" : " 1.0.32 " ,
3
+ "version" : " 1.0.33 " ,
4
4
"author" : " Erdong Chen" ,
5
5
"license" : " MIT" ,
6
6
"description" : " A floating rigibody character controller for R3F" ,
Original file line number Diff line number Diff line change @@ -734,11 +734,14 @@ export default function Ecctrl({
734
734
rayHit = world . castRay (
735
735
rayCast ,
736
736
rayLength ,
737
- false ,
737
+ true ,
738
738
null ,
739
739
null ,
740
740
// I have no idea
741
- characterRef . current as unknown as Collider
741
+ characterRef . current as unknown as Collider ,
742
+ null ,
743
+ // this exclude with sensor collider
744
+ ( ( collider ) => ! collider . isSensor ( ) )
742
745
) ;
743
746
/**Test shape ray */
744
747
// rayHit = world.castShape(
@@ -772,7 +775,6 @@ export default function Ecctrl({
772
775
rayOrigin . y - rayHit . toi ,
773
776
rayOrigin . z
774
777
) ;
775
- // this deals with any invisible collider object (sensor or air wall)
776
778
const rayHitObjectBodyType = rayHit . collider . parent ( ) . bodyType ( ) ;
777
779
const rayHitObjectBodyMass = rayHit . collider . parent ( ) . mass ( ) ;
778
780
// Body type 0 is rigid body, body type 1 is fixed body, body type 2 is kinematic body
@@ -845,11 +847,14 @@ export default function Ecctrl({
845
847
slopeRayHit = world . castRay (
846
848
slopeRayCast ,
847
849
slopeRayLength ,
848
- false ,
850
+ true ,
849
851
null ,
850
852
null ,
851
853
// Still no idea
852
- characterRef . current as unknown as Collider
854
+ characterRef . current as unknown as Collider ,
855
+ null ,
856
+ // this exclude with sensor collider
857
+ ( ( collider ) => ! collider . isSensor ( ) )
853
858
) ;
854
859
855
860
// Calculate slope angle
You can’t perform that action at this time.
0 commit comments