Skip to content
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

Issue with collision creation from mesh #15010

Closed
1 task done
nulledcc opened this issue Dec 24, 2017 · 16 comments
Closed
1 task done

Issue with collision creation from mesh #15010

nulledcc opened this issue Dec 24, 2017 · 16 comments
Milestone

Comments

@nulledcc
Copy link

nulledcc commented Dec 24, 2017

Godot version: 2.1.4 stable

OS/device including version: Windows 10 64bit 16GB 258SSD GTX1050

Issue description:
When i tried to create collision from mesh it crashed with this errors
ERROR: QuickHull::build: Condition ' O == E ' is true. Continuing..: At: core\math\quick_hull.cpp:401 ERROR: QuickHull::build: Condition ' !F2 ' is true. Continuing..: At: core\math\quick_hull.cpp:429 ERROR: QuickHull::build: Condition ' !F2 ' is true. Continuing..: At: core\math\quick_hull.cpp:429 ERROR: QuickHull::build: Condition ' O == E ' is true. Continuing..: At: core\math\quick_hull.cpp:401

image

  • I searched the existing GitHub issues for potential duplicates.
@ghost ghost added this to the 2.1 milestone Dec 25, 2017
@ghost ghost added topic:core and removed topic:editor labels Dec 25, 2017
@qarmin
Copy link
Contributor

qarmin commented Sep 10, 2018

It also happening with 3.1 5307043

@akien-mga akien-mga modified the milestones: 2.1, 3.1 Sep 18, 2018
@akien-mga
Copy link
Member

Is this still reproducible in the current master branch?

If so, could you provide a test project that can reproduce it?

@akien-mga akien-mga modified the milestones: 3.1, 3.2 Jan 19, 2019
@Toshiwoz
Copy link
Contributor

I got the same error, here's a basic project with a mesh that does generate that error when it has attached a convex collision shape.

qh_error.zip

You can test it also by removing and re-adding the collision shape within the editor.

Mine is a custom build, v3.1.beta.custom_build.09e4d7e.

I think that this closed issue is also related: #17569

@akien-mga, being this a bug, shouldn't this remain in the 3.1 scope? Even if fixed after 3.1 is officially published. I mean, at least now it doesn't crash the application, but still, as you may notice, the collision shape does not look that good.

@hpvb
Copy link
Member

hpvb commented Mar 4, 2019

This is probably fixed now

@akien-mga akien-mga modified the milestones: 3.2, 3.1 Mar 4, 2019
@akien-mga
Copy link
Member

Closing, please comment if you can still reproduce it in 3.1 beta 10 or later.

@hpvb
Copy link
Member

hpvb commented Mar 4, 2019

There are still messages on the console when the collision sibling is being created but they are purely cosmetic. I don't think this is really worth changing.

@Toshiwoz
Copy link
Contributor

Toshiwoz commented Mar 5, 2019

I have tested just now, and in the console there's no error showing up anymore, just in the shell window.
It was little bothering before as it was slowing down the loading process too (IMHO), at least in my chase when I was using lots of trimesh collision shapes.
I am now using cubes to simplify, so for me it's ok to leve it as is.

@Jose-Moreno
Copy link

Someone just reported this issue in Godot Engine's spanish facebook group, happening on 3.1 stable
https://www.facebook.com/groups/771679136238312/permalink/2571054849634056/

Here are the screenshots the user took:

image

image

Unfortunately I don't have access to his project but I asked him to comment on this thread with a minimum reproduction project and to tag akien when he does. Cheers.

@faraazahmad
Copy link

@Jose-Moreno Also happening in v3.1.1 stable (Linux)
image

@jitspoe
Copy link
Contributor

jitspoe commented Apr 17, 2020

I'm also getting these errors in 3.2 on some convex collision objects. It seems to be purely cosmetic, as I haven't noticed any issues with the collision in-game, but the display is a bit funky. For example, I have a pipe shape here, and the end of it has some overlapping edges when displayed:
image

I highlighted the end, since it's a bit difficult to see with the overlapping wireframes. It really should just be an octagon, because it's a flat face, but some arbitrary edges were added, and these warnings were displayed in the Output log:

core\math\quick_hull.cpp:399 - Condition "!F" is true. Continuing.
core\math\quick_hull.cpp:402 - Condition "O == 0" is true. Continuing.

Some cases are much worse, and one of my scenes just spams like 2 pages of these errors. It would be nice to get this fixed, so I don't miss real errors.

pipes1_bend_angled_top.zip

Here's the gltf file for that pipe. Note that I'm using convcolonly for the collision and this was imported with 3.1 where it used the quick hull method for convex collision, so to repro this in 3.2, you'll probably have to generate collision from the mesh or change resource_importer_scene.cpp to use quick hull like this:

				} else if (_teststr(name, "convcolonly")) {
					shapes.push_back(mesh->create_convex_shape());
					collision_map[mesh] = shapes;
				}

@sent44
Copy link
Contributor

sent44 commented Apr 12, 2021

Godot v3.2.3 stable here

var v: PoolVector3Array = []
v.append(Vector3(0,0,0))
v.append(Vector3(1,0,1))
v.append(Vector3(0,0,1))
v.append(Vector3(-1,0,1))

shape = ConvexPolygonShape.new() # CollisionShape.shape
shape.points = v

Also produce error, collision still work. But if I move Vector3(0,0,0) to the bottom, error gone.
Well I modify this directly so this might be correct behavior, but same thing happen with ArrayMesh

var vex: PoolVector3Array = []
vex.append(Vector3(0,0,0))
vex.append(Vector3(1,0,1))
vex.append(Vector3(0,0,1))
vex.append(Vector3(-1,0,1))
#vex.append(Vector3(0,0,0))

var inx: PoolIntArray = [0,1,2,0,2,3]
#var inx: PoolIntArray = [1,2,0,2,3,0]

var arr: Array = []
arr.resize(ArrayMesh.ARRAY_MAX)
arr[ArrayMesh.ARRAY_VERTEX] = vex
arr[ArrayMesh.ARRAY_INDEX] = inx

var arr_mesh: ArrayMesh = ArrayMesh.new()
arr_mesh.add_surface_from_arrays(Mesh.PRIMITIVE_TRIANGLES, arr)

shape = arr_mesh.create_convex_shape() # CollisionShape.shape
print(shape.points) # Same array as vex (Even if it isn't index based mesh)

I think it is because Mesh::create_convex_shape() just copy vertices data and put it in ConvexPolygonShape.points without properly reorganize to the same format that quick_hull thing want.

(I didn't test in Godot 4 yet, but I look at the master branch code. I think it is still happen because create_convex_shape and error section of quick_hull thing is still (almost) same)

@justinbarrett
Copy link

Closing, please comment if you can still reproduce it in 3.1 beta 10 or later.

I am getting the error in 3.3.2 win10 64.

@Calinou
Copy link
Member

Calinou commented Jun 24, 2021

@justinbarrett Can you test the 3.x branch with #48533 merged in? You can do so by compiling the latest 3.x branch from source.

If you can still reproduce this on the latest 3.x branch, please open a new issue as this one is very old. Make sure to include a minimal reproduction project.

@sent44
Copy link
Contributor

sent44 commented Jun 24, 2021

Wow, never notice that this is already fixed.
Quick test on almost stable 3.3.2 build (not 3.x), no error.

@kreivi
Copy link

kreivi commented Jul 9, 2021

Based on the discussion above I think this is redundant information but I'll book it down anyway.
I encountered this issue with v3.2.3.stable-official when I did this:

var body: MeshInstance = car_root.get_node("body")
var body_collision_shape: ConvexPolygonShape = body.mesh.create_convex_shape()

Output of errors was:

 core/math/quick_hull.cpp:428 - Condition "!F2" is true. Continuing.
 core/math/quick_hull.cpp:401 - Condition "O == E" is true. Continuing.

I'm using mesh from Kenneys Car Kit and as far as I can tell the mesh seems fine. However I'm seeing some weird looking orphan edges in the generated collision:
orphan_edge

@justinbarrett
Copy link

@justinbarrett Can you test the 3.x branch with #48533 merged in? You can do so by compiling the latest 3.x branch from source.

If you can still reproduce this on the latest 3.x branch, please open a new issue as this one is very old. Make sure to include a minimal reproduction project.

The reason I do not open a new one(issue) is simply the fact that if you do any type of search, this link is what comes up...that is important for people that don't understand git hub or any type of repository/svn etc... I don't want to hide information simply because it is easier...even if it is the right thing.. It's inevitably robbing some poor kid of information.
Now that that is out of the way...
I wanted to point out that, when using bullet physics, these errors do not exist...I have not checked in 4.0 branch(master at this point I guess)
just wanted to pass this information along.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests