From: <Kha...@us...> - 2009-12-01 19:29:09
|
Revision: 4859 http://planeshift.svn.sourceforge.net/planeshift/?rev=4859&view=rev Author: Khakilord Date: 2009-12-01 19:29:00 +0000 (Tue, 01 Dec 2009) Log Message: ----------- Forgot to commit part of r4855. Modified Paths: -------------- trunk/src/common/util/pspath.cpp trunk/src/common/util/pspath.h Modified: trunk/src/common/util/pspath.cpp =================================================================== --- trunk/src/common/util/pspath.cpp 2009-12-01 18:03:00 UTC (rev 4858) +++ trunk/src/common/util/pspath.cpp 2009-12-01 19:29:00 UTC (rev 4859) @@ -686,10 +686,15 @@ GetInterpolatedPosition (pos); GetInterpolatedUp (up); GetInterpolatedForward (look); - - movable->GetTransform().SetOrigin (pos); + + // Update Y for paths that go uphill/downhill. + csVector3 last_pos = movable->GetTransform().GetOrigin (); + last_pos.y = pos.y; + movable->GetTransform().SetOrigin(last_pos); + + // Set rotation. movable->GetTransform().LookAt( - look.Unit (), up.Unit ()); + look.Unit (), up.Unit ()); movable->UpdateMove (); return true; Modified: trunk/src/common/util/pspath.h =================================================================== --- trunk/src/common/util/pspath.h 2009-12-01 18:03:00 UTC (rev 4858) +++ trunk/src/common/util/pspath.h 2009-12-01 19:29:00 UTC (rev 4859) @@ -221,6 +221,7 @@ csArray<float> dz; }; +// Warning: This is BROKEN and does not work across sectors. class psPathAnchor { public: @@ -240,7 +241,8 @@ virtual void GetInterpolatedForward (csVector3& forward); /// Extrapolate the movable delta distance along the path - virtual bool Extrapolate(psWorld * world, iEngine *engine, float delta, psPath::Direction direction, iMovable * movable); + /// Warning: Use ExtrapolatePosition with CD off. + virtual bool Extrapolate(psWorld * world, iEngine *engine, float delta, psPath::Direction direction, iMovable* movable); /// Get the current distance this anchor has moved along the path This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |