DayZ 1.30
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
Car.c
См. документацию.
1
4{
5 // simulation
9
10 // miscellaneous
13};
14
15
16
18enum CarFluid : ETransportFluid {};
19
20
21
28
29
30
32enum CarGear
33{
36 FIRST,
37 SECOND,
52};
53
54
55
64
65
73
75{
76};
77
78class CarOwnerState : TransportOwnerState
79{
80};
81
82class CarMove : TransportMove
83{
84};
85
87class Car extends Transport
88{
90 protected override event typename GetOwnerStateType()
91 {
92 return CarOwnerState;
93 }
94
96 protected override event typename GetMoveType()
97 {
98 return CarMove;
99 }
100
102 proto native float GetSpeedometer();
103
106 {
107 return Math.AbsFloat(GetSpeedometer());
108 }
109
110 override bool IsAreaAtDoorFree( int currentSeat, float maxAllowedObjHeight = 0.5, float horizontalExtents = 0.5, float playerHeight = 1.7 )
111 {
112 vector transform[4];
113
114 vector extents;
115
116 extents[0] = horizontalExtents;
117 extents[1] = playerHeight;
118 extents[2] = horizontalExtents;
119
120 float speed = GetSpeedometerAbsolute();
121 if (speed > 8)
122 extents[2] = extents[2] * 6;
123 if (speed > 8)
124 extents[0] = 2;
125
126 return IsAreaAtDoorFree( currentSeat, maxAllowedObjHeight, extents, transform );
127 }
128
129 override Shape DebugFreeAreaAtDoor( int currentSeat, float maxAllowedObjHeight = 0.5, float horizontalExtents = 0.5, float playerHeight = 1.7 )
130 {
131 int color = ARGB(20, 0, 255, 0);
132
133 vector transform[4];
134
135 vector extents;
136
137 extents[0] = horizontalExtents;
138 extents[1] = playerHeight;
139 extents[2] = horizontalExtents;
140
141 float speed = GetSpeedometerAbsolute();
142 if (speed > 8)
143 extents[2] = extents[2] * 6;
144 if (speed > 8)
145 extents[0] = 2;
146
147 if (!IsAreaAtDoorFree( currentSeat, maxAllowedObjHeight, extents, transform ))
148 {
149 color = ARGB(20, 255, 0, 0);
150 }
151
152 Shape shape = Debug.DrawBox(-extents * 0.5, extents * 0.5, color);
153 shape.SetMatrix(transform);
154 return shape;
155 }
156
157 protected bool DetectFlippedUsingWheels(VehicleFlippedContext ctx, bool disallowSide)
158 {
159 if (disallowSide && (vector.Dot(GetDirectionUp(), vector.Up) < 0.7))
160 {
161 // return as "flipped", vehicle isn't pointing enough up to be reasonably certain
162 return true;
163 }
164
165 int wheelCount = WheelCount();
166
167 for (int wheelIdx = 0; wheelIdx < wheelCount; wheelIdx++)
168 {
169 if (!WheelHasContact(wheelIdx))
170 {
171 // wheel not in contact, then we could be flipped, we assume there exist other predicates
172 return true;
173 }
174 }
175
176 // all wheels in contact (or zero registered wheels), then we are in contact
177 return false;
178 }
179
180
182 proto native float GetSteering();
183
185 proto native void SetSteering(float value, bool unused0 = false);
186
188 proto native float GetThrottle();
189
191 proto native void SetThrottle(float value);
192
194 proto native int GetClutch();
195
197 proto native void SetClutch(float value);
198
200 proto native float GetBrake();
201
203 proto native void SetBrake(float value, float unused0 = 0, bool unused1 = false);
204
206 proto native float GetHandbrake();
207
209 proto native void SetHandbrake(float value);
210
212 proto native void SetBrakesActivateWithoutDriver(bool activate = true);
213
215 proto native float EngineGetRPMMin();
216
218 proto native float EngineGetRPMIdle();
219
221 proto native float EngineGetRPMMax();
222
224 proto native float EngineGetRPMRedline();
225
227 proto native float EngineGetRPM();
228
230 proto native bool EngineIsOn();
231
233 proto native void EngineStart();
234
236 proto native void EngineStop();
237
239 proto native vector GetEnginePos();
240
242 proto native void SetEnginePos(vector pos);
243
245 proto native int GetCurrentGear();
246
248 proto native int GetGear();
249
251 proto native int GetNeutralGear();
252
254 proto native int GetGearCount();
255
257 proto native void ShiftUp();
258
260 proto native void ShiftTo(int gear);
261
263 proto native void ShiftDown();
264
267
270
272 proto native bool WheelIsAnyLocked();
273
279 proto native float WheelGetAngularVelocity( int wheelIdx );
280
286 proto native bool WheelHasContact( int wheelIdx );
287
293 proto native vector WheelGetContactPosition( int wheelIdx );
294
300 proto native vector WheelGetPositionLS( int wheelIdx );
301
307 proto native vector WheelGetContactNormal( int wheelIdx );
308
314 proto native vector WheelGetDirection( int wheelIdx );
315
321 proto native SurfaceInfo WheelGetSurface( int wheelIdx );
322
328 proto native CarWheelWaterState WheelGetWaterState( int wheelIdx );
329
335 proto native EntityAI WheelGetEntity( int wheelIdx );
336
342 proto native bool WheelIsLocked( int wheelIdx );
343
345 proto native int WheelCount();
346
348 proto native int WheelCountPresent();
349
355 proto native float GetFluidCapacity(CarFluid fluid);
356
363 proto native float GetFluidFraction(CarFluid fluid);
364
366 proto native void Leak(CarFluid fluid, float amount);
367
369 proto native void LeakAll(CarFluid fluid);
370
372 proto native void Fill(CarFluid fluid, float amount);
373
380 {
381 // engine can start by default
382 return true;
383 }
384
389
393 void OnEngineStop() {}
394
401 void OnGearChanged(int newGear, int oldGear)
402 {
403 }
404
413 void OnFluidChanged(CarFluid fluid, float newValue, float oldValue) {}
414
423 float OnSound(CarSoundCtrl ctrl, float oldValue)
424 {
425 // just use the computed value by the game code
426 return oldValue;
427 }
428
429 [Obsolete("no replacement")]
430 proto native void ForcePosition(vector pos);
431
432 [Obsolete("no replacement")]
433 proto native void ForceDirection(vector dir);
434
435 [Obsolete("Use methods directly on Car")]
437
438 [Obsolete("Use Car.IsTurbo")]
439 proto native float GetThrustTurbo();
440
441 [Obsolete("Use Car.IsGentle")]
442 proto native float GetThrustGentle();
443
444 [Obsolete("Use Car.GetThrottle")]
445 proto native float GetThrust();
446
447 [Obsolete("Use Car.SetThrottle/Car.SetTurbo/Car.SetGentle")]
448 proto native void SetThrust(float in, float gentle = 0, float turbo = 0);
449
450 [Obsolete("no replacement")];
451 proto native void SetClutchState(bool in);
452
453 [Obsolete("Use Car.GetGearCount")]
454 proto native int GetGearsCount();
455
456};
457
458
459
462{
463 private void CarController() {}
464 private void ~CarController() {}
465
467 proto float GetSteering();
474 proto void SetSteering( float in, bool analog = false );
475
477 proto float GetThrustTurbo();
479 proto float GetThrustGentle();
481 proto float GetThrust();
489 proto void SetThrust( float in, float gentle = 0, float turbo = 0 );
490
492 proto float GetBrake();
499 proto void SetBrake( float in, float panic = 0 );
500
502 proto int GetGear();
503
504 proto void ShiftUp();
505 proto void ShiftTo( CarGear gear );
506 proto void ShiftDown();
507};
@ SPEED
speed of the boat in km/h
Определения Boat.c:6
@ ENGINE
indicates if engine is ON
Определения Boat.c:5
@ PLAYER
indicates if driver is controlled by player
Определения Boat.c:9
enum CarGearboxType ELEVENTH
CarAutomaticGearboxMode
Enumerated automatic gearbox modes. (native, do not change or extend)
Определения Car.c:58
@ R
reverse
Определения Car.c:60
@ N
neutral
Определения Car.c:61
@ D
drive
Определения Car.c:62
@ P
park
Определения Car.c:59
enum CarGearboxType THIRTEENTH
CarFluid
Type of vehicle's fluid. (native, do not change or extend)
Определения Car.c:18
enum CarGearboxType EIGTH
enum CarGearboxType SECOND
Определения PluginRecipesManagerBase.c:4
enum CarGearboxType FOURTH
enum CarGearboxType NINTH
enum CarGearboxType SIXTEENTH
enum CarGearboxType FIFTH
enum CarGearboxType FIFTEENTH
CarSoundCtrl
Car's sound controller list. (native, do not change or extend)
Определения Car.c:4
@ RPM
engine's RPM
Определения Car.c:7
@ DOORS
indicates if doors are open
Определения Car.c:11
CarWheelWaterState
Enumerated car wheel water state. (native, do not change or extend)
Определения Car.c:68
@ ON_LAND
if the wheel is on or above land
Определения Car.c:69
@ UNDER_WATER
if the wheel is under a water plane
Определения Car.c:71
@ IN_WATER
if the wheel is partially within some water plane
Определения Car.c:70
enum CarGearboxType SEVENTH
enum CarGearboxType SIXTH
enum CarGearboxType THIRD
enum CarGearboxType REVERSE
Enumerated vehicle's gears. (native, do not change or extend)
CarGearboxType
Enumerated gearbox types. (native, do not change or extend)
Определения Car.c:24
@ AUTOMATIC
automatic transmission with torque converter between engine and gearbox
Определения Car.c:26
@ MANUAL
classic manual transmission with friction plates between engine and gearbox
Определения Car.c:25
enum CarGearboxType FIRST
Определения PluginRecipesManagerBase.c:3
enum CarGearboxType TENTH
enum CarGearboxType TWELFTH
enum CarGearboxType FOURTEENTH
enum CarGearboxType NEUTRAL
override bool IsAreaAtDoorFree(int currentSeat, float maxAllowedObjHeight, inout vector extents, out vector transform[4])
Определения Motorbike.c:60
proto native int WheelCount()
How many wheel can be attached to a motorbike (hubs only)
proto native bool WheelHasContact(int wheelIdx)
float GetSpeedometer()
Returns the current speed of the vehicle in km/h.
Определения Motorbike.c:45
float GetSpeedometerAbsolute()
Returns the current speed of the vehicle in km/h. Value is absolute.
Определения Motorbike.c:55
proto float GetThrust()
Returns the current thrust value in range <0, 1>.
proto float GetSteering()
Returns the current steering value in range <-1, 1>.
proto void ShiftUp()
proto void ShiftDown()
proto float GetThrustTurbo()
Returns the current thrust turbo modifier value in range <0, 1>.
proto void SetSteering(float in, bool analog=false)
void ~CarController()
Определения Car.c:464
proto float GetBrake()
Returns the current brake value in range <0, 1>.
proto void SetThrust(float in, float gentle=0, float turbo=0)
proto void ShiftTo(CarGear gear)
proto float GetThrustGentle()
Returns the current thrust gentle modifier value in range <0, 1>.
proto int GetGear()
Returns index of the current gear.
proto void SetBrake(float in, float panic=0)
void CarController()
Определения Car.c:463
DEPRECATED class left for backwards compatibility, methods are available on car itself now.
Определения Car.c:462
Определения CarScript.c:95
Определения Car.c:83
Определения Car.c:79
Определения Car.c:75
static Shape DrawBox(vector pos1, vector pos2, int color=0x1fff7f7f)
Определения 3_Game/DayZ/tools/Debug.c:362
Определения 3_Game/DayZ/tools/Debug.c:2
Определения EnMath.c:7
Определения SurfaceInfo.c:9
proto native void SetThrust(float in, float gentle=0, float turbo=0)
proto native vector WheelGetPositionLS(int wheelIdx)
float OnSound(CarSoundCtrl ctrl, float oldValue)
Определения Car.c:423
proto native float GetHandbrake()
Returns the current handbrake value in range <0, 1>.
proto native vector WheelGetContactNormal(int wheelIdx)
proto native void ShiftUp()
Shifts the future gear up, triggering gearbox simulation.
proto native bool WheelHasContact(int wheelIdx)
proto native void SetEnginePos(vector pos)
Override the position of engine (model space)
proto native int GetCurrentGear()
Returns the index of the current gear, -1 if there is no engine.
proto native void SetSteering(float value, bool unused0=false)
Sets the future steering value.
void OnEngineStop()
Определения Car.c:393
proto native void Fill(CarFluid fluid, float amount)
Adds to the specified fluid the specified amount.
proto native float GetThrustTurbo()
proto native float GetThrustGentle()
proto native float EngineGetRPM()
Returns engine's rpm value.
proto native void ShiftDown()
Shifts the future gear down, triggering gearbox simulation.
proto native float WheelGetAngularVelocity(int wheelIdx)
proto native CarWheelWaterState WheelGetWaterState(int wheelIdx)
float GetSpeedometerAbsolute()
Returns the current speed of the vehicle in km/h. Value is absolute.
Определения Car.c:105
override event GetMoveType()
Определения Car.c:96
proto native void Leak(CarFluid fluid, float amount)
Removes from the specified fluid the specified amount.
proto native float EngineGetRPMIdle()
Returns engine's idle rpm before engine stalls.
proto native int WheelCountPresent()
Number of actually attached wheels (hubs only)
proto native bool EngineIsOn()
Returns true when engine is running, false otherwise.
proto native int GetClutch()
Returns the value of how much the clutch is disengaged.
proto native int GetNeutralGear()
Returns the index of the neutral gear.
proto native void SetThrottle(float value)
Sets the future throttle value.
proto native EntityAI WheelGetEntity(int wheelIdx)
proto native void SetClutch(float value)
Sets the future clutch value.
proto native CarAutomaticGearboxMode GearboxGetMode()
Returns gearbox mode. This is useful when car has automatic gearbox.
proto native int WheelCount()
How many wheel can be attached to a car (hubs only)
proto native void EngineStart()
Starts the engine.
proto native void ShiftTo(int gear)
Shifts the future gear to selected gear, triggering gearbox simulation.
proto native float EngineGetRPMMin()
Returns engine's min operating rpm.
proto native bool WheelIsAnyLocked()
Returns true if any of the wheels are locked in terms of its movement.
proto native CarController GetController()
proto native void ForceDirection(vector dir)
proto native void EngineStop()
Stops the engine.
override event GetOwnerStateType()
Определения Car.c:90
proto native float GetThrottle()
Returns the actual throttle value in range <0, 1>.
proto native float GetBrake()
Returns the current brake value in range <0, 1>.
proto native float GetThrust()
proto native vector WheelGetDirection(int wheelIdx)
proto native bool WheelIsLocked(int wheelIdx)
override bool IsAreaAtDoorFree(int currentSeat, float maxAllowedObjHeight=0.5, float horizontalExtents=0.5, float playerHeight=1.7)
Определения Car.c:110
proto native void LeakAll(CarFluid fluid)
Removes all the specified fluid from vehicle.
proto native float GetSpeedometer()
Returns the current speed of the vehicle in km/h.
proto native float GetFluidFraction(CarFluid fluid)
proto native vector WheelGetContactPosition(int wheelIdx)
proto native SurfaceInfo WheelGetSurface(int wheelIdx)
proto native int GetGear()
Returns the index of the future gear, -1 if there is no engine.
proto native CarGearboxType GearboxGetType()
Returns gearbox type. See CarGearboxType enum for more info.
proto native void SetHandbrake(float value)
Sets the future handbrake value.
bool DetectFlippedUsingWheels(VehicleFlippedContext ctx, bool disallowSide)
Определения Car.c:157
proto native float GetFluidCapacity(CarFluid fluid)
proto native float EngineGetRPMMax()
Returns engine's max rpm before engine blows up.
proto native void ForcePosition(vector pos)
proto native void SetBrakesActivateWithoutDriver(bool activate=true)
Sets if brakes should activate without a driver present.
void OnGearChanged(int newGear, int oldGear)
Определения Car.c:401
override Shape DebugFreeAreaAtDoor(int currentSeat, float maxAllowedObjHeight=0.5, float horizontalExtents=0.5, float playerHeight=1.7)
Определения Car.c:129
bool OnBeforeEngineStart()
Определения Car.c:379
proto native float EngineGetRPMRedline()
Returns engine's maximal working rpm without damaging the engine.
proto native float GetSteering()
Returns the current steering value in range <-1, 1>.
void OnEngineStart()
Определения Car.c:388
proto native vector GetEnginePos()
Get actual position of engine (model space)
proto native int GetGearsCount()
proto native void SetClutchState(bool in)
proto native int GetGearCount()
Returns the number of gears.
proto native void SetBrake(float value, float unused0=0, bool unused1=false)
Sets the future brake value.
void OnFluidChanged(CarFluid fluid, float newValue, float oldValue)
Определения Car.c:413
Native class for boats - handles physics simulation.
Определения Boat.c:29
Определения Transport.c:5
static float Dot(vector v1, vector v2)
Returns Dot product of vector v1 and vector v2.
Определения EnConvert.c:305
static const vector Up
Определения EnConvert.c:120
Определения EnConvert.c:119
class DiagMenu Shape
don't call destructor directly. Use Destroy() instead
void Obsolete(string msg="")
Определения EnScript.c:371
static proto float AbsFloat(float f)
Returns absolute value.
int ARGB(int a, int r, int g, int b)
Определения proto.c:322