BVB Source Codes

CRYENGINE Show ScriptBind_Vehicle.h Source code

Return Download CRYENGINE: download ScriptBind_Vehicle.h Source code - Download CRYENGINE Source code - Type:.h
  1. // Copyright 2001-2016 Crytek GmbH / Crytek Group. All rights reserved.
  2.  
  3. /*************************************************************************
  4.    -------------------------------------------------------------------------
  5.    $Id$
  6.    $DateTime$
  7.    Description: Script Binding for the Vehicle System
  8.  
  9.    -------------------------------------------------------------------------
  10.    History:
  11.    - 05:10:2004   12:05 : Created by Mathieu Pinard
  12.  
  13. *************************************************************************/
  14. #ifndef __SCRIPTBIND_VEHICLE_H__
  15. #define __SCRIPTBIND_VEHICLE_H__
  16.  
  17. #if _MSC_VER > 1000
  18.         #pragma once
  19. #endif
  20.  
  21. #include <CryScriptSystem/IScriptSystem.h>
  22. #include <CryScriptSystem/ScriptHelpers.h>
  23.  
  24. struct IVehicleSystem;
  25. struct IGameFramework;
  26. class CVehicle;
  27.  
  28. class CScriptBind_Vehicle :
  29.         public CScriptableBase
  30. {
  31. public:
  32.         CScriptBind_Vehicle(ISystem* pSystem, IGameFramework* pGameFW);
  33.         virtual ~CScriptBind_Vehicle();
  34.  
  35.         void         Release() { delete this; };
  36.  
  37.         virtual void GetMemoryUsage(ICrySizer* pSizer) const
  38.         {
  39.                 pSizer->AddObject(this, sizeof(*this));
  40.         }
  41.  
  42.         void AttachTo(IVehicle* pVehicle);
  43.  
  44.         //! <code>Vehicle.GetVehicle()</code>
  45.         //! <description>Gets the vehicle identifier.</description>
  46.         CVehicle* GetVehicle(IFunctionHandler* pH);
  47.  
  48.         //! <code>Vehicle.Reset()</code>
  49.         //! <description>Resets the vehicle.</description>
  50.         int Reset(IFunctionHandler* pH);
  51.  
  52.         //! <code>Vehicle.IsInsideRadius( pos, radius )</code>
  53.         //! <description>Checks if the vehicle is inside the specified radius.</description>
  54.         int IsInsideRadius(IFunctionHandler* pH, Vec3 pos, float radius);
  55.  
  56.         //! <code>Vehicle.MultiplyWithWorldTM( pos )</code>
  57.         //!             <param name="pos">Position vector.</param>
  58.         //! <description>Multiplies with the world transformation matrix.</description>
  59.         int MultiplyWithWorldTM(IFunctionHandler* pH, Vec3 pos);
  60.  
  61.         //! <code>Vehicle.ResetSlotGeometry( slot, filename, geometry )</code>
  62.         int ResetSlotGeometry(IFunctionHandler* pH, int slot, const char* filename, const char* geometry);
  63.  
  64.         //! <code>Vehicle.AddSeat( paramsTable )</code>
  65.         //!             <param name="paramsTable">Seat parameters.</param>
  66.         //! <description>Adds a seat to the vehicle.</description>
  67.         int AddSeat(IFunctionHandler* pH, SmartScriptTable paramsTable);
  68.  
  69.         //! <code>Vehicle.HasHelper(name)</code>
  70.         //!             <param name="name">Helper name.</param>
  71.         //! <description>Checks if the vehicle has the specified helper.</description>
  72.         int HasHelper(IFunctionHandler* pH, const char* name);
  73.  
  74.         //! <code>Vehicle.GetHelperPos(name, isInVehicleSpace)</code>
  75.         //!             <param name="name">Helper name.</param>
  76.         //!             <param name="isInVehicleSpace">.</param>
  77.         //! <description>Gets the helper position.</description>
  78.         int GetHelperPos(IFunctionHandler* pH, const char* name, bool isInVehicleSpace);
  79.  
  80.         //! <code>Vehicle.GetHelperDir( name, isInVehicleSpace )</code>
  81.         //!             <param name="name">Helper name.</param>
  82.         //!             <param name="isInVehicleSpace">.</param>
  83.         //! <description>Gets the helper direction.</description>
  84.         int GetHelperDir(IFunctionHandler* pH, const char* name, bool isInVehicleSpace);
  85.  
  86.         //! <code>Vehicle.GetHelperWorldPos( name )</code>
  87.         //!             <param name="name">Helper name.</param>
  88.         //! <description>Gets the helper position in the world coordinates.</description>
  89.         int GetHelperWorldPos(IFunctionHandler* pH, const char* name);
  90.  
  91.         //! <code>Vehicle.EnableMovement( enable )</code>
  92.         //!             <param name="enable">True to enable movement, false to disable.</param>
  93.         //! <description>Enables/disables the movement of the vehicle.</description>
  94.         int EnableMovement(IFunctionHandler* pH, bool enable);
  95.  
  96.         //! <code>Vehicle.DisableEngine( disable )</code>
  97.         //!             <param name="disable">True to disable the engine, false to enable.</param>
  98.         //! <description>Disables/enables the engine of the vehicle.</description>
  99.         int DisableEngine(IFunctionHandler* pH, bool disable);
  100.  
  101.         //! <code>Vehicle.OnHit( targetId, shooterId, damage, position, radius, pHitClass, explosion )</code>
  102.         //!             <param name="targetId">Target identifier.</param>
  103.         //!             <param name="shooterId">Shooter identifier.</param>
  104.         //!             <param name="damage">Damage amount.</param>
  105.         //!             <param name="radius">Radius of the hit.</param>
  106.         //!             <param name="hitTypeId">Hit type.</param>
  107.         //!             <param name="explosion">True if the hit cause an explosion, false otherwise.</param>
  108.         //! <description>Event that occurs after the vehicle is hit.</description>
  109.         int OnHit(IFunctionHandler* pH, ScriptHandle targetId, ScriptHandle shooterId, float damage, Vec3 position, float radius, int hitTypeId, bool explosion);
  110.  
  111.         //! <code>Vehicle.ProcessPassengerDamage( passengerId, actorHealth, damage, pDamageClass, explosion )</code>
  112.         //!             <param name="passengerId">Passenger identifier.</param>
  113.         //!             <param name="actorHealth">Actor health amount.</param>
  114.         //!             <param name="damage">Damage amount.</param>
  115.         //!             <param name="hitTypeId">Damage type.</param>
  116.         //!             <param name="explosion">True if there is an explosion, false otherwise.</param>
  117.         //! <description>Processes passenger damages.</description>
  118.         int ProcessPassengerDamage(IFunctionHandler* pH, ScriptHandle passengerId, float actorHealth, float damage, int hitTypeId, bool explosion);
  119.  
  120.         //! <code>Vehicle.Destroy()</code>
  121.         //! <description>Destroys the vehicle.</description>
  122.         int Destroy(IFunctionHandler* pH);
  123.  
  124.         //! <code>Vehicle.IsDestroyed()</code>
  125.         //! <description>Checks if the vehicle is destroyed.</description>
  126.         int IsDestroyed(IFunctionHandler* pH);
  127.  
  128.         //! <code>Vehicle.IsUsable( userHandle )</code>
  129.         //!             <param name="userHandle">User identifier.</param>
  130.         //! <description>Checks if the vehicle is usable by the user.</description>
  131.         int IsUsable(IFunctionHandler* pH, ScriptHandle userHandle);
  132.  
  133.         //! <code>Vehicle.OnUsed( userHandle, index )</code>
  134.         //!             <param name="userHandle">User identifier.</param>
  135.         //!             <param name="index">Seat identifier.</param>
  136.         //! <description>Events that occurs when the user uses the vehicle.</description>
  137.         int OnUsed(IFunctionHandler* pH, ScriptHandle userHandle, int index);
  138.  
  139.         //! <code>Vehicle.EnterVehicle( actorHandle, seatId, isAnimationEnabled )</code>
  140.         //!             <param name="actorHandle">Actor identifier.</param>
  141.         //!             <param name="seatId">Seat identifier.</param>
  142.         //!             <param name="isAnimationEnabled - True to enable the animation, false otherwise.</param>
  143.         //! <description>Makes the actor entering the vehicle.</description>
  144.         int EnterVehicle(IFunctionHandler* pH, ScriptHandle actorHandle, int seatId, bool isAnimationEnabled);
  145.  
  146.         //! <code>Vehicle.ChangeSeat(actorHandle, seatId, isAnimationEnabled)</code>
  147.         //!             <param name="actorHandle">Actor identifier.</param>
  148.         //!             <param name="seatId">Seat identifier.</param>
  149.         //!             <param name="isAnimationEnabled - True to enable the animation, false otherwise.</param>
  150.         //! <description>Makes the actor changing the seat inside the vehicle.</description>
  151.         int ChangeSeat(IFunctionHandler* pH, ScriptHandle actorHandle, int seatId, bool isAnimationEnabled);
  152.  
  153.         //! <code>Vehicle.ExitVehicle( actorHandle )</code>
  154.         //!             <param name="actorHandle">Actor identifier.</param>
  155.         //! <description>Makes the actor going out from the vehicle.
  156.         int ExitVehicle(IFunctionHandler* pH, ScriptHandle actorHandle);
  157.  
  158.         //! <code>Vehicle.GetComponentDamageRatio( componentName )</code>
  159.         //! <description>Gets the damage ratio of the specified component.</description>
  160.         int GetComponentDamageRatio(IFunctionHandler* pH, const char* pComponentName);
  161.  
  162.         //! <code>Vehicle.GetSeatForPassenger(id)</code>
  163.         //! <returns>Vehicle seat id for the specified passenger.</returns>
  164.         //!             <param name="id">passenger id.</param>
  165.         int GetSeatForPassenger(IFunctionHandler* pH, ScriptHandle passengerId);
  166.  
  167.         //! <code>Vehicle.OnSpawnComplete()</code>
  168.         //! <description>Callback into game code for OnSpawnComplete.</description>
  169.         int OnSpawnComplete(IFunctionHandler* pH);
  170.  
  171. private:
  172.  
  173.         void RegisterMethods();
  174.  
  175.         IGameFramework* m_pGameFW;
  176.         IVehicleSystem* m_pVehicleSystem;
  177. };
  178.  
  179. #endif //__SCRIPTBIND_VEHICLE_H__
  180.  
downloadScriptBind_Vehicle.h Source code - Download CRYENGINE Source code
Related Source Codes/Software:
postal - 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top