Post by Paril on Aug 3, 2006 8:04:58 GMT -5
Pmove clears values.. None importance to me
PM_ClampAngles makes sure angles don't go past 90 for the player
PM_FlyMove sets physics for flying stuff, clipping or not
Nothing about edge handling
PM_SnapPosition catches my attention.. Code:
/*
================
PM_SnapPosition
On exit, the origin will have a value that is pre-quantized to the 0.125
precision of the network channel and in a valid position.
================
*/
void PM_SnapPosition (void)
{
int sign[3];
int i, j, bits;
short base[3];
// try all single bits first
static int jitterbits[8] = {0,4,1,2,3,5,6,7};
// snap velocity to eigths
for (i=0 ; i<3 ; i++)
pm->s.velocity = (int)(pml.velocity*8);
for (i=0 ; i<3 ; i++)
{
if (pml.origin >= 0)
sign = 1;
else
sign = -1;
pm->s.origin = (int)(pml.origin*8);
if (pm->s.origin*0.125 == pml.origin)
sign = 0;
}
VectorCopy (pm->s.origin, base);
// try all combinations
for (j=0 ; j<8 ; j++)
{
bits = jitterbits[j];
VectorCopy (base, pm->s.origin);
for (i=0 ; i<3 ; i++)
if (bits & (1<<i) )
pm->s.origin += sign;
if (PM_GoodPosition ())
return;
}
// go back to the last position
VectorCopy (pml.previous_origin, pm->s.origin);
// Com_DPrintf ("using previous_origin\n");
}
I should debug this, and see what happens
PM_CheckDuck sets mins/maxs and viewheight
(This is where StroggDM would make it so that each class has it's own bbox.. but, would be unfair)
PM_InitialSnapPosition checks the current snap position, makes sure it's valid
PM_CatagorizePosition set groundentity, watertype, and waterlevel
PM_DeadMove makes you unable to move.. dead!
PM_CheckSpecialMovement is how it makes ladders, water-jumps work. Also, it has the code to get out of water.
I added this bit to keep the player moving when on skateboard, but it's still undefined by the DLL
// Paril, Q2PS
else if (pm->s.pm_flags & PMF_SKATEBOARDING || pm->s.pm_flags & PMF_SKAKEBOARD_NOTHOLDING)
pm->cmd.forwardmove += 200;
else if (pm->s.pm_flags & PMF_SKATEBOARDING || pm->s.pm_flags & PMF_SKAKEBOARD_HOLDING)
pm->cmd.forwardmove += 400;
// Paril
PM_StepSlideMove and PM_StepSlideMove_ makes sure the player can sidestep, and does it.
PM_CheckJump checks for jumping..
PM_Friction adds friction (Maybe I can check for it here?)
PM_WaterMove is floating in water
PM_CatagorizePosition set groundentity, watertype, and waterlevel for final spot (Check here too?)
Then does a final PM_SnapPosition at the end.
PM_ClampAngles makes sure angles don't go past 90 for the player
PM_FlyMove sets physics for flying stuff, clipping or not
Nothing about edge handling
PM_SnapPosition catches my attention.. Code:
/*
================
PM_SnapPosition
On exit, the origin will have a value that is pre-quantized to the 0.125
precision of the network channel and in a valid position.
================
*/
void PM_SnapPosition (void)
{
int sign[3];
int i, j, bits;
short base[3];
// try all single bits first
static int jitterbits[8] = {0,4,1,2,3,5,6,7};
// snap velocity to eigths
for (i=0 ; i<3 ; i++)
pm->s.velocity = (int)(pml.velocity*8);
for (i=0 ; i<3 ; i++)
{
if (pml.origin >= 0)
sign = 1;
else
sign = -1;
pm->s.origin = (int)(pml.origin*8);
if (pm->s.origin*0.125 == pml.origin)
sign = 0;
}
VectorCopy (pm->s.origin, base);
// try all combinations
for (j=0 ; j<8 ; j++)
{
bits = jitterbits[j];
VectorCopy (base, pm->s.origin);
for (i=0 ; i<3 ; i++)
if (bits & (1<<i) )
pm->s.origin += sign;
if (PM_GoodPosition ())
return;
}
// go back to the last position
VectorCopy (pml.previous_origin, pm->s.origin);
// Com_DPrintf ("using previous_origin\n");
}
I should debug this, and see what happens
PM_CheckDuck sets mins/maxs and viewheight
(This is where StroggDM would make it so that each class has it's own bbox.. but, would be unfair)
PM_InitialSnapPosition checks the current snap position, makes sure it's valid
PM_CatagorizePosition set groundentity, watertype, and waterlevel
PM_DeadMove makes you unable to move.. dead!
PM_CheckSpecialMovement is how it makes ladders, water-jumps work. Also, it has the code to get out of water.
I added this bit to keep the player moving when on skateboard, but it's still undefined by the DLL
// Paril, Q2PS
else if (pm->s.pm_flags & PMF_SKATEBOARDING || pm->s.pm_flags & PMF_SKAKEBOARD_NOTHOLDING)
pm->cmd.forwardmove += 200;
else if (pm->s.pm_flags & PMF_SKATEBOARDING || pm->s.pm_flags & PMF_SKAKEBOARD_HOLDING)
pm->cmd.forwardmove += 400;
// Paril
PM_StepSlideMove and PM_StepSlideMove_ makes sure the player can sidestep, and does it.
PM_CheckJump checks for jumping..
PM_Friction adds friction (Maybe I can check for it here?)
PM_WaterMove is floating in water
PM_CatagorizePosition set groundentity, watertype, and waterlevel for final spot (Check here too?)
Then does a final PM_SnapPosition at the end.