summaryrefslogtreecommitdiff
path: root/public/vphysics/friction.h
diff options
context:
space:
mode:
authorFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
committerFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
commit3bf9df6b2785fa6d951086978a3e66f49427166a (patch)
tree2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /public/vphysics/friction.h
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'public/vphysics/friction.h')
-rw-r--r--public/vphysics/friction.h51
1 files changed, 51 insertions, 0 deletions
diff --git a/public/vphysics/friction.h b/public/vphysics/friction.h
new file mode 100644
index 0000000..f8d6bd6
--- /dev/null
+++ b/public/vphysics/friction.h
@@ -0,0 +1,51 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+//=============================================================================//
+
+#ifndef FRICTION_H
+#define FRICTION_H
+#ifdef _WIN32
+#pragma once
+#endif
+
+// NOTE: This is an iterator for the contact points on an object
+// NOTE: This should only be used temporarily. Holding one of these
+// NOTE: across collision callbacks or calls into simulation will cause errors!
+// NOTE: VPHYSICS may choose to make the data contained within this object invalid
+// NOTE: any time simulation is run.
+class IPhysicsFrictionSnapshot
+{
+public:
+ virtual ~IPhysicsFrictionSnapshot() {}
+
+ virtual bool IsValid() = 0;
+
+ // Object 0 is this object, Object 1 is the other object
+ virtual IPhysicsObject *GetObject( int index ) = 0;
+ virtual int GetMaterial( int index ) = 0;
+
+ virtual void GetContactPoint( Vector &out ) = 0;
+
+ // points away from source object
+ virtual void GetSurfaceNormal( Vector &out ) = 0;
+ virtual float GetNormalForce() = 0;
+ virtual float GetEnergyAbsorbed() = 0;
+
+ // recompute friction (useful if dynamically altering materials/mass)
+ virtual void RecomputeFriction() = 0;
+ // clear all friction force at this contact point
+ virtual void ClearFrictionForce() = 0;
+
+ virtual void MarkContactForDelete() = 0;
+ virtual void DeleteAllMarkedContacts( bool wakeObjects ) = 0;
+
+ // Move to the next friction data for this object
+ virtual void NextFrictionData() = 0;
+ virtual float GetFrictionCoefficient() = 0;
+};
+
+
+
+#endif // FRICTION_H