16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-21 11:19:19 +02:00

engine revolution based cab shake configuration support, rear cab door controls animation fix

This commit is contained in:
tmj-fstate
2018-02-24 02:38:02 +01:00
parent 89f76ff0e2
commit f3b7198246
5 changed files with 70 additions and 72 deletions

View File

@@ -11,9 +11,8 @@ http://mozilla.org/MPL/2.0/.
#define ParticlesH
#include "dumb3d.h"
/*
#define STATIC_THRESHOLD 0.17f
// efine STATIC_THRESHOLD 0.03f
const double m_Kd = 0.02f; // DAMPING FACTOR
const double m_Kr = 0.8f; // 1.0 = SUPERBALL BOUNCE 0.0 = DEAD WEIGHT
const double m_Ksh = 5.0f; // HOOK'S SPRING CONSTANT
@@ -21,22 +20,20 @@ const double m_Ksd = 0.1f; // SPRING DAMPING CONSTANT
const double m_Csf = 0.9f; // Default Static Friction
const double m_Ckf = 0.7f; // Default Kinetic Friction
*/
class TSpring {
class TSpring
{
public:
TSpring();
~TSpring();
public:
TSpring() = default;
// void Init(TParticnp1, TParticle *np2, double nKs= 0.5f, double nKd= 0.002f,
// double nrestLen= -1.0f);
void Init(double nrestLen, double nKs = 0.5f, double nKd = 0.002f);
void Init(double nKs = 0.5f, double nKd = 0.002f);
Math3D::vector3 ComputateForces( Math3D::vector3 const &pPosition1, Math3D::vector3 const &pPosition2);
void Render();
Math3D::vector3 vForce1, vForce2;
double restLen; // LENGTH OF SPRING AT REST
double Ks; // SPRING CONSTANT
double Kd; // SPRING DAMPING
private:
private:
// members
double restLen { 0.01 }; // LENGTH OF SPRING AT REST
double Ks { 0.0 }; // SPRING CONSTANT
double Kd { 0.0 }; // SPRING DAMPING
};
//---------------------------------------------------------------------------