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

Able To Physgun Objects Through Anything Immobile #25

Open
kklouzal opened this issue Feb 15, 2014 · 6 comments
Open

Able To Physgun Objects Through Anything Immobile #25

kklouzal opened this issue Feb 15, 2014 · 6 comments

Comments

@kklouzal
Copy link

You are able to take any object that can be picked up with the physgun and move it through another object that is currently frozen as well as the world geometry itself, the object is constantly being 'pushed' out of the other object instead of blocking the held object from entering the other, this leads to the inability to effectively build in a variety of ways.

@DrChat
Copy link
Owner

DrChat commented Feb 15, 2014

Caused because bullet has no CCD solving.

@kklouzal
Copy link
Author

Okay I understand now, I have done C++ programming in the past using a small amount of Bullet in conjunction with the Irrlicht 3D engine as well as MikeNet networking api to make some small games, collision detection was always a big headache, if I may suggest a possible method to tackle this, unless of course you already have an idea as to how you'll go about it, if the object is moving you might be apt to do a ray cast in the direction the object is moving and get the collision point from that to accomplish the CCD test? It is most likely much more complicated that I am aware of.

@DrChat
Copy link
Owner

DrChat commented Feb 15, 2014

Bullet has some faux CCD in btDiscreteDynamicsWorld.cpp, but I have it disabled because it's really slow on large maps.

@DrChat DrChat changed the title Able To Physgun Objects Through Anything Immobile (Bullet physics has no CCD solving) Able To Physgun Objects Through Anything Immobile (constraint solver split penetration issue) Apr 12, 2014
@DrChat
Copy link
Owner

DrChat commented Apr 12, 2014

So, turns out I was completely wrong! Awesome!

This has absolutely nothing do with ccd (except for if the object goes through the ground fast enough, no contact points will be generated). The constraint solver will "push" interpenetrating objects out of eachother, but it does not alter the velocity of the objects. And apparently there's a load of left over delta impulse after every iteration, even more since the shadow controller is forcing the object into an invalid state. So then the next step in the tick is to integrate the transforms, which means moving the objects to their new positions based on their velocity and the timestep.

It may be better to just detect contact points in the shadow controller and slide along them rather than forcing the object through them.

@DrChat
Copy link
Owner

DrChat commented May 18, 2014

Update: This appears to be caused by the physgun giving the object a huge mass. The impulse on a object by a contact point is scaled by the object's inverse mass, so the delta velocity is really small.

The impulse is scaled up by the inverse diagonal jacobian between A and B in setupContactConstraint, but that doesn't scale up the impulse nearly enough. Need to look into this.

Okay, the inverse diag jacobian is too small cause of the angular component being factored in. If the angular component is 0, there is absolutely no passthrough, but the objects won't be rotated by the contact points.

@DrChat DrChat changed the title Able To Physgun Objects Through Anything Immobile (constraint solver split penetration issue) Able To Physgun Objects Through Anything Immobile Jun 8, 2014
@DrChat
Copy link
Owner

DrChat commented Jul 28, 2014

(Sort of) fixed in 67d8dc4. It's not impossible but it's harder to do.

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

2 participants