BVB Source Codes

CRYENGINE Show TargetImpl.h Source code

Return Download CRYENGINE: download TargetImpl.h Source code - Download CRYENGINE Source code - Type:.h
  1. // Copyright 2001-2016 Crytek GmbH / Crytek Group. All rights reserved.
  2.  
  3. namespace pfx2
  4. {
  5.  
  6. ILINE Vec3 CTargetSource::GetTarget(const SUpdateContext& context, TParticleId particleId, bool isParentId)
  7. {
  8.         const CParticleEmitter& emitter = *context.m_runtime.GetEmitter();
  9.         const Quat defaultQuat = emitter.GetLocation().q;
  10.  
  11.         if (m_source == ETargetSource::Target)
  12.         {
  13.                 const ParticleTarget& target = emitter.GetTarget();
  14.                 const Vec3 wTarget = target.bTarget ?
  15.                                      target.vTarget :
  16.                                      emitter.GetPos();
  17.                 return wTarget + defaultQuat * m_offset;
  18.         }
  19.  
  20.         CParticleContainer* pContainer = &context.m_container;
  21.  
  22.         if (m_source == ETargetSource::Parent || isParentId)
  23.         {
  24.                 if (!isParentId)
  25.                 {
  26.                         const IPidStream parentIds = pContainer->GetIPidStream(EPDT_ParentId);
  27.                         particleId = parentIds.Load(particleId);
  28.                 }
  29.                 pContainer = &context.m_parentContainer;
  30.         }
  31.  
  32.         const IVec3Stream positions = pContainer->GetIVec3Stream(EPVF_Position);
  33.         const IQuatStream quats = pContainer->GetIQuatStream(EPQF_Orientation, defaultQuat);
  34.  
  35.         const Quat wQuat = quats.SafeLoad(particleId);
  36.         const Vec3 wTarget = positions.Load(particleId);
  37.  
  38.         return wTarget + wQuat * m_offset;
  39. }
  40.  
  41. }
  42.  
downloadTargetImpl.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