File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed
cave-game/server/entities Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -189,12 +189,10 @@ export class PlayerEntity extends Entity {
189189 lastFoundAnchor : GrappleAnchorEntity | null = null ;
190190 lastAnchor : GrappleAnchorEntity | null = null ;
191191 findGrappleAnchor ( lookDir : YXZEuler ) : GrappleAnchorEntity | null {
192+ const dir = new phys . Vec3 ( - Math . sin ( lookDir . y ) , Math . sin ( lookDir . x ) , - Math . cos ( lookDir . y ) ) . unit ( ) ;
192193 const objects = this . game . raycast (
193- this . body . position ,
194- new phys . Vec3 ( - Math . sin ( lookDir . y ) , Math . sin ( lookDir . x ) , - Math . cos ( lookDir . y ) )
195- . unit ( )
196- . scale ( 100 )
197- . vadd ( this . body . position ) ,
194+ this . body . position . vadd ( dir . clone ( ) . scale ( 2 ) ) , // start the ray 2 units in front of the player
195+ dir . scale ( 100 ) . vadd ( this . body . position ) ,
198196 { } ,
199197 this ,
200198 ) ;
You can’t perform that action at this time.
0 commit comments