4#ifdef FEATURE_NETWORK_RECONCILIATION
6class TransportOwnerState : PawnOwnerState
8 proto native
void SetWorldTransform(vector transform[4]);
9 proto native
void GetWorldTransform(out vector transform[4]);
11 proto native
void SetLinearVelocity(vector value);
12 proto native
void GetLinearVelocity(out vector value);
14 proto native
void SetAngularVelocity(vector value);
15 proto native
void GetAngularVelocity(out vector value);
17 proto native
void SetBuoyancySubmerged(
float value);
18 proto native
float GetBuoyancySubmerged();
21 override event void GetTransform(inout vector transform[4])
23 GetWorldTransform(transform);
28class TransportMove : PawnMove
30 proto native
void SetWorldTransform(vector transform[4]);
31 proto native
void GetWorldTransform(out vector transform[4]);
33 proto native
void SetLinearVelocity(vector value);
34 proto native
void GetLinearVelocity(out vector value);
36 proto native
void SetAngularVelocity(vector value);
37 proto native
void GetAngularVelocity(out vector value);
40 override event void GetTransform(inout vector transform[4])
42 GetWorldTransform(transform);
68 RegisterNetSyncVariableBool(
"m_EngineZoneReceivedHit");
70 if ( MemoryPointExists(
"refill") )
81 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
94 return TransportOwnerState;
100 return TransportMove;
138 proto native
void CrewGetIn( Human player,
int posIdx );
168 return EInventoryIconVisibility.HIDE_VICINITY;
183 return "VehicleTypeUndefined";
222 for (
int i = 0; i < 4; i++)
224 avgPosition = avgPosition + corners[i];
227 avgPosition = avgPosition * 0.25;
233 vector dirUp = GetDirectionUp();
235 bool testLand = depth < -1.0;
252 for (i = 0; i < 4; i++)
276 int color = 0xFF00FF00;
316 for (
int index = 0; index <
CrewSize(); ++index)
332 set<int> crewMemberIndicesCopy =
new set<int>();
334 crewMemberIndicesCopy.Insert(crewMemberIndex);
341 set<int> crewMemberIndicesCopy =
new set<int>();
343 crewMemberIndicesCopy.Insert(crewMemberIndex);
356#ifndef CFGMODS_DEFINE_TEST
357 Error(
"GetAnimInstance() not implemented");
366#ifndef CFGMODS_DEFINE_TEST
367 Error(
"GetSeatAnimationType() not implemented");
374#ifndef CFGMODS_DEFINE_TEST
375 Error(
"Get3rdPersonCameraType() not implemented");
384#ifndef CFGMODS_DEFINE_TEST
393#ifndef CFGMODS_DEFINE_TEST
402#ifndef CFGMODS_DEFINE_TEST
411#ifndef CFGMODS_DEFINE_TEST
421 switch (pDoorSelection)
426 case "DoorsCoDriver":
465 return ( ( e && (e.IsZombie() || e.IsHologram()) ) || o.CanBeSkinned() || o.IsBush() || o.IsTree() );
481 GetTransform(transform);
485 CrewEntry( currentSeat, crewPos, crewDir );
490 entry[1] = entry[2] * entry[0];
495 vector position = transform[3];
498 position[1] = position[1] + maxAllowedObjHeight + (extents[1] * 0.5);
503 excluded.Insert(
this);
508 transform[3] = position;
510 foreach (
Object o : collided)
517 if (o.GetCollisionBox(minmax))
524 bool IsAreaAtDoorFree(
int currentSeat,
float maxAllowedObjHeight = 0.5,
float horizontalExtents = 0.5,
float playerHeight = 1.7 )
529 extents[0] = horizontalExtents;
530 extents[1] = playerHeight;
531 extents[2] = horizontalExtents;
533 return IsAreaAtDoorFree( currentSeat, maxAllowedObjHeight, extents, transform );
536 Shape DebugFreeAreaAtDoor(
int currentSeat,
float maxAllowedObjHeight = 0.5,
float horizontalExtents = 0.5,
float playerHeight = 1.7 )
538 int color =
ARGB(20, 0, 255, 0);
543 extents[0] = horizontalExtents;
544 extents[1] = playerHeight;
545 extents[2] = horizontalExtents;
547 if (!
IsAreaAtDoorFree( currentSeat, maxAllowedObjHeight, extents, transform ))
549 color =
ARGB(20, 255, 0, 0);
553 shape.SetMatrix(transform);
582 private bool m_bIsDebug;
594 void Reset(
bool isDebug =
false)
596 foreach (
Shape shape : m_DebugShapes)
601 m_DebugShapes.Clear();
603 m_bIsDebug = isDebug;
606 void AddShape(
Shape shape)
608 m_DebugShapes.Insert(shape);
override bool DetectFlipped(VehicleFlippedContext ctx)
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
proto native float GetWaterDepth(vector posWS)
proto native bool IsBoxColliding(vector center, vector orientation, vector edgeLength, array< Object > excludeObjects, array< Object > collidedObjects=NULL)
Finds all objects that are in choosen oriented bounding box (OBB)
proto native bool GetSurface(SurfaceDetectionParameters params, SurfaceDetectionResult result)
API for surface detection.
Super root of all classes in Enforce script.
static Shape DrawBox(vector pos1, vector pos2, int color=0x1fff7f7f)
bool CanReachSeatFromSeat(int currentSeat, int nextSeat)
ref TIntArray m_InteractActions
ref TIntArray m_SingleUseActions
override bool IsHealthVisible()
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
proto void CrewEntryWS(int posIdx, out vector pos, out vector dir)
Reads entry point and direction into vehicle on given position in world space.
bool DetectFlippedUsingSurface(VehicleFlippedContext ctx, float angleTolerance)
float GetActionDistanceFuel()
bool DetectFlipped(VehicleFlippedContext ctx)
Override based on vehicle implementation (Car, Boat, modded, etc.)
proto void CrewEntry(int posIdx, out vector pos, out vector dir)
Reads entry point and direction into vehicle on given position in model space.
override bool ShowZonesHealth()
bool m_EngineZoneReceivedHit
bool IsActionFlipped(Man player)
Don't override, may change to native for caching 'DetectFlipped' in the future based on active-ness (...
override int GetHideIconMask()
proto native Human CrewMember(int posIdx)
proto void CrewTransform(int posIdx, out vector mat[4])
Returns crew transformation indside vehicle in model space.
proto native Human CrewGetOut(int posIdx)
Performs transfer of player from vehicle into world from given position.
float GetTransportCameraDistance()
override int GetMeleeTargetType()
void HandleByCrewMemberState(ECrewMemberState state)
override event GetOwnerStateType()
void MarkCrewMemberUnconscious(int crewMemberIndex)
void SetEngineZoneReceivedHit(bool pState)
proto native int CrewPositionIndex(int componentIdx)
proto native int CrewMemberIndex(Human player)
bool IsAreaAtDoorFree(int currentSeat, float maxAllowedObjHeight, inout vector extents, out vector transform[4])
override bool IsTransport()
proto native Human CrewDriver()
string GetActionCompNameFuel()
VehicleFlippedContext GetFlipContext()
proto native void Synchronize()
Synchronizes car's state in case the simulation is not running.
override event GetMoveType()
proto void CrewTransformWS(int posIdx, out vector mat[4])
Returns crew transformation indside vehicle in world space.
vector GetTransportCameraOffset()
proto native int CrewSize()
Returns crew capacity of this vehicle.
bool CrewCanGetThrough(int posIdx)
int GetSeatIndexFromDoor(string pDoorSelection)
bool IsFlipped()
Don't override, may change to native for caching 'DetectFlipped' in the future based on active-ness (...
proto native void CrewGetIn(Human player, int posIdx)
Performs transfer of player from world into vehicle on given position.
ref TIntArray m_ContinuousActions
static ref VehicleFlippedContext m_FlippedContext
Shared context across all vehicles for flipping.
Shape DebugFreeAreaAtDoor(int currentSeat, float maxAllowedObjHeight=0.5, float horizontalExtents=0.5, float playerHeight=1.7)
int GetSeatAnimationType(int posIdx)
bool IsAreaAtDoorFree(int currentSeat, float maxAllowedObjHeight=0.5, float horizontalExtents=0.5, float playerHeight=1.7)
bool HasEngineZoneReceivedHit()
int Get3rdPersonCameraType()
ref set< int > m_DeadCrewMemberIndices
void MarkCrewMemberDead(int crewMemberIndex)
override bool IsIgnoredByConstruction()
bool CanReachDoorsFromSeat(string pDoorsSelection, int pCurrentSeat)
bool CanReachSeatFromDoors(string pSeatSelection, vector pFromPos, float pDistance=1.0)
ref set< int > m_UnconsciousCrewMemberIndices
proto native void CrewDeath(int posIdx)
Handles death of player in vehicle and awakes its physics if needed.
vector GetRefillPointPosWS()
bool IsIgnoredObject(Object o)
proto native Transport GetTransport()
bool includeWater
Include water in the surface detection, will return the water if it is higher than the surface.
SurfaceDetectionType type
Type of surface to detect.
RoadSurfaceDetection rsd
See RoadSurfaceDetection, SurfaceTraceType.Roadway only.
Object ignore
Object to ignore tracing against, SurfaceTraceType.Roadway only.
vector position
3D position to trace the surface from
float height
Height position.
override bool IsAreaAtDoorFree(int currentSeat, float maxAllowedObjHeight=0.5, float horizontalExtents=0.5, float playerHeight=1.7)
Base native class for all motorized wheeled vehicles.
ref SurfaceDetectionParameters m_SurfaceParams
ref SurfaceDetectionResult m_SurfaceResult
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
proto native float Length()
Returns length of vector (magnitude)
static float Dot(vector v1, vector v2)
Returns Dot product of vector v1 and vector v2.
proto float Normalize()
Normalizes vector. Returns length.
static vector Direction(vector p1, vector p2)
Returns direction vector from point p1 to point p2.
proto void RotationMatrixFromAngles(out vector mat[3])
Creates rotation matrix from angles.
proto native CGame GetGame()
void Error(string err)
Messagebox with error message.
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
static proto vector MatrixToAngles(vector mat[3])
Returns angles of rotation matrix.
static proto void MatrixMultiply4(vector mat0[4], vector mat1[4], out vector res[4])
Transforms matrix.
static proto float Cos(float angle)
Returns cosinus of angle in radians.
static const float DEG2RAD
proto native bool dGetInteractionLayer(notnull IEntity worldEntity, int mask1, int mask2)
proto native vector GetVelocity(notnull IEntity ent)
Returns linear velocity.
proto native float dBodyGetMass(notnull IEntity ent)
proto native int dBodyGetInteractionLayer(notnull IEntity ent)
int ARGB(int a, int r, int g, int b)