!I (1670414, 1670415, 1670416, 1670424, 1670431):
[CRYENGINE.git] / Code / Sandbox / Plugins / VehicleEditor / VehicleHelperObject.h
blob20a5016c37dc6a3a7b889a59648b0f89463720e3
1 // Copyright 2001-2018 Crytek GmbH / Crytek Group. All rights reserved.
3 #ifndef __VehicleHelper_h__
4 #define __VehicleHelper_h__
6 #if _MSC_VER > 1000
7 #pragma once
8 #endif
10 #include "Objects/BaseObject.h"
11 #include "VehicleDialogComponent.h"
13 class CVehiclePart;
14 class CVehiclePrototype;
16 /*!
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
23 public:
24 DECLARE_DYNCREATE(CVehicleHelper)
25 ~CVehicleHelper();
26 //////////////////////////////////////////////////////////////////////////
27 // Ovverides from CBaseObject.
28 //////////////////////////////////////////////////////////////////////////
29 bool Init(CBaseObject* prev, const string& file);
30 void Done();
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; }
60 protected:
61 //! Dtor must be protected.
62 CVehicleHelper();
63 void DeleteThis() { delete this; };
64 void PostClone(CBaseObject* pFromObject, CObjectCloneContext& ctx);
66 virtual void OnTransform();
68 float m_innerRadius;
69 float m_outerRadius;
71 IVariable* m_pVar;
73 bool m_fromGeometry;
75 CVehiclePrototype* m_pVehicle;
78 /*!
79 * Class Description of VehicleHelper.
81 class CVehicleHelperClassDesc : public CObjectClassDesc
83 public:
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__