it.com_phys_stepheight = 31;
it.com_phys_jumpvel = 260;
it.com_phys_friction = 6;
- it.com_phys_gravity = 800;
+ // it.com_phys_gravity = 800;
+ it.com_phys_noclip = true;
+
+ it.com_phys_pos = '0 0 200';
}
void CSQC_Ent_Update(bool isnew)
vector dir = normalize(it.com_in_move);
vector upvec = '0 0 1';
vector vel = (v_forward * dir.x + v_right * dir.y + upvec * dir.z);
- vel = vec_reflect(vel, upvec, 0);
+ if (!it.com_phys_noclip) vel = vec_reflect(vel, upvec, 0);
vel = normalize(vel);
vel *= 360 * frametime * 8;
it.com_phys_vel += vel;
float bounce = this.com_phys_bounce;
float friction = this.com_phys_friction;
float gravity = this.com_phys_gravity;
+ bool noclip = this.com_phys_noclip;
+ if (noclip) {
+ jump = false;
+ nogravityonground = false;
+ }
vector g = upvec * -gravity;
// alternatives: rk4, verlet, euler
vel += (acc + g) * dt / 2;
{
- if (onground)
+ if (onground || noclip)
{
if (nogravityonground)
{
else // the first landing frame is free
{
// friction
- vector slide = vec_reflect(vel, upvec, 0);
+ vector slide = noclip ? vel : vec_reflect(vel, upvec, 0);
vector push = vel - slide;
// TODO: slick
slide *= 1 - friction * dt;
bool foundground = false; // assume until proven otherwise
if (nogravityonground) foundground = true; // override
bool steplimit = 1;
+ if (noclip) pass = true; else
for (int i = 0; i < PHYSICS_TRACE_PLANE_MAX; ++i)
{
vector p0 = pos;