gkjohnson / three-mesh-bvh

A BVH implementation to speed up raycasting and enable spatial queries against three.js meshes.
https://gkjohnson.github.io/three-mesh-bvh/example/bundle/raycast.html
MIT License
2.52k stars 265 forks source link

OrientedBox type does not extend Box3 #468

Closed krispya closed 2 years ago

krispya commented 2 years ago

Hello! While using OrientedBox the type would report as not having min or max on the object which looked odd. When I peeked at the type definition I saw that the OrientedBox type was not extending Box3.

gkjohnson commented 2 years ago

There are no ts definition files in the project so unfortunately I can't help with typing issues. It's probably best to discuss on a typescript or code editor issue than here.

krispya commented 2 years ago

Oh I had no idea. Is there any interest in providing types?

gkjohnson commented 2 years ago

Oh sorry - there actually are type definitions 😅 I forgot they'd been added. It looks like OrientedBox is not extending from Box3 in the types. Would you like to make a PR to fix the issue?

https://github.com/gkjohnson/three-mesh-bvh/blob/master/src/index.d.ts#L315

krispya commented 2 years ago

Oh sorry - there actually are type definitions 😅 I forgot they'd been added. It looks like OrientedBox is not extending from Box3 in the types. Would you like to make a PR to fix the issue?

https://github.com/gkjohnson/three-mesh-bvh/blob/master/src/index.d.ts#L315

😅 Good to know I'm not crazy! Yeah I'll make a PR when I get some time. I've been using the library a lot so I'm happy to give back.

Cevered commented 2 years ago

I assumed I was the only one, but I didn't realize this was a problem.

gkjohnson commented 2 years ago

Please feel free to submit a PR to fix the issue!