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

[Bullet] _integrate_forces(state) not reporting contacts, normals #58409

Open
Tracked by #45022
valknor opened this issue Feb 21, 2022 · 1 comment
Open
Tracked by #45022

[Bullet] _integrate_forces(state) not reporting contacts, normals #58409

valknor opened this issue Feb 21, 2022 · 1 comment

Comments

@valknor
Copy link

valknor commented Feb 21, 2022

Godot version

3.4.2

System information

Debian 11 (Linux)

Issue description

Hello,

When using the Bullet Physics Engine (currently the default for Godot 3.4), sometimes the _integrate_forces method fails to return a value other than 0 for get_contact_count or get_contact_local_normal, for a RigidBody. This appears to be similar to issue 43806.

Steps to reproduce

Putting the following in a RigidBody's script displays the problem for me:

func _integrate_forces(state):
	print(state.get_contact_count())
	print(state.get_contact_local_normal(0))

I am including a project that should reproduce this problem below. Simply Run full speed toward the green ramp in the middle, and pay attention to the printout in the output window. The script in question is Lee.gd located in the assets folder. You should notice that the other two ramps work fine, as do most objects in the game. This problem seems to be frequently mitigated by using a trimesh collision sibling. However these do not always compensate for more complex meshes, such as the insides of cylinders.

Minimal reproduction project

gammaball.zip

@Calinou Calinou changed the title _integrate_forces(state) not reporting contacts, normals [Bullet] _integrate_forces(state) not reporting contacts, normals Feb 22, 2022
@akien-mga akien-mga added this to the 3.x milestone May 19, 2022
@D3ZAX
Copy link

D3ZAX commented Sep 22, 2022

You need set "Contacts Reported" property of RigidBody node greater than 0 to get contact in _integrate_forces. I found you just leave it to 0.

Actually, I don't think leave default value to 0 is good idea, for it just looks like a bug.

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

4 participants