BVB Source Codes

CRYENGINE Show VehiclePartAnimatedChar.cpp Source code

Return Download CRYENGINE: download VehiclePartAnimatedChar.cpp Source code - Download CRYENGINE Source code - Type:.cpp
  1. // Copyright 2001-2016 Crytek GmbH / Crytek Group. All rights reserved.
  2.  
  3. /*************************************************************************
  4.    -------------------------------------------------------------------------
  5.    $Id$
  6.    $DateTime$
  7.    Description: Implements a part for vehicles which uses animated characters
  8.  
  9.    -------------------------------------------------------------------------
  10.    History:
  11.    - 24:08:2011: Created by Richard Semmens
  12.  
  13. *************************************************************************/
  14. #include "StdAfx.h"
  15.  
  16. #include <CryAnimation/ICryAnimation.h>
  17. #include "IVehicleSystem.h"
  18.  
  19. #include "CryAction.h"
  20. #include "Vehicle.h"
  21. #include "VehiclePartBase.h"
  22. #include "VehiclePartAnimated.h"
  23. #include "VehiclePartAnimatedChar.h"
  24. #include "VehicleUtils.h"
  25.  
  26. //#pragma optimize("", off)
  27. //#pragma inline_depth(0)
  28.  
  29. //------------------------------------------------------------------------
  30. CVehiclePartAnimatedChar::CVehiclePartAnimatedChar()
  31. {
  32. }
  33.  
  34. //------------------------------------------------------------------------
  35. CVehiclePartAnimatedChar::~CVehiclePartAnimatedChar()
  36. {
  37. }
  38.  
  39. //------------------------------------------------------------------------
  40. void CVehiclePartAnimatedChar::Physicalize()
  41. {
  42.         if (m_pSharedParameters->m_isPhysicalized && GetEntity()->GetPhysics())
  43.         {
  44.                 if (m_slot != -1)
  45.                         GetEntity()->UnphysicalizeSlot(m_slot);
  46.  
  47.                 SEntityPhysicalizeParams params;
  48.                 params.mass = m_pSharedParameters->m_mass;
  49.                 params.density = m_pSharedParameters->m_density;
  50.  
  51.                 //TODO: Check civcar for 'proper' slot allocation
  52.                 params.nSlot = 0; //m_slot;
  53.                 params.type = PE_LIVING;
  54.                 GetEntity()->PhysicalizeSlot(m_slot, params); // always returns -1 for chars
  55.  
  56.                 if (m_pCharInstance)
  57.                 {
  58.                         FlagSkeleton(m_pCharInstance->GetISkeletonPose(), m_pCharInstance->GetIDefaultSkeleton());
  59.                 }
  60.  
  61.                 m_pVehicle->RequestPhysicalization(this, false);
  62.         }
  63.  
  64.         GetEntity()->SetSlotFlags(m_slot, GetEntity()->GetSlotFlags(m_slot) | ENTITY_SLOT_IGNORE_PHYSICS);
  65. }
  66.  
  67. DEFINE_VEHICLEOBJECT(CVehiclePartAnimatedChar);
  68.  
downloadVehiclePartAnimatedChar.cpp 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