All IG code should use the interface of LocatedEntity when dealing
with any entity, rather than sometimes requiring Entity. Add virtual
functions to the interface where required, and modify all other interfaces
to stop them using Entity. This makes the code way cleaner, and much better
de-coupled.
* rulesets/Movement.h, rulesets/Pedestrian.cpp, rulesets/Pedestrian.h:
Change the movement API so update Location is const when passed to
generateMove.
* common/PropertyManager.h, rulesets/Movement.h,
rulesets/Pedestrian.cpp, server/EntityFactory.h, server/Peer.cpp,
server/Peer.h, server/PersistantThingFactory.h, server/Player.cpp:
Fill out some more doc comments, and add some more FIXME notes.
* common/log.cpp, common/log.h: Switch to taking a C++ string reference
rather than a char *, as it is not really an optimisation, and it
makes the code simpler to read and write.
* client/BaseClient.cpp, client/ClientConnection.cpp,
common/AtlasFileLoader.cpp, common/BaseEntity.cpp,
common/Database.cpp, common/globals.cpp, common/id.cpp,
common/inheritance.cpp, common/log.cpp, common/log.h,
rulesets/Character.cpp, rulesets/Creator.cpp, rulesets/Entity.cpp,
rulesets/MemMap.cpp, rulesets/Motion.cpp, rulesets/Pedestrian.cpp,
rulesets/Py_Object.cpp, rulesets/Py_RootEntity.cpp,
rulesets/PythonMindScript.cpp, rulesets/PythonThingScript.cpp,
rulesets/Python_API.cpp, rulesets/Thing.cpp, server/Account.cpp,
server/Admin.cpp, server/ArithmeticFactory.cpp,
server/CommClient.cpp, server/CommListener.cpp,
server/CommMDNSPublisher.cpp, server/CommServer.cpp,
server/Connection.cpp, server/EntityFactory.cpp,
server/Persistance.cpp, server/Restoration.cpp,
server/ScriptFactory.cpp, server/TaskFactory.cpp,
server/WorldRouter.cpp, server/server.cpp: Convert over to using
new API correctly.
* data/mason.xml: Add biomass and transient to fircone, making its
script obsolete:
* rulesets/Character.cpp, rulesets/Creator.cpp, rulesets/Entity.cpp,
rulesets/Entity.h, rulesets/Pedestrian.cpp, rulesets/Py_Thing.cpp,
rulesets/Stackable.cpp, rulesets/Thing.cpp, rulesets/World.cpp:
Remove m_world member variable from all Entity classes, and
access the world manager object as a singleton.
* rulesets/Thing.cpp: Implement basic movement updates.
* rulesets/Pedestrian.cpp: Disable updatePos as it is no longer
required.
* TODO: Add notes on further refactoring of movement code.
* common/const.h: Add new constant for period between movement updates.
* rulesets/Pedestrian.cpp: Don't update entity movement timestamp
here.
* rulesets/Thing.cpp: Add comments about movement code. Update
movement timestamp when move op is handled. Use movement update
interval for update ops.
* rulesets/Movement.cpp: Ensure collision position is invalidated
once a collision isn't done.
* rulesets/Pedestrian.cpp: Add some assert checks. Ensure that
m_updatedPos is always valid. Add a check for a race condition
where a collision is predicted, and the tick that should trigger
it occurs, but another move request arrives from the client
before the update Move op has been applied to the entity.
* rulesets/Movement.cpp: Reset stored positions more efficiently.
* rulesets/Pedestrian.cpp: Improve error reporting when a bad
collision occurs. Reset the coordinates, so that character does
not teleport to origin when a strange collision happens.
* rulesets/Movement.h, rulesets/Movement.cpp,
rulesets/Pedestrian.h, rulesets/Pedestrian.cpp: When processing
a move operation, if its going to cause an immediate collision,
set the velocity to 0.
* configure.ac: Increment version.
* rulesets/Movement.h, rulesets/Movement.cpp: Add a flag to indicate
if movement has been diverted by a collision.
* rulesets/Pedestrian.cpp: Use flag to ensure that entities moving
towards a target position that are diverted by a collision
don't just snap to their original destination. When collision errors
are detected, don't mess the entities position up by changing it.
* tests/Makefile.am: Fix broken tests.
* rulesets/Movement.cpp: Reset the collision LOC change flag before
running the check.
* rulesets/Pedestrian.cpp: Improve debug reporting of collision
errors.
* rulesets/Pedestrian.cpp, rulesets/Movement.h, rulesets/Movement.cpp:
Store the time of the last collision, and if the next one occurs
almost immediatly, stop the movement. This eliminates the judder
which used to occur in some nasty collision scenarios.
* modules/Location.cpp, modules/Location.h:
Add const accessors for location data, in preparation for
adding cached collision data which must be updated every
time data is modified.
* physics/Collision.cpp, rulesets/Character.cpp, rulesets/Entity.cpp,
rulesets/Entity.h, rulesets/MemMap.cpp, rulesets/Movement.cpp,
rulesets/Pedestrian.cpp, rulesets/Plant.cpp,
rulesets/Py_Location.cpp, rulesets/Thing.cpp, rulesets/World.cpp,
server/Account.cpp, server/EntityFactory.cpp, server/Persistor.cpp,
server/Persistor_impl.h, server/Restorer_impl.h,
server/WorldRouter.cpp, tests/Locationtest.cpp:
Use the const accessors whenver reading data from Location.
* common/const.cpp, common/const.h: Git rid of bizare scheme
where each constant appears twice, debug and non-debug versions.
* rulesets/Pedestrian.cpp, rulesets/Thing.cpp,
server/WorldRouter.cpp: Fix problem where an essential call
was inside an assert, so did not happen when built in non-debug
mode.
* common/AtlasFileLoader.cpp, common/Database.cpp,
common/FormattedXMLWriter.cpp, common/Property.cpp,
common/accountbase.cpp, rulesets/Character.cpp,
rulesets/Entity_getLocation.h, rulesets/MemMap.cpp,
rulesets/Pedestrian.cpp, rulesets/Plant.cpp,
rulesets/Py_Object.cpp, rulesets/Thing.cpp,
server/Admin.cpp, server/Connection.cpp, server/EntityFactory.cpp,
server/WorldRouter.cpp, tools/AdminClient.cpp, tools/cycmd.cpp,
tools/cyconvertrules.cpp: After an Element has been checked
with isFoo(), it is more efficient to get its value using Foo()
rather than asFoo() which repeats the check.
* rulesets/Pedestrian.cpp: Remove some debug output.
* server/WorldRouter.cpp: Tweak the order of dispatch.
* cyphesis.spec.in: Clean up the dependencies in the spec.
* configure.ac: Increment version to 0.3.11.
* NEWS: Update news item.
* Makefile.am: Fix rule that tweaks temp dir prefix so it works
when destination directory is overriden.
* Release 0.3.11
* modules/Location.h, rulesets/Pedestrian.cpp, rulesets/Thing.cpp,
server/WorldRouter.cpp: Store the last movement update time
in location, so it can be used for interpolation elsewhere.
Don't yet update it in the main Move code is this causes movement
jitter.
* rulesets/Pedestrian.cpp: Apply z coord constraints after doing
movement interpolation. If the character is immersed in water
then set the mode to swimming.
* rulesets/Movement.h, rulesets/Pedestrian.h, rulesets/Movement.cpp,
rulesets/Pedestrian.cpp: Get rid of m_collAxis as it was unused.
Add velocity to the interface of getTickAddition to avoid using
the redundant m_velocity member of Movement. Fix calculation
of velocity magnitude in new movement code. Correctly set
velocity to zero when movement reaches its target.
* rulesets/Character.cpp: Add alternative movement processing
code based on the new mathods in Pedestrian.
* rulesets/Movement.h, rulesets/Pedestrian.h, rulesets/Pedestrian.cpp:
Add a return value to getUpdatedLocation to indicate whether an
update was necessary or not.
* rulesets/Character.cpp: Add some notes on how this code could be
adapted to Use the new Movement code.
* rulesets/Movement.h, rulesets/Pedestrian.h, rulesets/Pedestrian.cpp:
Add a new method to the movement interface which determines the
updated location of an entity when movement needs to be handled.
* rulesets/Character.cpp, rulesets/Movement.cpp, rulesets/Movement.h,
rulesets/Pedestrian.cpp: Rename some variables to make the code
more comprehensible.
* modules/Location.cpp, physics/Collision.cpp, rulesets/Character.cpp,
rulesets/Entity.cpp, rulesets/Movement.cpp, rulesets/Movement.h,
rulesets/Pedestrian.cpp: Make sure orientation is not used if it
is not valid.
* common/const.cpp: Turn off persistence again by default.
* rulesets/Pedestrian.cpp: Update collision resolution to
transform velocity and orientation when parent changes.
* physics/Vector3D.h, physics/Vector3D.cpp, modules/Location.h,
modules/Location.cpp: Convert to using WFMath::Point instead of
WFMath::Vector for position.
* physics/Collision.h, physics/Collision.cpp: Update collision code
to use new pos type.
* rulesets/Py_Point3D.h, rulesets/Py_Point3D.cpp: New python
wrappers for WFMath::Point.
* rulesets/Py_Location.cpp, rulesets/Py_Vector3D.cpp,
rulesets/Python_API.cpp:
Update python wrappers to take into account new pos type.
Ensure that only apropriate functionality is available for
point and vector.
* rulesets/Character.cpp, rulesets/Entity.cpp, rulesets/Entity.h,
rulesets/Line.cpp, rulesets/Movement.cpp, rulesets/Movement.h,
rulesets/Pedestrian.cpp, rulesets/Pedestrian.h,
rulesets/Plant.cpp, rulesets/Thing.cpp, rulesets/World.cpp,
server/EntityFactory.cpp, server/WorldRouter.cpp,
server/WorldRouter.h: Update the rest of the code for new pos
type, converting all places where entity parenting is changed
to use WFMath toParentCoords() and toLocalCoords() methods,
so that orientation is handled correctly.
* tests/transformtest.cpp: New test to ensure that toParentCoords()
and toLocalCoords() perform as expected.
* tests/Creatortest.cpp, tests/Locationtest.cpp, tests/Worldtest.cpp,
tests/collisiontest.cpp, tests/emergencetest.cpp:
Update the rest of the tests.