DayZ 1.30
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
Motorbike.c
См. документацию.
3{
4 // simulation
8
9 // miscellaneous
11};
12
14enum MotorbikeFluid : ETransportFluid {}
15
16class MotorbikeType : TransportType
17{
18};
19
20class MotorbikeOwnerState : TransportOwnerState
21{
22
23}
24
25class MotorbikeMove : TransportMove
26{
27}
28
30class Motorbike extends Transport
31{
33 protected override event typename GetOwnerStateType()
34 {
36 }
37
39 protected override event typename GetMoveType()
40 {
41 return MotorbikeMove;
42 }
43
46 {
47 vector transform[4];
48 GetTransform(transform);
49
50 float velocity = GetVelocity(this).InvMultiply3(transform)[2];
51 return velocity * 3.6;
52 }
53
56 {
58 }
59
60 override bool IsAreaAtDoorFree( int currentSeat, float maxAllowedObjHeight, inout vector extents, out vector transform[4] )
61 {
62 return true;
63 }
64
65 override bool IsAreaAtDoorFree( int currentSeat, float maxAllowedObjHeight = 0.5, float horizontalExtents = 0.5, float playerHeight = 1.7 )
66 {
67 return true;
68 }
69
70 override Shape DebugFreeAreaAtDoor( int currentSeat, float maxAllowedObjHeight = 0.5, float horizontalExtents = 0.5, float playerHeight = 1.7 )
71 {
72 return null;
73 }
74
75 protected bool DetectFlippedUsingWheels(VehicleFlippedContext ctx, bool disallowSide)
76 {
77 if (disallowSide && (vector.Dot(GetDirectionUp(), vector.Up) < 0.7))
78 {
79 // return as "flipped", vehicle isn't pointing enough up to be reasonably certain
80 return true;
81 }
82
83 int wheelCount = WheelCount();
84
85 for (int wheelIdx = 0; wheelIdx < wheelCount; wheelIdx++)
86 {
87 if (!WheelHasContact(wheelIdx))
88 {
89 // wheel not in contact, then we could be flipped, we assume there exist other predicates
90 return true;
91 }
92 }
93
94 // all wheels in contact (or zero registered wheels), then we are in contact
95 return false;
96 }
97
98
100 proto native float GetSteering();
101
103 proto native void SetSteering(float value);
104
106 proto native bool CanPickUp();
107
109 proto native void PickUp();
110
112 proto native bool IsFallen();
113
115 proto native bool FallOver();
116
118 proto native float GetThrottle();
119
121 proto native void SetThrottle(float value);
122
124 proto native int GetClutch();
125
127 proto native void SetClutch(float value);
128
130 proto native float GetBrake();
131
133 proto native void SetBrake(float value);
134
136 proto native float GetHandbrake();
137
139 proto native void SetHandbrake(float value);
140
142 proto native float GetKickstand();
143
145 proto native void SetKickstand(float value);
146
148 proto native float EngineGetRPMMin();
149
151 proto native float EngineGetRPMIdle();
152
154 proto native float EngineGetRPMMax();
155
157 proto native float EngineGetRPMRedline();
158
160 proto native float EngineGetRPM();
161
163 proto native bool EngineIsOn();
164
166 proto native void EngineStart();
167
169 proto native void EngineStop();
170
172 proto native vector GetEnginePos();
173
175 proto native void SetEnginePos(vector pos);
176
178 proto native int GetCurrentGear();
179
181 proto native int GetGear();
182
184 proto native int GetNeutralGear();
185
187 proto native int GetGearCount();
188
190 proto native void ShiftUp();
191
193 proto native void ShiftTo(int gear);
194
196 proto native void ShiftDown();
197
200
203
205 proto native bool WheelIsAnyLocked();
206
212 proto native float WheelGetAngularVelocity( int wheelIdx );
213
219 proto native bool WheelHasContact( int wheelIdx );
220
226 proto native vector WheelGetContactPosition( int wheelIdx );
227
233 proto native vector WheelGetPositionLS( int wheelIdx );
234
240 proto native vector WheelGetContactNormal( int wheelIdx );
241
247 proto native vector WheelGetDirection( int wheelIdx );
248
254 proto native SurfaceInfo WheelGetSurface( int wheelIdx );
255
261 proto native CarWheelWaterState WheelGetWaterState( int wheelIdx );
262
268 proto native EntityAI WheelGetEntity( int wheelIdx );
269
275 proto native bool WheelIsLocked( int wheelIdx );
276
278 proto native int WheelCount();
279
281 proto native int WheelCountPresent();
282
288 proto native float GetFluidCapacity(MotorbikeFluid fluid);
289
296 proto native float GetFluidFraction(MotorbikeFluid fluid);
297
299 proto native void Leak(MotorbikeFluid fluid, float amount);
300
302 proto native void LeakAll(MotorbikeFluid fluid);
303
305 proto native void Fill(MotorbikeFluid fluid, float amount);
306
313 {
314 // engine can start by default
315 return true;
316 }
317
322
326 void OnEngineStop() {}
327
334 void OnGearChanged(int newGear, int oldGear) {}
335
344 void OnFluidChanged(MotorbikeFluid fluid, float newValue, float oldValue) {}
345
354 float OnSound(MotorbikeSoundCtrl ctrl, float oldValue)
355 {
356 // just use the computed value by the game code
357 return oldValue;
358 }
359
364
369
370}
@ 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
CarAutomaticGearboxMode
Enumerated automatic gearbox modes. (native, do not change or extend)
Определения Car.c:58
@ RPM
engine's RPM
Определения Car.c:7
CarWheelWaterState
Enumerated car wheel water state. (native, do not change or extend)
Определения Car.c:68
CarGearboxType
Enumerated gearbox types. (native, do not change or extend)
Определения Car.c:24
MotorbikeFluid
Type of vehicle's fluid. (native, do not change or extend)
Определения Motorbike.c:14
void OnStabilityStart()
Определения Motorbike.c:363
proto native float GetKickstand()
Returns the current kickstand value in range <0, 1>.
proto native void PickUp()
Picks the bike back up when it is fallen over.
proto native void SetKickstand(float value)
Sets the future kickstand value.
proto native bool CanPickUp()
Query if the motorbike can be picked back up.
void OnStabilityStop()
Определения Motorbike.c:368
MotorbikeSoundCtrl
Motorbike's sound controller list. (native, do not change or extend)
Определения Motorbike.c:3
proto native bool FallOver()
Forcibly topple over the motorbike, ejects the player.
proto native bool IsFallen()
Returns if the bike is fallen over.
enum MotorbikeHeadlightState MotorbikeOwnerState
Определения EnMath.c:7
Определения Motorbike.c:21
Определения SurfaceInfo.c:9
proto native vector WheelGetPositionLS(int wheelIdx)
proto native float GetHandbrake()
Returns the current handbrake value in range <0, 1>.
proto native void Fill(BoatFluid fluid, float amount)
Adds to the specified fluid the specified amount.
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.
void OnEngineStop()
Определения Boat.c:173
proto native void Leak(BoatFluid fluid, float amount)
Removes from the specified fluid the specified amount.
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.
Определения Boat.c:53
override event GetMoveType()
Определения Boat.c:37
proto native float EngineGetRPMIdle()
Returns engine's idle rpm before engine stalls.
float GetSpeedometer()
Returns the current speed of the vehicle in km/h.
Определения Boat.c:43
proto native int WheelCountPresent()
Number of actually attached wheels (hubs only)
proto native void LeakAll(BoatFluid fluid)
Removes all the specified fluid from vehicle.
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.
float OnSound(BoatSoundCtrl ctrl, float oldValue)
Определения Boat.c:201
proto native bool WheelIsAnyLocked()
Returns true if any of the wheels are locked in terms of its movement.
proto native float GetFluidFraction(BoatFluid fluid)
proto native void EngineStop()
Stops the engine.
void OnFluidChanged(BoatFluid fluid, float newValue, float oldValue)
Определения Boat.c:191
proto native float GetFluidCapacity(BoatFluid fluid)
override event GetOwnerStateType()
Определения Boat.c:31
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 void SetSteering(float value)
Sets the future steering value.
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 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 EngineGetRPMMax()
Returns engine's max rpm before engine blows up.
void OnGearChanged(int newGear, int oldGear)
Определения Boat.c:181
override Shape DebugFreeAreaAtDoor(int currentSeat, float maxAllowedObjHeight=0.5, float horizontalExtents=0.5, float playerHeight=1.7)
Определения Car.c:129
bool OnBeforeEngineStart()
Определения Boat.c:159
proto native float EngineGetRPMRedline()
Returns engine's maximal working rpm without damaging the engine.
proto native float GetSteering()
Returns the actual steering value in range <-1, 1>.
void OnEngineStart()
Определения Boat.c:168
proto native vector GetEnginePos()
Get actual position of engine (model space)
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.
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
proto vector InvMultiply3(vector mat[3])
Invert-transforms vector.
static const vector Up
Определения EnConvert.c:120
Определения EnConvert.c:119
class DiagMenu Shape
don't call destructor directly. Use Destroy() instead
static proto float AbsFloat(float f)
Returns absolute value.
proto native vector GetVelocity(notnull IEntity ent)
Returns linear velocity.