This change of rounding method seems to have caused some 'sticky'
movement across surfaces in certain orientations. Don't understand why
as yet, but revert for now.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
There is still a reference to the global physent stack hidden in
Cam_DoTrace, but at least we can get rid of all references to pmove.
Renamed some local variables for better clarity and replaced the
re-implementation of vector length vlen() with Length() from mathlib.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
Eliminates direct references to the global pestack from pmove.c. As a
bonus, all passed in references are const.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
The information about physents is kind of separate from the rest of
the player move information - it is also set up before doing
movement/prediction and should be read-only during those calculations.
Most places now get a pointer to the "pestack" (kind of a stack due to
adding player entities to the top and popping them off again) passed
in rather than referring to the global data directly.
Still kind of a mess, but should be able to clean up further from
here.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
To quick to put in the VectorMA where it doesn't belong.
Still, this makes me curious why the nudge is necessary so often...
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
On each invocation of CL_SetSolidEntities, the previous state gets
overwritten, so only the last call matters. So it should be safe to
lift out from CL_ParseServerMessage, then out of the loop in
CL_ReadPackets and finally up into Host_Frame in cl_main.c.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
Slightly modified the behaviour of this function. Previously it would
always round to the nearest 1/8th coordinate towards zero, whereas now
I round to the nearest coordinate. Also, there would previously always
be at least one nudge, but I test the position once before starting
that process.
Hopefully, haven't broken any weird behaviour that depends on
this. Got to be careful when dealing with the physics of Quake!
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
Now cl_cam.c does not refer to the global pmove, and Cam_Track is the
single point of entry. Now to see what other dependencies might be
hiding around the palce - maybe it can be localised further...
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
Some inefficiency due to extra unneeded calculations, but at least
reducing the global state dependencies. Will optimise later.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
All the Quakeworld client pmove trace functions seem to be pretty much
identical to the server ones originally from world.c, so shared all
the bits which are common and remove that duplicated code.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
This neatly cleans up a makefile hack since now all targets use the
ASM implementation of Mod_HullPointContents. Removes a bunch of
duplicated code and also make Pmove_Init unneccessary.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
We initialise the shared clipnodes statically and only provide const
pointers to them. We then provide a const template for the planes and
hull which can be quickly memcpy'd and just the planes pointer + plane
dists updated.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
Now that the edict member of trace_t has been extracted, hull testing
has only to do with the models and not the server, so we can move them
into model.c. Functions renamed:
* SV_HullPointContents -> Mod_HullPointContents
* SV_RecursiveHullCheck -> Mode_TraceHull
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>