View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0001073 | The Dark Mod | Physics | public | 03.09.2008 09:16 | 06.12.2026 14:01 |
| Reporter | Ishtvan | Assigned To | |||
| Priority | normal | Severity | normal | Reproducibility | always |
| Status | new | Resolution | open | ||
| Summary | 0001073: Butcher Knife & Kitchen Knife Levitating | ||||
| Description | If you rest the point of the kitchen knife or the end of the butcher knife on another moveable, like a turnip, they start levitating up for a while. [EDIT: Both objects levitate, the turnip underneath and the knife on top. I also think you have to drop the knife on, it may not start levitating if you carefully set it down]. They usually fall back down after 30 seconds or so. Is there something different about the clipmodels or physics settings on these moveabls? | ||||
| Tags | No tags attached. | ||||
| related to | 0004435 | closed | duzenko | Investigate fp-precision related issues |
| related to | 0003452 | resolved | grayman | Moveable planks don't fall realistically |
| related to | 0000665 | new | Moveables stacked on top of eachother begin to levitate up | |
| related to | 0003543 | new | Bad physics for small moveables | |
| related to | 0006483 | new | Stacked moveables drop into each other after you touch them |
| Still reproducible with the moveable_kitchen_knife_chef entity. I wasn't able to reproduce with the ornamental knife. The collision (mesh?) thickness is probably at the size boundary of the physics system. With the turnip, it clips through the blade sometimes. | |
| Are we sure its not just a bad collision mesh..? | |
|
g_showCollisionModels shows that the knife has flat triangles which may be confusing to the collision parser. Otherwise the model appears to be solid. |
|
| @stgatilov: Is this fixable via changes to the physics code? If not, this should just be another asset fix tracker. | |
| Still reproducible in 2.11 | |
|
Still reproducible in 2.13 Dev 10800. Strangely variable. In one case I was able to watch the levitation reach the ceiling when another instance it stopped mid-air at ankle height... |
|
|
The attached patch resolves this tdm_1073_collision_restitution.patch (1,242 bytes)
--- a/game/physics/Physics_RigidBody.cpp
+++ b/game/physics/Physics_RigidBody.cpp
@@ -500,12 +500,25 @@
// velocity in normal direction
vel = velocity * collision.c.normal;
- if ( vel > -OLD_STOP_SPEED ) // grayman #3452 - was STOP_SPEED
+ // Do not inject a minimum impulse into slow or separating contacts.
+ // The old code used OLD_STOP_SPEED as a fixed positive impulse whenever
+ // the approach speed was below the threshold. That adds energy even when
+ // the bodies are already separating (vel > 0), and can make resting
+ // moveables repeatedly bounce/levitate as gravity re-establishes contact.
+ if ( vel >= 0.0f )
{
- impulseNumerator = OLD_STOP_SPEED;
+ // The bodies are separating (or have no relative normal motion).
+ impulseNumerator = 0.0f;
+ }
+ else if ( vel > -OLD_STOP_SPEED )
+ {
+ // Low-speed impact: remove the incoming normal velocity without
+ // applying restitution or adding artificial kinetic energy.
+ impulseNumerator = -vel;
}
else
{
+ // Normal restitution for a sufficiently fast impact.
impulseNumerator = -( 1.0f + bouncyness ) * vel;
}
impulseDenominator = inverseMass + ( ( inverseWorldInertiaTensor * r.Cross( collision.c.normal ) ).Cross( r ) * collision.c.normal );
|
|
|
I believe this is exactly the issue of 0003452. Except that 0003452 was a regression from bumping the velocity tolerance, and Grayman resolved it by reverting the tolerance back. I have a pretty strong fear that this change will cause objects to penetrate into each other. Especially when there is a pile of moveables that player messes with, so the all the objects are close to each other and they are trying to slow down to rest. The reason is that the engine expects all objects to be at distance >= CONTACT_EPSILON = 0.25 from each other. If the objects collide and stop at much closer distance, then they will fall through each other when you move them again. This patch has actually two parts: 1) If objects are already separating, don't change their velocity. 2) If the objects are penetrating at slow speed, change their velocity so that it becomes zero after impact. Also note that an object may have several collisions at once, in which case all these individual impulses are summed together. The part 1 looks OK. It can become a problem only for a very low separation speed, which hopefully happens rarely. The part 2 looks especially troublesome, since it tells those "coming to rest" objects to stop without pushing away from each other (well, if we assume no simultaneous collisions). By the way, if you just want to avoid extra pushout, then you can simply delete the case vel > -OLD_STOP_SPEED. Then objects will not stop immediately on slow collision, but they will bounce away naturally: the pushout will be at least enough to stop penetration, and even more than that. But it is most likely not enough to stop falling through, otherwise I guess ID guys wouldn't have added this case. UPDATE: Actually, the reliable pushout would look something like: impulseNumerator = -( 1.0f + bouncyness ) * vel; // normal pushout impulseNumerator = max( impulseNumerator, OLD_STOP_SPEED - vel, 0 ); // make sure separation speed will become at least OLD_STOP_SPEED |
|
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 03.09.2008 09:16 | Ishtvan | New Issue | |
| 03.09.2008 17:14 | Ishtvan | Description Updated | |
| 03.09.2008 17:15 | Ishtvan | Description Updated | |
| 09.10.2017 14:03 | nbohr1more | Relationship added | related to 0000665 |
| 09.10.2017 14:06 | nbohr1more | Relationship added | related to 0004435 |
| 09.10.2017 21:40 | nbohr1more | Relationship added | related to 0003543 |
| 10.10.2017 01:53 | nbohr1more | Note Added: 0009442 | |
| 28.03.2018 09:14 |
|
Note Added: 0010185 | |
| 31.12.2020 03:58 | nbohr1more | Note Added: 0013325 | |
| 01.01.2021 18:59 | nbohr1more | Note Added: 0013342 | |
| 14.12.2022 02:54 | nbohr1more | Note Added: 0015560 | |
| 10.02.2024 14:13 | nbohr1more | Relationship added | related to 0006483 |
| 15.06.2024 19:33 | nbohr1more | Note Added: 0016742 | |
| 15.06.2024 19:33 | nbohr1more | File Added: closemouthed_shadows (2024-06-15 15-23-18) (-226.07 -549.72 -83.75).jpg | |
| 15.06.2024 19:33 | nbohr1more | File Added: closemouthed_shadows (2024-06-15 15-28-17) (-253.75 -527.1 -117.75).jpg | |
| 06.12.2026 00:31 | nbohr1more | Note Added: 0017419 | |
| 06.12.2026 00:31 | nbohr1more | File Added: tdm_1073_collision_restitution.patch | |
| 06.12.2026 13:21 | stgatilov | Relationship added | related to 0003452 |
| 06.12.2026 13:56 | stgatilov | Note Added: 0017431 | |
| 06.12.2026 13:56 | stgatilov | Note Edited: 0017431 | |
| 06.12.2026 13:57 | stgatilov | Note Edited: 0017431 | |
| 06.12.2026 14:00 | stgatilov | Note Edited: 0017431 | |
| 06.12.2026 14:01 | stgatilov | Note Edited: 0017431 |