1 // Copyright 2001-2018 Crytek GmbH / Crytek Group. All rights reserved.
3 #ifndef __VehicleHelper_h__
4 #define __VehicleHelper_h__
10 #include "Objects/BaseObject.h"
11 #include "VehicleDialogComponent.h"
14 class CVehiclePrototype
;
17 * CVehicleHelper is a simple helper object for specifying a position and orientation
18 * in a vehicle part coordinate frame
21 class CVehicleHelper
: public CBaseObject
, public CVeedObject
24 DECLARE_DYNCREATE(CVehicleHelper
)
26 //////////////////////////////////////////////////////////////////////////
27 // Ovverides from CBaseObject.
28 //////////////////////////////////////////////////////////////////////////
29 bool Init(CBaseObject
* prev
, const string
& file
);
32 void Display(DisplayContext
& dc
);
34 void GetBoundSphere(Vec3
& pos
, float& radius
);
35 void GetBoundBox(AABB
& box
);
36 void GetLocalBounds(AABB
& box
);
37 bool HitTest(HitContext
& hc
);
39 void Serialize(CObjectArchive
& ar
) {}
40 //////////////////////////////////////////////////////////////////////////
42 // Ovverides from IVeedObject.
43 //////////////////////////////////////////////////////////////////////////
44 void UpdateVarFromObject();
45 void UpdateObjectFromVar();
47 const char* GetElementName() { return "Helper"; }
48 virtual int GetIconIndex() { return (IsFromGeometry() ? VEED_ASSET_HELPER_ICON
: VEED_HELPER_ICON
); }
50 virtual IVariable
* GetVariable() { return m_pVar
; }
51 virtual void SetVariable(IVariable
* pVar
);
52 void UpdateScale(float scale
);
53 //////////////////////////////////////////////////////////////////////////
55 void SetIsFromGeometry(bool b
);
56 bool IsFromGeometry() { return m_fromGeometry
; }
58 void SetVehicle(CVehiclePrototype
* pProt
) { m_pVehicle
= pProt
; }
61 //! Dtor must be protected.
63 void DeleteThis() { delete this; };
64 void PostClone(CBaseObject
* pFromObject
, CObjectCloneContext
& ctx
);
66 virtual void OnTransform();
75 CVehiclePrototype
* m_pVehicle
;
79 * Class Description of VehicleHelper.
81 class CVehicleHelperClassDesc
: public CObjectClassDesc
84 ObjectType
GetObjectType() { return OBJTYPE_OTHER
; };
85 const char* ClassName() { return "VehicleHelper"; };
86 const char* Category() { return ""; };
87 CRuntimeClass
* GetRuntimeClass() { return RUNTIME_CLASS(CVehicleHelper
); };
90 #endif // __VehicleHelper_h__