3 void _Movetype_Physics_Toss(entity this, float dt) // SV_Physics_Toss
5 if (IS_ONGROUND(this)) {
6 if (this.velocity.z >= 1 / 32 && UPWARD_VELOCITY_CLEARS_ONGROUND(this)) {
8 } else if (!this.groundentity) {
10 } else if (this.move_suspendedinair && wasfreed(this.groundentity)) {
11 this.groundentity = NULL;
16 this.move_suspendedinair = false;
18 _Movetype_CheckVelocity(this);
20 /*if (this.move_movetype == MOVETYPE_BOUNCE || this.move_movetype == MOVETYPE_TOSS)
22 this.move_didgravity = 1;
23 this.velocity_z -= (GAMEPLAYFIX_GRAVITYUNAFFECTEDBYTICRATE ? 0.5 : 1)
25 * (this.gravity ? this.gravity : 1)
29 if (this.move_movetype == MOVETYPE_BOUNCE || this.move_movetype == MOVETYPE_TOSS) {
30 this.move_didgravity = true;
31 this.velocity_z -= (((this.gravity) ? this.gravity : 1) * PHYS_GRAVITY(this) * dt);
34 this.angles = this.angles + this.avelocity * dt;
37 for (int bump = 0; bump < MAX_CLIP_PLANES && movetime > 0; ++bump) {
38 vector move = this.velocity * movetime;
39 _Movetype_PushEntity(this, move, true);
44 if (trace_startsolid) {
45 _Movetype_UnstickEntity(this);
46 _Movetype_PushEntity(this, move, false);
52 if (trace_fraction == 1) {
56 movetime *= 1 - min(1, trace_fraction);
58 if (this.move_movetype == MOVETYPE_BOUNCEMISSILE) {
59 this.velocity = _Movetype_ClipVelocity(this.velocity, trace_plane_normal, 2.0);
61 } else if (this.move_movetype == MOVETYPE_BOUNCE) {
62 float bouncefac = this.bouncefactor;
63 if (!bouncefac) { bouncefac = 0.5; }
64 float bstop = this.bouncestop;
65 if (!bstop) { bstop = 60 / 800; }
66 bstop *= (this.gravity ? this.gravity : 1) * PHYS_GRAVITY(this);
68 this.velocity = _Movetype_ClipVelocity(this.velocity, trace_plane_normal, 1 + bouncefac);
70 float d = trace_plane_normal * this.velocity;
71 if (trace_plane_normal.z > 0.7 && d < bstop && d > -bstop) {
73 this.groundentity = trace_ent;
74 this.velocity = '0 0 0';
75 this.avelocity = '0 0 0';
80 this.velocity = _Movetype_ClipVelocity(this.velocity, trace_plane_normal, 1.0);
81 if (trace_plane_normal.z > 0.7) {
83 this.groundentity = trace_ent;
84 if (trace_ent.solid == SOLID_BSP) {
85 this.move_suspendedinair = true;
87 this.velocity = '0 0 0';
88 this.avelocity = '0 0 0';
94 // DP revision 8905 (just, WHY...)
95 if (this.move_movetype == MOVETYPE_BOUNCEMISSILE) {
99 // DP revision 8918 (WHY...)
100 if (IS_ONGROUND(this)) {
105 // if (GAMEPLAYFIX_GRAVITYUNAFFECTEDBYTICRATE && this.move_didgravity > 0 && !IS_ONGROUND(this))
106 // this.velocity_z -= 0.5 * dt * (this.gravity ? this.gravity : 1) * PHYS_GRAVITY(this);
108 _Movetype_CheckWaterTransition(this);