- 听众
- 收听
- 积分
- 2462
- 主题
- 回帖
- 0
- 精华
注册时间2006-9-30
最后登录1970-1-1
该用户从未签到
|
发表于 2008-5-25 00:00:58
|
显示全部楼层
// apply ground friction
if (pmove->onground != -1) // On an entity that is the ground
{
vec3_t start, stop;
pmtrace_t trace;
start[0] = stop[0] = pmove->origin[0] + vel[0]/speed*16;
start[1] = stop[1] = pmove->origin[1] + vel[1]/speed*16;
start[2] = pmove->origin[2] + pmove->player_mins[pmove->usehull][2];
stop[2] = start[2] - 34;
trace = pmove-> M_PlayerTrace (start, stop, PM_NORMAL, -1 );
if (trace.fraction == 1.0)
friction = pmove->movevars->friction*pmove->movevars->edgefriction;
else
friction = pmove->movevars->friction;
// Grab friction value.
//friction = pmove->movevars->friction;
friction *= pmove->friction; // player friction?
// Bleed off some speed, but if we have less than the bleed
// threshhold, bleed the theshold amount.
control = (speed < pmove->movevars->stopspeed) ?
pmove->movevars->stopspeed : speed;
// Add the amount to t'he drop amount.
drop += control*friction*pmove->frametime;
}
half-life sdk里的相关代码
但是cs里的这部分代码有点区别
 |
|