Skip to content

given model cannot be hit by UKismetSystemLibrary::LineTraceSingle #1038

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ycn2022 opened this issue Feb 12, 2023 · 9 comments
Closed

given model cannot be hit by UKismetSystemLibrary::LineTraceSingle #1038

ycn2022 opened this issue Feb 12, 2023 · 9 comments

Comments

@ycn2022
Copy link
Contributor

ycn2022 commented Feb 12, 2023

I have a model exported to 3dtiles, and loaded by CesiumForUnreal. but it cannot be hit use UKismetSystemLibrary::LineTraceSingle.
the data file attached.
tileset.zip

@ycn2022 ycn2022 changed the title model cannot be hit by UKismetSystemLibrary::LineTraceSingle given model cannot be hit by UKismetSystemLibrary::LineTraceSingle Feb 12, 2023
@kring
Copy link
Member

kring commented Feb 13, 2023

I can reproduce this, but I'm not sure exactly what is happening. My best guess is that it's caused by degenerate triangles in that model. Line traces simply ignore it, but if we attempt to collide with it, Unreal (5.0 in my case) raises an assertion error:

LogChaos: Warning: Degenerate triangle 100: (2.004326 5.950058 3.330154) (2.052218 5.980874 3.355589) (2.010729 5.980874 3.323751)

@ycn2022
Copy link
Contributor Author

ycn2022 commented Feb 16, 2023

I wang to use FIntrRay3Triangle3d to check hit, can you give some suggest? thanks!
this is the topic about this quesion:
https://community.cesium.com/t/how-to-get-triangle-vertex-position-from-ucesiumgltfprimitivecomponent/22394

@ycn2022
Copy link
Contributor Author

ycn2022 commented Feb 20, 2023

I have created a pull request for this issue, at least can check collision by triangle.

#1043

@hanaimin
Copy link

I can reproduce this, but I'm not sure exactly what is happening. My best guess is that it's caused by degenerate triangles in that model. Line traces simply ignore it, but if we attempt to collide with it, Unreal (5.0 in my case) raises an assertion error:

LogChaos: Warning: Degenerate triangle 100: (2.004326 5.950058 3.330154) (2.052218 5.980874 3.355589) (2.010729 5.980874 3.323751)

It seems that the cesium model uses the meter as the base unit and the value type is "double". Precision is lost in floating-point conversion, and for small triangles, it becomes a degenerate triangle. (It seems UE uses centimeters as the base unit)

@kring
Copy link
Member

kring commented Feb 22, 2023

glTF meshes use 32-bit float precision vertices, just like Unreal meshes. And they're located in the world using 64-bit double precision matrixes, just like UE5 (but unlike UE4). It's true Cesium natively works in meters while UE works in centimeters, but this shouldn't have a significant impact on precision. Can you elaborate on what you're seeing?

@ycn2022
Copy link
Contributor Author

ycn2022 commented Feb 22, 2023

@hanaimin You are right, after coordinates multiplied by 100, it can be hit by UKismetSystemLibrary::LineTraceSingle. It seems to be caused by precision. Can Cesium solve this problem? @kring

@engine5d
Copy link

engine5d commented Mar 2, 2023

@hanaimin You are right, after coordinates multiplied by 100, it can be hit by UKismetSystemLibrary::LineTraceSingle. It seems to be caused by precision. Can Cesium solve this problem? @kring

@ycn2022 @kring if multiply 100, the original tile size will too large, and no conformable between cesiumjs and cesium-unreal. I considered it's best to keep the real size of mesh.

@kring
Copy link
Member

kring commented Mar 2, 2023

It's not obvious to me what we can do to solve this one. If the triangles that Unreal is reporting as degenerate are actually useful, this needs to be reported as a bug to Epic. But let me know if you have an idea that I've missed.

@kring
Copy link
Member

kring commented Jul 17, 2023

We've had some work in this area recently that hopefully ended up solving this problem:

I'm closing this because I don't think it's actionable. But if you're still having problems in v1.28+, please write a separate issue with as much information as possible.

@kring kring closed this as completed Jul 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants