OpenKH / OpenKh

Kingdom Hearts libraries, tools, game engine and documentation
https://openkh.dev
Apache License 2.0
300 stars 83 forks source link

Fix bug MapGen may generate a collision plane having (NaN, NaN, NaN, NaN) #1118

Closed kenjiuno closed 1 month ago

kenjiuno commented 1 month ago

Oathseeker reported that a problematic map generated by MapGen will cause at least 2 problems:

Fix bug MapGen may generate a collision plane having (NaN, NaN, NaN, NaN)

Co3[1134] 0 0 PolyCo4( 825, 826, 810, -1) PlaneCo5(913) Co6(968) Co7( 0)

Co4[825] X:2200 Y:0.0003623899 Z:-2400 W:1 Co4[826] X:2100 Y:0.0003623899 Z:-2400 W:1 Co4[810] X:2050 Y:0.0003623899 Z:-2400 W:1

Co5[913] Normal:X:NaN Y:NaN Z:NaN D:NaN

According to Bing Copilot, the plane cannot be built from these 3 3D coordinates. Thus skip the invalid plane instead of including it.

2024-09-30_01h42_16