找回密码
 立即注册

QQ登录

只需一步,快速开始

楼主: whhwkx5988

[求助][原创]HJ的猜测

[复制链接]

该用户从未签到

 楼主| 发表于 2007-3-15 23:28:00 | 显示全部楼层
<DIV class=quote><B>以下是引用<I>Allen.R@97Club</I>在2007-3-15 23:07:00的发言:</B><BR>
<>恩``这个参数对于HJ 确实有很大的影响</P>
<>所以我和水王大胆的猜测</P>
<>那种小跳后在起跳的HJ 方法`其实不是为了克服重力影响</P>
<P>而是为了克服edgeriction这个参数对于边缘起跳的影响</P>
<P>而在LJ 的跳台上`因为跳台的实际高度是1 unit 左右`</P>
<P>我们如同是站在凌空的地方  所以这个参数无法影响LJ</P>
<P>大家可以自己试一下edgeriction=0 </P>
<P>再配合iiN的速度插件``</P>
<P>你会发现`只要你斜线助跑正确``</P>
<P>起跳速度都维持在300 以上!!!</P><BR><BR><BR>
<P>我和水王所说的这些``都仅仅只是猜测````</P>
<P>猜测为什么HJ 难跳```而用小跳后的起跳又很容易跳过去的原因</P>
<P>纯属个人观点``如有雷同``</P>
<P>纯属巧合!!!</P></DIV>
<p>   谢谢ALLEN哥帮忙解释~~[em10]

该用户从未签到

发表于 2007-3-15 23:30:00 | 显示全部楼层
<RE>/*
==================
PM_Friction

Handles both ground friction and water friction
==================
*/
void PM_Friction (void)
{
        float        *vel;
        float        speed, newspeed, control;
        float        friction;
        float        drop;
        vec3_t newvel;
       
        // If we are in water jump cycle, don't apply friction
        if (pmove-&gt;waterjumptime)
                return;

        // Get velocity
        vel = pmove-&gt;velocity;
       
        // Calculate speed
        speed = sqrt(vel[0]*vel[0] +vel[1]*vel[1] + vel[2]*vel[2]);
       
        // If too slow, return
        if (speed &lt; 0.1f)
        {
                return;
        }

        drop = 0;

// apply ground friction
        if (pmove-&gt;onground != -1)  // On an entity that is the ground
        {
                vec3_t start, stop;
                pmtrace_t trace;

                start[0] = stop[0] = pmove-&gt;origin[0] + vel[0]/speed*16;
                start[1] = stop[1] = pmove-&gt;origin[1] + vel[1]/speed*16;
                start[2] = pmove-&gt;origin[2] + pmove-&gt;player_mins[pmove-&gt;usehull][2];
                stop[2] = start[2] - 34;

                trace = pmove-&gtM_PlayerTrace (start, stop, PM_NORMAL, -1 );

                if (trace.fraction == 1.0)
                        friction = pmove-&gt;movevars-&gt;friction*pmove-&gt;movevars-&gt;edgefriction;
                else
                        friction = pmove-&gt;movevars-&gt;friction;
               
                // Grab friction value.
                //friction = pmove-&gt;movevars-&gt;friction;      

                friction *= pmove-&gt;friction;  // player friction?

                // Bleed off some speed, but if we have less than the bleed
                //  threshhold, bleed the theshold amount.
                control = (speed &lt; pmove-&gt;movevars-&gt;stopspeed) ?
                        pmove-&gt;movevars-&gt;stopspeed : speed;
                // Add the amount to t'he drop amount.
                drop += control*friction*pmove-&gt;frametime;
        }

// apply water friction
//        if (pmove-&gt;waterlevel)
//                drop += speed * pmove-&gt;movevars-&gt;waterfriction * waterlevel * pmove-&gt;frametime;

// scale the velocity
        newspeed = speed - drop;
        if (newspeed &lt; 0)
                newspeed = 0;

        // Determine proportion of old speed we are using.
        newspeed /= speed;

        // Adjust velocity according to proportion.
        newvel[0] = vel[0] * newspeed;
        newvel[1] = vel[1] * newspeed;
        newvel[2] = vel[2] * newspeed;

        VectorCopy( newvel, pmove-&gt;velocity );
}
</PRE>

该用户从未签到

 楼主| 发表于 2007-3-15 23:31:00 | 显示全部楼层
<DIV class=quote><B>以下是引用<I>iiN[KzcN]</I>在2007-3-15 23:30:00的发言:</B><BR><RE>/*<BR>==================<BR>M_Friction<BR><BR>Handles both ground friction and water friction<BR>==================<BR>*/<BR>void PM_Friction (void)<BR>{<BR> float *vel;<BR> float speed, newspeed, control;<BR> float friction;<BR> float drop;<BR> vec3_t newvel;<BR> <BR> // If we are in water jump cycle, don't apply friction<BR> if (pmove-&gt;waterjumptime)<BR>  return;<BR><BR> // Get velocity<BR> vel = pmove-&gt;velocity;<BR> <BR> // Calculate speed<BR> speed = sqrt(vel[0]*vel[0] +vel[1]*vel[1] + vel[2]*vel[2]);<BR> <BR> // If too slow, return<BR> if (speed &lt; 0.1f)<BR> {<BR>  return;<BR> }<BR><BR> drop = 0;<BR><BR>// apply ground friction<BR> if (pmove-&gt;onground != -1)  // On an entity that is the ground<BR> {<BR>  vec3_t start, stop;<BR>  pmtrace_t trace;<BR><BR>  start[0] = stop[0] = pmove-&gt;origin[0] + vel[0]/speed*16;<BR>  start[1] = stop[1] = pmove-&gt;origin[1] + vel[1]/speed*16;<BR>  start[2] = pmove-&gt;origin[2] + pmove-&gt;player_mins[pmove-&gt;usehull][2];<BR>  stop[2] = start[2] - 34;<BR><BR>  trace = pmove-&gtM_PlayerTrace (start, stop, PM_NORMAL, -1 );<BR><BR>  if (trace.fraction == 1.0)<BR>   friction = pmove-&gt;movevars-&gt;friction*pmove-&gt;movevars-&gt;edgefriction;<BR>  else<BR>   friction = pmove-&gt;movevars-&gt;friction;<BR>  <BR>  // Grab friction value.<BR>  //friction = pmove-&gt;movevars-&gt;friction;      <BR><BR>  friction *= pmove-&gt;friction;  // player friction?<BR><BR>  // Bleed off some speed, but if we have less than the bleed<BR>  //  threshhold, bleed the theshold amount.<BR>  control = (speed &lt; pmove-&gt;movevars-&gt;stopspeed) ?<BR>   pmove-&gt;movevars-&gt;stopspeed : speed;<BR>  // Add the amount to t'he drop amount.<BR>  drop += control*friction*pmove-&gt;frametime;<BR> }<BR><BR>// apply water friction<BR>// if (pmove-&gt;waterlevel)<BR>//  drop += speed * pmove-&gt;movevars-&gt;waterfriction * waterlevel * pmove-&gt;frametime;<BR><BR>// scale the velocity<BR> newspeed = speed - drop;<BR> if (newspeed &lt; 0)<BR>  newspeed = 0;<BR><BR> // Determine proportion of old speed we are using.<BR> newspeed /= speed;<BR><BR> // Adjust velocity according to proportion.<BR> newvel[0] = vel[0] * newspeed;<BR> newvel[1] = vel[1] * newspeed;<BR> newvel[2] = vel[2] * newspeed;<BR><BR> VectorCopy( newvel, pmove-&gt;velocity );<BR>}<BR></PRE></DIV>
<P>
<P>好东西 ,,,,</P>
<P>不懂到底什么意思...</P>

该用户从未签到

发表于 2007-3-16 08:25:00 | 显示全部楼层
哇哈哈,还有我啊!!!!!!!!我也帮你实验了啊!~~~!~[em08][em08][em08]

该用户从未签到

发表于 2007-3-16 11:06:00 | 显示全部楼层
<>iiN 发的那个?</P>
<>最好能解释一下</P>

该用户从未签到

发表于 2007-3-16 11:08:00 | 显示全部楼层
<DIV class=quote><B>以下是引用<I>iiN[KzcN]</I>在2007-3-15 23:30:00的发言:</B><BR><RE>/*<BR>==================<BR>M_Friction<BR><BR>Handles both ground friction and water friction<BR>==================<BR>*/<BR>void PM_Friction (void)<BR>{<BR> float *vel;<BR> float speed, newspeed, control;<BR> float friction;<BR> float drop;<BR> vec3_t newvel;<BR> <BR> // If we are in water jump cycle, don't apply friction<BR> if (pmove-&gt;waterjumptime)<BR>  return;<BR><BR> // Get velocity<BR> vel = pmove-&gt;velocity;<BR> <BR> // Calculate speed<BR> speed = sqrt(vel[0]*vel[0] +vel[1]*vel[1] + vel[2]*vel[2]);<BR> <BR> // If too slow, return<BR> if (speed &lt; 0.1f)<BR> {<BR>  return;<BR> }<BR><BR> drop = 0;<BR><BR>// apply ground friction<BR> if (pmove-&gt;onground != -1)  // On an entity that is the ground<BR> {<BR>  vec3_t start, stop;<BR>  pmtrace_t trace;<BR><BR>  start[0] = stop[0] = pmove-&gt;origin[0] + vel[0]/speed*16;<BR>  start[1] = stop[1] = pmove-&gt;origin[1] + vel[1]/speed*16;<BR>  start[2] = pmove-&gt;origin[2] + pmove-&gt;player_mins[pmove-&gt;usehull][2];<BR>  stop[2] = start[2] - 34;<BR><BR>  trace = pmove-&gtM_PlayerTrace (start, stop, PM_NORMAL, -1 );<BR><BR>  if (trace.fraction == 1.0)<BR>   friction = pmove-&gt;movevars-&gt;friction*pmove-&gt;movevars-&gt;edgefriction;<BR>  else<BR>   friction = pmove-&gt;movevars-&gt;friction;<BR>  <BR>  // Grab friction value.<BR>  //friction = pmove-&gt;movevars-&gt;friction;      <BR><BR>  friction *= pmove-&gt;friction;  // player friction?<BR><BR>  // Bleed off some speed, but if we have less than the bleed<BR>  //  threshhold, bleed the theshold amount.<BR>  control = (speed &lt; pmove-&gt;movevars-&gt;stopspeed) ?<BR>   pmove-&gt;movevars-&gt;stopspeed : speed;<BR>  // Add the amount to t'he drop amount.<BR>  drop += control*friction*pmove-&gt;frametime;<BR> }<BR><BR>// apply water friction<BR>// if (pmove-&gt;waterlevel)<BR>//  drop += speed * pmove-&gt;movevars-&gt;waterfriction * waterlevel * pmove-&gt;frametime;<BR><BR>// scale the velocity<BR> newspeed = speed - drop;<BR> if (newspeed &lt; 0)<BR>  newspeed = 0;<BR><BR> // Determine proportion of old speed we are using.<BR> newspeed /= speed;<BR><BR> // Adjust velocity according to proportion.<BR> newvel[0] = vel[0] * newspeed;<BR> newvel[1] = vel[1] * newspeed;<BR> newvel[2] = vel[2] * newspeed;<BR><BR> VectorCopy( newvel, pmove-&gt;velocity );<BR>}<BR></PRE></DIV>
<p>什么玩意???

该用户从未签到

发表于 2007-3-16 11:08:00 | 显示全部楼层
发那个是等懂的人来解释的,我要会的话就说了。[em06]

该用户从未签到

发表于 2007-3-16 11:09:00 | 显示全部楼层
<DIV class=quote><B>以下是引用<I>iiN[KzcN]</I>在2007-3-16 11:08:00的发言:</B><BR>发那个是等懂的人来解释的,我要会的话就说了。[em06]</DIV>
<p>[em07][em07][em07]

该用户从未签到

发表于 2007-3-16 13:42:00 | 显示全部楼层
嗯嗯~大概明白了~~

该用户从未签到

发表于 2007-3-16 15:41:00 | 显示全部楼层
<>俺还是大学生啊,确一点都看不懂[em07]</P>
<>退学算了,专心玩kz[em02]</P>
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表