12 [
Attribute(defvalue:
"5",
desc:
"Below this height, camera copies terrain height precisely.")]
13 private int m_fATLMinHeight;
15 [
Attribute(defvalue:
"50",
desc:
"When the camera is above this height, it moves ASL, not ATL.")]
16 private int m_fATLMaxHeight;
25 vector pos = param.transform[3];
26 float height = pos[1] - Math.Max(param.world.GetSurfaceY(pos[0], pos[2]), 0);
29 if (height > m_fATLMaxHeight)
33 vector posOrig = param.transformOriginal[3];
34 float heightOrig = posOrig[1] - Math.Max(param.world.GetSurfaceY(posOrig[0], posOrig[2]), 0);
37 float progress = Math.InverseLerp(m_fATLMinHeight, m_fATLMaxHeight, height);
38 float heightInterpolated = Math.Lerp(heightOrig - height, 0, progress);
42 if (param.isManualInput)
43 inputDiff = pos[1] - posOrig[1];
46 pos[1] = pos[1] + heightInterpolated + inputDiff;
47 param.transform[3] = pos;
51 override bool EOnCameraInit()