@@ -125,13 +125,13 @@ void CFreeController::Update()
125125 // adjustment to match the ground slope
126126 float autoTiltVel = 0 .0f ;
127127 if (gndLock && (autoTilt > 0 .0f )) {
128- const float gndHeight = ground-> GetHeightReal (pos.x , pos.z , false );
128+ const float gndHeight = CGround:: GetHeightReal (pos.x , pos.z , false );
129129 if (pos.y < (gndHeight + gndOffset + 1 .0f )) {
130130 float3 hDir;
131131 hDir.y = 0 .0f ;
132132 hDir.x = (float )math::sin (camera->rot .y );
133133 hDir.z = (float )math::cos (camera->rot .y );
134- const float3 gndNormal = ground-> GetSmoothNormal (pos.x , pos.z , false );
134+ const float3 gndNormal = CGround:: GetSmoothNormal (pos.x , pos.z , false );
135135 const float dot = gndNormal.dot (hDir);
136136 const float gndRotX = (float )math::acos (dot) - (PI * 0 .5f );
137137 const float rotXdiff = (gndRotX - camera->rot .x );
@@ -165,9 +165,9 @@ void CFreeController::Update()
165165 const float dGrav = (gravity * ft);
166166 vel.y += dGrav;
167167 if (slide > 0 .0f ) {
168- const float gndHeight = ground-> GetHeightReal (pos.x , pos.z , false );
168+ const float gndHeight = CGround:: GetHeightReal (pos.x , pos.z , false );
169169 if (pos.y < (gndHeight + gndOffset + 1 .0f )) {
170- const float3 gndNormal = ground-> GetSmoothNormal (pos.x , pos.z , false );
170+ const float3 gndNormal = CGround:: GetSmoothNormal (pos.x , pos.z , false );
171171 const float dotVal = gndNormal.y ;
172172 const float scale = (dotVal * slide * -dGrav);
173173 vel.x += (gndNormal.x * scale);
@@ -217,7 +217,7 @@ void CFreeController::Update()
217217 }
218218
219219 // setup ground lock
220- const float gndHeight = ground-> GetHeightReal (pos.x , pos.z , false );
220+ const float gndHeight = CGround:: GetHeightReal (pos.x , pos.z , false );
221221
222222 if (KeyInput::GetKeyModState (KMOD_SHIFT)) {
223223 if (ctrlVelY > 0 .0f ) {
@@ -361,7 +361,7 @@ void CFreeController::MouseWheelMove(float move)
361361
362362void CFreeController::SetPos (const float3& newPos)
363363{
364- const float h = ground-> GetHeightReal (newPos.x , newPos.z , false );
364+ const float h = CGround:: GetHeightReal (newPos.x , newPos.z , false );
365365 const float3 target = float3 (newPos.x , h, newPos.z );
366366// const float3 target = newPos;
367367 const float yDiff = pos.y - target.y ;
@@ -375,7 +375,7 @@ void CFreeController::SetPos(const float3& newPos)
375375 CCameraController::SetPos(newPos);
376376 pos.y = oldPosY;
377377 if (gndOffset != 0.0f) {
378- const float h = ground-> GetHeightReal(pos.x, pos.z, false);
378+ const float h = CGround:: GetHeightReal(pos.x, pos.z, false);
379379 const float absH = h + math::fabsf(gndOffset);
380380 if (pos.y < absH) {
381381 pos.y = absH;
@@ -391,7 +391,7 @@ float3 CFreeController::SwitchFrom() const
391391{
392392 const float x = max (0 .1f , min (float3::maxxpos - 0 .1f , pos.x ));
393393 const float z = max (0 .1f , min (float3::maxzpos - 0 .1f , pos.z ));
394- return float3 (x, ground-> GetHeightAboveWater (x, z, false ) + 5 .0f , z);
394+ return float3 (x, CGround:: GetHeightAboveWater (x, z, false ) + 5 .0f , z);
395395}
396396
397397
0 commit comments