Definition at line 104 of file bugrigs.qc.
105{
106
107
108
110
114
116 {
117 if (accel < 0)
118 {
119
120
121 if (accel < -0.5)
122 accel = -1;
123 else
124 accel = 0;
125 }
126 }
127
128 this.angles_x = 0;
129 this.angles_z = 0;
131
133 {
136
137
139
140
141 float steerfactor;
144 else
146
147 float accelfactor;
150 else
152
153
154 if (accel < 0)
155 {
156 if (myspeed > 0)
157 {
159 }
160 else
161 {
164 }
165 }
166 else
167 {
168 if (myspeed >= 0)
169 {
171 }
172 else
173 {
175 myspeed = 0;
176 else
178 }
179 }
180
181
182
183 this.
angles_y += steer * dt * steerfactor;
185
186 myspeed += accel * accelfactor * dt;
187
188 rigvel = myspeed *
v_forward +
'0 0 1' * upspeed;
189 }
190 else
191 {
193
194
196 float steerfactor = -myspeed * f;
197 this.
angles_y += steer * dt * steerfactor;
198
201 }
202
204
205
206
207
209 {
210 vector rigvel_xy, neworigin, up;
211 float mt;
212
214 rigvel_xy =
vec2(rigvel);
215
218 else
220
223
224
225
227
228
230
232 {
234 neworigin = this.origin;
235 }
236 else
238
240 {
241
244 +
246 +
248 );
250 }
251 else
252 {
253
255 }
256
257 this.
velocity = (neworigin - this.origin) * (1.0 / dt);
259 }
260 else
261 {
265 }
266
270 {
271 this.
angles = vectoangles2(
273 +
275 +
278 );
279 }
280 else
281 {
283
285 vel_local.y =
v_right * this.velocity;
286 vel_local.z =
v_up * this.velocity;
287
290 }
291
292
293 vector vf1, vu1, smoothangles;
296 if (f == 0)
297 f = 1;
302 vu1 = vu1 +
v_up * (1 - f);
303 smoothangles = vectoangles2(vf1, vu1);
304 this.angles_x = -smoothangles.x;
305 this.angles_z = smoothangles.z;
306}
#define PHYS_BUGRIGS_REVERSE_SPINNING(s)
#define PHYS_BUGRIGS_FRICTION_FLOOR(s)
#define PHYS_BUGRIGS_SPEED_POW(s)
#define PHYS_BUGRIGS_STEER(s)
#define PHYS_BUGRIGS_REVERSE_SPEEDING(s)
float racecar_angle(float forward, float down)
#define PHYS_BUGRIGS_FRICTION_BRAKE(s)
#define PHYS_BUGRIGS_FRICTION_AIR(s)
#define PHYS_BUGRIGS_ACCEL(s)
#define PHYS_BUGRIGS_CAR_JUMPING(s)
#define PHYS_BUGRIGS_SPEED_REF(s)
#define PHYS_BUGRIGS_REVERSE_STOPPING(s)
#define PHYS_BUGRIGS_ANGLE_SMOOTHING(s)
#define PHYS_BUGRIGS_AIR_STEERING(s)
#define PHYS_BUGRIGS_PLANAR_MOVEMENT(s)
const float MOVE_NOMONSTERS
vector trace_plane_normal
void set_movetype(entity this, int mt)
#define UNSET_ONGROUND(s)
const int MOVETYPE_NOCLIP
References angles, angles_y, bound(), entity(), IS_ONGROUND, makevectors, max(), maxs, min(), mins, MOVE_NOMONSTERS, MOVE_NORMAL, movement, MOVETYPE_FLY, MOVETYPE_NOCLIP, origin, PHYS_BUGRIGS_ACCEL, PHYS_BUGRIGS_AIR_STEERING, PHYS_BUGRIGS_ANGLE_SMOOTHING, PHYS_BUGRIGS_CAR_JUMPING, PHYS_BUGRIGS_FRICTION_AIR, PHYS_BUGRIGS_FRICTION_BRAKE, PHYS_BUGRIGS_FRICTION_FLOOR, PHYS_BUGRIGS_PLANAR_MOVEMENT, PHYS_BUGRIGS_REVERSE_SPEEDING, PHYS_BUGRIGS_REVERSE_SPINNING, PHYS_BUGRIGS_REVERSE_STOPPING, PHYS_BUGRIGS_SPEED_POW, PHYS_BUGRIGS_SPEED_REF, PHYS_BUGRIGS_STEER, PHYS_CS, PHYS_GRAVITY, PHYS_MAXSPEED, racecar_angle(), set_movetype(), SET_ONGROUND, trace_endpos, trace_fraction, trace_plane_normal, UNSET_ONGROUND, v_forward, v_right, v_up, vec2, vectoangles(), vector, velocity, and vlen().
Referenced by MUTATOR_HOOKFUNCTION().