Skip to content

AABB.intersectSegment returns NaN in hit collider response object #9

@mreinstein

Description

@mreinstein

my setup data:

pos = new Point(907.5, 318.5)
half = new Point(7.5, 17.5)

myAabb = new AABB(pos, half)

start = new Point(531, 301)
delta = new Point(16, 0)
result = myAabb.intersectSegment(start, delta)
console.log('result:', result)

/*
prints:

result: Hit {
  collider: AABB {
    pos: Point { x: 907.5, y: 318.5 },
    half: Point { x: 7.5, y: 17.5 }
  },
  pos: Point { x: NaN, y: NaN },
  delta: Point { x: NaN, y: NaN },
  normal: Point { x: 0, y: -1 },
  time: NaN
}
*/

Any ideas what's going on here? When I look at the internal implementation I see nearTimeY is being set to NaN

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions