BVB Source Codes

CRYENGINE Show IActorSystem.h Source code

Return Download CRYENGINE: download IActorSystem.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: Actor System interfaces.
  8.  
  9.    -------------------------------------------------------------------------
  10.    History:
  11.    - 26:8:2004   14:55 : Created by M谩rcio Martins
  12.  
  13. *************************************************************************/
  14. #ifndef __IACTORSYSTEM_H__
  15. #define __IACTORSYSTEM_H__
  16.  
  17. #if _MSC_VER > 1000
  18.         #pragma once
  19. #endif
  20.  
  21. #include <CryEntitySystem/IEntity.h>
  22. #include <CryEntitySystem/IEntitySystem.h>
  23. #include <CryScriptSystem/IScriptSystem.h>
  24. #include "IGameObjectSystem.h"
  25. #include "IGameObject.h"
  26.  
  27. enum EActorPhysicalization
  28. {
  29.         eAP_NotPhysicalized,
  30.         eAP_Alive,
  31.         eAP_Ragdoll,
  32.         eAP_Sleep,
  33.         eAP_Frozen,
  34.         eAP_Linked,
  35.         eAP_Spectator,
  36. };
  37.  
  38. struct IActor;
  39. struct IActionListener;
  40. struct IAnimationGraphState;
  41. struct SViewParams;
  42. class CGameObject;
  43. struct IGameObjectExtension;
  44. struct IInventory;
  45. struct IAnimatedCharacter;
  46. struct ICharacterInstance;
  47. struct AnimEventInstance;
  48. struct IAIAction;
  49. struct pe_params_rope;
  50.  
  51. //--------------------------------------------------------------------------------
  52. //--------------------------------------------------------------------------------
  53. //--------------------------------------------------------------------------------
  54.  
  55. typedef int ActorClass;
  56.  
  57. struct IActor : public IGameObjectExtension
  58. {
  59.         virtual ~IActor(){}
  60.         virtual void                  SetHealth(float health) = 0;
  61.         virtual float                 GetHealth() const = 0;
  62.         virtual int                   GetHealthAsRoundedPercentage() const = 0;
  63.         virtual void                  SetMaxHealth(float maxHealth) = 0;
  64.         virtual float                 GetMaxHealth() const = 0;
  65.         virtual int                   GetArmor() const = 0;
  66.         virtual int                   GetMaxArmor() const = 0;
  67.         virtual int                   GetTeamId() const = 0;
  68.  
  69.         virtual bool                  IsFallen() const = 0;
  70.         virtual bool                  IsDead() const = 0;
  71.         virtual int                   IsGod() = 0;
  72.         virtual void                  Fall(Vec3 hitPos = Vec3(0, 0, 0)) = 0;
  73.         virtual bool                  AllowLandingBob() = 0;
  74.  
  75.         virtual void                  PlayAction(const char* action, const char* extension, bool looping = false) = 0;
  76.         virtual IAnimationGraphState* GetAnimationGraphState() = 0;
  77.         virtual void                  ResetAnimationState() = 0;
  78.  
  79.         virtual void                  CreateScriptEvent(const char* event, float value, const char* str = NULL) = 0;
  80.         virtual bool                  BecomeAggressiveToAgent(EntityId entityID) = 0;
  81.  
  82.         virtual void                  SetFacialAlertnessLevel(int alertness) = 0;
  83.         virtual void                  RequestFacialExpression(const char* pExpressionName = NULL, f32* sequenceLength = NULL) = 0;
  84.         virtual void                  PrecacheFacialExpression(const char* pExpressionName) = 0;
  85.  
  86.         virtual EntityId              GetGrabbedEntityId() const = 0;
  87.  
  88.         virtual void                  HideAllAttachments(bool isHiding) = 0;
  89.  
  90.         virtual void                  SetIKPos(const char* pLimbName, const Vec3& goalPos, int priority) = 0;
  91.  
  92.         virtual void                  SetViewInVehicle(Quat viewRotation) = 0;
  93.         virtual void                  SetViewRotation(const Quat& rotation) = 0;
  94.         virtual Quat                  GetViewRotation() const = 0;
  95.  
  96.         virtual bool                  IsFriendlyEntity(EntityId entityId, bool bUsingAIIgnorePlayer = true) const = 0;
  97.  
  98.         //virtual Vec3 GetViewAngleOffset() = 0;
  99.         virtual Vec3                 GetLocalEyePos() const = 0;
  100.  
  101.         virtual void                 CameraShake(float angle, float shift, float duration, float frequency, Vec3 pos, int ID, const char* source = "") = 0;
  102.  
  103.         virtual IItem*               GetHolsteredItem() const = 0;
  104.         virtual void                 HolsterItem(bool holster, bool playSelect = true, float selectSpeedBias = 1.0f, bool hideLeftHandObject = true) = 0;
  105.         //virtual IItem *GetCurrentItem() const = 0;
  106.         virtual IItem*               GetCurrentItem(bool includeVehicle = false) const = 0;
  107.         virtual bool                 DropItem(EntityId itemId, float impulseScale = 1.0f, bool selectNext = true, bool byDeath = false) = 0;
  108.         virtual IInventory*          GetInventory() const = 0;
  109.         virtual void                 NotifyCurrentItemChanged(IItem* newItem) = 0;
  110.  
  111.         virtual IMovementController* GetMovementController() const = 0;
  112.  
  113.         // get currently linked vehicle, or NULL
  114.         virtual IEntity* LinkToVehicle(EntityId vehicleId) = 0;
  115.  
  116.         virtual IEntity* GetLinkedEntity() const = 0;
  117.  
  118.         virtual uint8    GetSpectatorMode() const = 0;
  119.  
  120.         virtual bool     IsThirdPerson() const = 0;
  121.         virtual void     ToggleThirdPerson() = 0;
  122.  
  123.         virtual bool     IsStillWaitingOnServerUseResponse() const        { return false; }
  124.         virtual void     SetStillWaitingOnServerUseResponse(bool waiting) {}
  125.  
  126.         virtual void     SetFlyMode(uint8 flyMode)                        {};
  127.         virtual uint8    GetFlyMode() const                               { return 0; };
  128.  
  129.         //virtual void SendRevive(const Vec3& position, const Quat& orientation, int team, bool clearInventory) = 0;
  130.  
  131.         virtual void                      Release() = 0;
  132.  
  133.         virtual bool                      IsPlayer() const = 0;
  134.         virtual bool                      IsClient() const = 0;
  135.         virtual bool                      IsMigrating() const = 0;
  136.         virtual void                      SetMigrating(bool isMigrating) = 0;
  137.  
  138.         virtual void                      InitLocalPlayer() = 0;
  139.  
  140.         virtual const char*               GetActorClassName() const = 0;
  141.         virtual ActorClass                GetActorClass() const = 0;
  142.  
  143.         virtual const char*               GetEntityClassName() const = 0;
  144.  
  145.         virtual void                      SerializeLevelToLevel(TSerialize& ser) = 0;
  146.         virtual void                      ProcessEvent(SEntityEvent& event) = 0;
  147.  
  148.         virtual IAnimatedCharacter*       GetAnimatedCharacter() = 0;
  149.         virtual const IAnimatedCharacter* GetAnimatedCharacter() const = 0;
  150.         virtual void                      PlayExactPositioningAnimation(const char* sAnimationName, bool bSignal, const Vec3& vPosition, const Vec3& vDirection, float startWidth, float startArcAngle, float directionTolerance) = 0;
  151.         virtual void                      CancelExactPositioningAnimation() = 0;
  152.         virtual void                      PlayAnimation(const char* sAnimationName, bool bSignal) = 0;
  153.  
  154.         // Respawn the actor to some intiial data (used by CheckpointSystem)
  155.         virtual bool Respawn()
  156.         {
  157.                 CryWarning(VALIDATOR_MODULE_GAME, VALIDATOR_WARNING, "Use of IActor::Respawn when not implemented!");
  158.                 return false;
  159.         }
  160.  
  161.         // Reset the actor to its initial location (used by CheckpointSystem)
  162.         virtual void ResetToSpawnLocation()
  163.         {
  164.                 CryWarning(VALIDATOR_MODULE_GAME, VALIDATOR_WARNING, "Use of IActor::ResetToSpawnLocation when not implemented!");
  165.         }
  166.  
  167.         // Can the actor currently break through glass (used by ActionGame)
  168.         virtual bool CanBreakGlass() const
  169.         {
  170.                 return false;
  171.         }
  172.  
  173.         // Forces the actor break through glass if allowed (used by ActionGame)
  174.         virtual bool MustBreakGlass() const
  175.         {
  176.                 return false;
  177.         }
  178.  
  179.         // Enables/Disables time demo mode.
  180.         // Some movement/view direction things work differently when running under time demo.
  181.         virtual void EnableTimeDemo(bool bTimeDemo) = 0;
  182.  
  183.         uint16       GetChannelId() const
  184.         {
  185.                 return GetGameObject()->GetChannelId();
  186.         }
  187.         void SetChannelId(uint16 id)
  188.         {
  189.                 GetGameObject()->SetChannelId(id);
  190.         }
  191.  
  192.         virtual void SwitchDemoModeSpectator(bool activate) = 0;
  193.  
  194.         //virtual void NotifyLeaveFallAndPlay() = 0;
  195.         //virtual void NotifyInventoryAmmoChange(IEntityClass* pAmmoClass, int amount) = 0;
  196.  
  197.         virtual void SetCustomHead(const char* customHead) {};// = 0;
  198.  
  199.         // IVehicle
  200.         virtual IVehicle* GetLinkedVehicle() const = 0;
  201.  
  202.         virtual void      OnAIProxyEnabled(bool enabled) = 0;
  203.         virtual void      OnReturnedToPool() = 0;
  204.         virtual void      OnPreparedFromPool() = 0;
  205.         virtual void      OnShiftWorld()                        {};
  206.  
  207.         virtual void      MountedGunControllerEnabled(bool val) {};
  208.         virtual bool      MountedGunControllerEnabled() const   { return false; }
  209.  
  210.         virtual bool      ShouldMuteWeaponSoundStimulus() const = 0;
  211.  
  212.         // Populates list of physics entities to skip for IK raycasting. returns num Entities to skip
  213.         virtual int  GetPhysicalSkipEntities(IPhysicalEntity** pSkipList, const int maxSkipSize) const { return 0; }
  214.  
  215.         virtual void OnReused(IEntity* pEntity, SEntitySpawnParams& params) = 0;
  216.  
  217.         virtual bool IsInteracting() const = 0;
  218. };
  219.  
  220. struct IActorIterator
  221. {
  222.         virtual ~IActorIterator(){}
  223.         virtual size_t  Count() = 0;
  224.         virtual IActor* Next() = 0;
  225.         virtual void    AddRef() = 0;
  226.         virtual void    Release() = 0;
  227. };
  228. typedef _smart_ptr<IActorIterator> IActorIteratorPtr;
  229.  
  230. struct IItemParamsNode;
  231.  
  232. struct IActorSystem
  233. {
  234.         virtual ~IActorSystem(){}
  235.         virtual void                   Reset() = 0;
  236.         virtual void                   Reload() = 0;
  237.         virtual IActor*                GetActor(EntityId entityId) = 0;
  238.         virtual IActor*                GetActorByChannelId(uint16 channelId) = 0;
  239.         virtual IActor*                CreateActor(uint16 channelId, const char* name, const char* actorClass, const Vec3& pos, const Quat& rot, const Vec3& scale, EntityId id = 0) = 0;
  240.  
  241.         virtual int                    GetActorCount() const = 0;
  242.         virtual IActorIteratorPtr      CreateActorIterator() = 0;
  243.  
  244.         virtual void                   SetDemoPlaybackMappedOriginalServerPlayer(EntityId id) = 0;
  245.         virtual EntityId               GetDemoPlaybackMappedOriginalServerPlayer() const = 0;
  246.         virtual void                   SwitchDemoSpectator(EntityId id = 0) = 0;
  247.         virtual IActor*                GetCurrentDemoSpectator() = 0;
  248.         virtual IActor*                GetOriginalDemoSpectator() = 0;
  249.  
  250.         virtual void                   AddActor(EntityId entityId, IActor* pActor) = 0;
  251.         virtual void                   RemoveActor(EntityId entityId) = 0;
  252.  
  253.         virtual void                   Scan(const char* folderName) = 0;
  254.         virtual bool                   ScanXML(const XmlNodeRef& root, const char* xmlFile) = 0;
  255.         virtual const IItemParamsNode* GetActorParams(const char* actorClass) const = 0;
  256.  
  257.         virtual bool                   IsActorClass(IEntityClass* pClass) const = 0;
  258. };
  259.  
  260. #endif //__IACTORSYSTEM_H__
  261.  
downloadIActorSystem.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