File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -522,18 +522,22 @@ export class Body {
522522 const maxX = Math . min ( location . x + ceiledRadius , match . map . width - 1 )
523523 const maxY = Math . min ( location . y + ceiledRadius , match . map . height - 1 )
524524
525- const coords : Vector [ ] = [ location ]
525+ const coords : Vector [ ] = [ ]
526+
526527 const halfFOV = fov / 2
527528 if ( direction == 0 ) {
528529 return coords
529530 }
530531
532+ const OFFSET = this . robotType === schema . RobotType . CAT ? { x : 0.5 , y : 0.5 } : { x : 0 , y : 0 }
533+ const center = { x : location . x + OFFSET . x , y : location . y + OFFSET . y }
534+
531535 const directionRad = ( directionAngles [ direction ] * Math . PI ) / 180
532536
533537 for ( let x = minX ; x <= maxX ; x ++ ) {
534538 for ( let y = minY ; y <= maxY ; y ++ ) {
535- const dx = x - location . x
536- const dy = y - location . y
539+ const dx = x - center . x
540+ const dy = y - center . y
537541 if ( dx * dx + dy * dy <= radius ) {
538542 const angleToPoint = Math . atan2 ( dy , dx )
539543 let angleDiff = angleToPoint - directionRad
You can’t perform that action at this time.
0 commit comments