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

Some way to add functions to g_PostSimulationQueue #894

Open
Bo98 opened this issue Jan 16, 2017 · 1 comment
Open

Some way to add functions to g_PostSimulationQueue #894

Bo98 opened this issue Jan 16, 2017 · 1 comment

Comments

@Bo98
Copy link

Bo98 commented Jan 16, 2017

If we change anything to do with physics in a physics callback, the engine rightly prints errors: "changing collision rules within a callback is likely to cause crashes!".

What entities in the engine do in callbacks such as VPhysicsCollision (ENT:PhysicsCollide), is that they queue changes to collision rules into g_PostSimulationQueue, either directly or through helper functions like PhysCallbackDamage(...). Right now if we want to, for example, remove an entity on impact via ENT:PhysicsCollide, we have to use a timer - which is horrible and delays everything by a frame.

Additionally, a binding to PhysIsInCallback() would be nice to go in hand with this.

@Kefta
Copy link

Kefta commented Dec 28, 2023

Please consider this 🙏 many addons have had to implement timers everywhere to do the operations needed post-collision to avoid the console message. This would be extremely useful.

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

2 participants