Reverted some of bad commit (10853) because I hit the wrong button
This was SVN commit r10854.
This commit is contained in:
parent
a4e1f3c292
commit
fa37c9b441
@ -66,7 +66,7 @@ public:
|
||||
// Dynamic state:
|
||||
|
||||
bool m_InWorld;
|
||||
entity_pos_t m_X, m_Z, m_LastX, m_LastZ, m_PrevX, m_PrevZ; // these values contain undefined junk if !InWorld
|
||||
entity_pos_t m_X, m_Z, m_LastX, m_LastZ; // these values contain undefined junk if !InWorld
|
||||
entity_pos_t m_YOffset;
|
||||
bool m_RelativeToGround; // whether m_YOffset is relative to terrain/water plane, or an absolute height
|
||||
|
||||
@ -203,8 +203,6 @@ public:
|
||||
m_InWorld = true;
|
||||
m_LastX = m_X;
|
||||
m_LastZ = m_Z;
|
||||
m_PrevX = m_X;
|
||||
m_PrevZ = m_Z;
|
||||
}
|
||||
|
||||
AdvertisePositionChanges();
|
||||
@ -212,8 +210,8 @@ public:
|
||||
|
||||
virtual void JumpTo(entity_pos_t x, entity_pos_t z)
|
||||
{
|
||||
m_LastX = m_PrevX = m_X = x;
|
||||
m_LastZ = m_PrevZ = m_Z = z;
|
||||
m_LastX = m_X = x;
|
||||
m_LastZ = m_Z = z;
|
||||
m_InWorld = true;
|
||||
|
||||
AdvertisePositionChanges();
|
||||
@ -280,43 +278,6 @@ public:
|
||||
return CFixedVector2D(m_X, m_Z);
|
||||
}
|
||||
|
||||
virtual CFixedVector3D GetPreviousPosition()
|
||||
{
|
||||
if (!m_InWorld)
|
||||
{
|
||||
LOGERROR(L"CCmpPosition::GetPreviousPosition called on entity when IsInWorld is false");
|
||||
return CFixedVector3D();
|
||||
}
|
||||
|
||||
entity_pos_t baseY;
|
||||
if (m_RelativeToGround)
|
||||
{
|
||||
CmpPtr<ICmpTerrain> cmpTerrain(GetSimContext(), SYSTEM_ENTITY);
|
||||
if (!cmpTerrain.null())
|
||||
baseY = cmpTerrain->GetGroundLevel(m_PrevX, m_PrevZ);
|
||||
|
||||
if (m_Floating)
|
||||
{
|
||||
CmpPtr<ICmpWaterManager> cmpWaterMan(GetSimContext(), SYSTEM_ENTITY);
|
||||
if (!cmpWaterMan.null())
|
||||
baseY = std::max(baseY, cmpWaterMan->GetWaterLevel(m_PrevX, m_PrevZ));
|
||||
}
|
||||
}
|
||||
|
||||
return CFixedVector3D(m_PrevX, baseY + m_YOffset, m_PrevZ);
|
||||
}
|
||||
|
||||
virtual CFixedVector2D GetPreviousPosition2D()
|
||||
{
|
||||
if (!m_InWorld)
|
||||
{
|
||||
LOGERROR(L"CCmpPosition::GetPreviousPosition2D called on entity when IsInWorld is false");
|
||||
return CFixedVector2D();
|
||||
}
|
||||
|
||||
return CFixedVector2D(m_PrevX, m_PrevZ);
|
||||
}
|
||||
|
||||
virtual void TurnTo(entity_angle_t y)
|
||||
{
|
||||
m_RotY = y;
|
||||
@ -447,9 +408,6 @@ public:
|
||||
}
|
||||
case MT_TurnStart:
|
||||
{
|
||||
m_PrevX = m_LastX;
|
||||
m_PrevZ = m_LastZ;
|
||||
|
||||
m_LastX = m_X;
|
||||
m_LastZ = m_Z;
|
||||
|
||||
|
@ -32,8 +32,6 @@ DEFINE_INTERFACE_METHOD_1("SetHeightFixed", void, ICmpPosition, SetHeightFixed,
|
||||
DEFINE_INTERFACE_METHOD_0("IsFloating", bool, ICmpPosition, IsFloating)
|
||||
DEFINE_INTERFACE_METHOD_0("GetPosition", CFixedVector3D, ICmpPosition, GetPosition)
|
||||
DEFINE_INTERFACE_METHOD_0("GetPosition2D", CFixedVector2D, ICmpPosition, GetPosition2D)
|
||||
DEFINE_INTERFACE_METHOD_0("GetPreviousPosition", CFixedVector3D, ICmpPosition, GetPreviousPosition)
|
||||
DEFINE_INTERFACE_METHOD_0("GetPreviousPosition2D", CFixedVector2D, ICmpPosition, GetPreviousPosition2D)
|
||||
DEFINE_INTERFACE_METHOD_1("TurnTo", void, ICmpPosition, TurnTo, entity_angle_t)
|
||||
DEFINE_INTERFACE_METHOD_1("SetYRotation", void, ICmpPosition, SetYRotation, entity_angle_t)
|
||||
DEFINE_INTERFACE_METHOD_2("SetXZRotation", void, ICmpPosition, SetXZRotation, entity_angle_t, entity_angle_t)
|
||||
|
@ -108,19 +108,6 @@ public:
|
||||
*/
|
||||
virtual CFixedVector2D GetPosition2D() = 0;
|
||||
|
||||
/**
|
||||
* Returns the previous turn's x,y,z position (no interpolation).
|
||||
* Depends on the current terrain heightmap.
|
||||
* Must not be called unless IsInWorld is true.
|
||||
*/
|
||||
virtual CFixedVector3D GetPreviousPosition() = 0;
|
||||
|
||||
/**
|
||||
* Returns the previous turn's x,z position (no interpolation).
|
||||
* Must not be called unless IsInWorld is true.
|
||||
*/
|
||||
virtual CFixedVector2D GetPreviousPosition2D() = 0;
|
||||
|
||||
/**
|
||||
* Rotate smoothly to the given angle around the upwards axis.
|
||||
* @param y clockwise radians from the +Z axis.
|
||||
|
@ -146,8 +146,8 @@ function refresh_thread(thread, callback_data)
|
||||
|
||||
function rebuild_canvases()
|
||||
{
|
||||
g_data.canvas_frames = $('<canvas width="1400" height="180"></canvas>').get(0);
|
||||
g_data.canvas_zoom = $('<canvas width="1400" height="180"></canvas>').get(0);
|
||||
g_data.canvas_frames = $('<canvas width="1600" height="128"></canvas>').get(0);
|
||||
g_data.canvas_zoom = $('<canvas width="1600" height="128"></canvas>').get(0);
|
||||
g_data.text_output = $('<pre></pre>').get(0);
|
||||
|
||||
set_frames_zoom_handlers(g_data.canvas_frames);
|
||||
|
Loading…
Reference in New Issue
Block a user