HPL1: remove global variable

This commit is contained in:
grisenti
2022-12-23 14:04:23 +01:00
committed by Eugene Sandulenko
parent b6c650c320
commit ec8cd95382
2 changed files with 8 additions and 8 deletions
@@ -430,14 +430,13 @@ void cPhysicsBodyNewton::OnTransformCallback(const NewtonBody *apBody, const dFl
//-----------------------------------------------------------------------
// callback for buoyancy
static cPlanef gSurfacePlane;
static int BuoyancyPlaneCallback(const int alCollisionID, void *apContext,
int cPhysicsBodyNewton::BuoyancyPlaneCallback(const int alCollisionID, void *apContext,
const float *afGlobalSpaceMatrix, float *afGlobalSpacePlane) {
afGlobalSpacePlane[0] = gSurfacePlane.a;
afGlobalSpacePlane[1] = gSurfacePlane.b;
afGlobalSpacePlane[2] = gSurfacePlane.c;
afGlobalSpacePlane[3] = gSurfacePlane.d;
cPlanef surfacePlane = static_cast<cPhysicsBodyNewton*>(apContext)->mBuoyancy.mSurface;
afGlobalSpacePlane[0] = surfacePlane.a;
afGlobalSpacePlane[1] = surfacePlane.b;
afGlobalSpacePlane[2] = surfacePlane.c;
afGlobalSpacePlane[3] = surfacePlane.d;
return 1;
}
@@ -461,7 +460,6 @@ void cPhysicsBodyNewton::OnUpdateCallback(NewtonBody *apBody, float, int) {
// Create Buoyancy
if (pRigidBody->mBuoyancy.mbActive) {
gSurfacePlane = pRigidBody->mBuoyancy.mSurface;
VEC3_CONST_ARRAY(gravity, vGravity);
NewtonBodyAddBuoyancyForce(apBody,
pRigidBody->mBuoyancy.mfDensity,
@@ -101,6 +101,8 @@ public:
static void SetUseCallback(bool abX) { mbUseCallback = abX; }
private:
static int BuoyancyPlaneCallback(const int alCollisionID, void *apContext,
const float *afGlobalSpaceMatrix, float *afGlobalSpacePlane);
static void OnTransformCallback(const NewtonBody *apBody, const dFloat *apMatrix, int);
static void OnUpdateCallback(NewtonBody *apBody, float, int);