grenades

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
BoltonBeedz
Posts: 45
Joined: Fri Dec 07, 2007 12:58 am

grenades

Post by BoltonBeedz »

hi. im a guy. great product thanks, whats going on? i have a problem throwing grenades against a triangle list, they fall through easily, its like small, fast objects dont work. should i be casting rays for this or do you have it covered? the iteration setting doesnt seem to work? i also made large cubes that would vanish after landing on the large triangles, not fall thru. apart from that id say its fabulous. will there be an update soon?
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Post by Norbo »

Currently, the engine uses discrete collision detection, so it can miss collisions between small, fast objects as you have observed. The iteration count corresponds to the collision response solver iterations, so increasing or decreasing it won't be much help. You could artificially increase the update frequency of the physics, but that is more of a patch to the problem and doesn't seem like an ideal solution for an XNA game project.

The best workaround for this problem right now is to decrease velocities and increase size of objects or use objects with thickness as collision geometry, though I understand the value of having reliable triangle list detection and tiny/quick objects. I am currently working on implementing ray intersection tests which will open up quite a few doors for the engine, including continuous collision detection which would resolve the paper thin triangles problem.

As for the vanishing cubes, I need a little more information to diagnose the problem. Once before, I observed an object disappear, though I have not seen it since- in this case, the object was atop a kilometer-wide hexahedron. I have never seen this behavior on significantly smaller scales (my testbeds usually have ground objects ranging from a few meters to around 100). If the triangles composing the ground were sufficiently large, there could have been a floating point error in the deep contact resolution system which decided to throw it out to infinity, though this is simply a stab in the dark as I have not reproduced the problem frequently. If you can provide a bit more detail or a test setup that causes the problem, it will help me find the issue.

Generally speaking, the detection system in the engine handles similarly sized objects of moderate size the best. Going too far in an extreme can have consequences, though I always work to minimize those problems.

A new version (v0.2.0, as it stands now) will be coming out relatively soon including the ray cast features, changes to the deep contact resolution system (which may inadvertently help the disappearing cubes problem), and quite a few other goodies.

Thanks for the feedback!

Edit: The more I look at it, the more I'm tempted to do a fairly significant revision of deep contact handling. You may have noticed a few position 'glitches' when objects were involved in multiple collisions where an object seemed to teleport inappropriately; this is due to the system pushing them back out to an acceptable collision margin for forming contacts. However, the framework is already set for implementing a system that doesn't need to push them out of interpenetration artificially. This would eliminate the 'pop' of the correction system, but some high velocity collisions might appear slightly bouncier. Perhaps I'll leave the deseperation routine as an option, as it can be either on or off with no severe consequences in the new system I'm designing. Then again, this might be a little more than is warranted for v0.2.0; I may need to delay it for a future version for the sake of the other features.
BoltonBeedz
Posts: 45
Joined: Fri Dec 07, 2007 12:58 am

Post by BoltonBeedz »

excellent. i tried my best to reproduce cubes dissapearing with not much success. i emailed it to you anyway.

edit: PS. my grenades turned out real good and were very easy to implement with the applyforce function - only thing is can we have a timer on forces so they are removed automatically?
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Post by Norbo »

Yeah that's a good idea, I'll put that in v0.2.0. Thanks.
Post Reply