misyltoad / VPhysics-Jolt

Volt (VPhysics Jolt) is a replacement physics module for the Source Engine.
MIT License
1.25k stars 69 forks source link

Half-Life 2 saw behaviour missing #22

Open SquirrelKiev opened 2 years ago

SquirrelKiev commented 2 years ago

In Half-Life 2, shooting a sawblade at a wall will embed the saw into the wall slightly. With Jolt, this is not the case. The saw also doesn't cut through zombies.

Tested on Garry's Mod with models/props_junk/sawblade001a.mdl.

henkeswe commented 2 years ago

Looks like GetSurfaceNormal() is returning inverted surface normals which breaks this feature.

misyltoad commented 1 month ago

From the code:

            // Slart: Note this negated vector, it is important, Portal 2 bouncy paint needs it negated otherwise things fly into the surface they hit
            , m_SurfaceNormal( -Vector( inManifold.mWorldSpaceNormal.GetX(), inManifold.mWorldSpaceNormal.GetY(), inManifold.mWorldSpaceNormal.GetZ() ) )

You are referring to IPhysicsCollisionData's GetSurfaceNormal, right?