BVB Source Codes

CRYENGINE Show AttachmentFace.h Source code

Return Download CRYENGINE: download AttachmentFace.h Source code - Download CRYENGINE Source code - Type:.h
  1. // Copyright 2001-2016 Crytek GmbH / Crytek Group. All rights reserved.
  2.  
  3. #pragma once
  4.  
  5. #include "AttachmentBase.h"
  6. #include "SocketSimulation.h"
  7. #include "ModelMesh.h"
  8.  
  9. class CAttachmentFACE : public SAttachmentBase
  10. {
  11. public:
  12.  
  13.         CAttachmentFACE()
  14.         {
  15.                 m_AttRelativeDefault.SetIdentity();
  16.                 m_AttAbsoluteDefault.SetIdentity();
  17.                 m_AttModelRelative.SetIdentity();
  18.                 m_addTransformation.SetIdentity();
  19.         };
  20.  
  21.         ~CAttachmentFACE() {};
  22.  
  23.         virtual void AddRef()
  24.         {
  25.                 ++m_nRefCounter;
  26.         }
  27.  
  28.         virtual void Release()
  29.         {
  30.                 if (--m_nRefCounter == 0)
  31.                         delete this;
  32.         }
  33.  
  34.         virtual uint32             GetType() const                             { return CA_FACE; }
  35.         virtual uint32             SetJointName(const char* szJointName)       { return 0; }
  36.  
  37.         virtual const char*        GetName() const                             { return m_strSocketName; };
  38.         virtual uint32             GetNameCRC() const                          { return m_nSocketCRC32; }
  39.         virtual uint32             ReName(const char* szJointName, uint32 crc) { m_strSocketName.clear();  m_strSocketName = szJointName; m_nSocketCRC32 = crc;  return 1; };
  40.  
  41.         virtual uint32             GetFlags() const                            { return m_AttFlags; }
  42.         virtual void               SetFlags(uint32 flags)                      { m_AttFlags = flags; }
  43.  
  44.         virtual uint32             Immediate_AddBinding(IAttachmentObject* pIAttachmentObject, ISkin* pISkin = 0, uint32 nLoadingFlags = 0);
  45.         virtual void               Immediate_ClearBinding(uint32 nLoadingFlags = 0);
  46.         virtual uint32             Immediate_SwapBinding(IAttachment* pNewAttachment);
  47.  
  48.         virtual IAttachmentObject* GetIAttachmentObject() const { return m_pIAttachmentObject;  }
  49.         virtual IAttachmentSkin*   GetIAttachmentSkin()         { return 0; }
  50.  
  51.         virtual void               HideAttachment(uint32 x);
  52.         virtual uint32             IsAttachmentHidden() const             { return m_AttFlags & FLAGS_ATTACH_HIDE_MAIN_PASS; }
  53.         virtual void               HideInRecursion(uint32 x);
  54.         virtual uint32             IsAttachmentHiddenInRecursion() const  { return m_AttFlags & FLAGS_ATTACH_HIDE_RECURSION; }
  55.         virtual void               HideInShadow(uint32 x);
  56.         virtual uint32             IsAttachmentHiddenInShadow() const     { return m_AttFlags & FLAGS_ATTACH_HIDE_SHADOW_PASS; }
  57.  
  58.         virtual void               SetAttAbsoluteDefault(const QuatT& qt) { m_AttAbsoluteDefault = qt;  m_AttFlags &= (~FLAGS_ATTACH_PROJECTED);  assert(m_AttAbsoluteDefault.q.IsValid()); };
  59.         virtual const QuatT&      GetAttAbsoluteDefault() const          { return m_AttAbsoluteDefault;  };
  60.         virtual void              SetAttRelativeDefault(const QuatT& qt) { m_AttRelativeDefault = qt; m_AttFlags |= FLAGS_ATTACH_PROJECTED;  assert(m_AttRelativeDefault.q.IsValid()); };
  61.         virtual const QuatT&      GetAttRelativeDefault() const          { return m_AttRelativeDefault; };
  62.         virtual const QuatT&      GetAttModelRelative() const            { return m_AttModelRelative;  };//this is relative to the animated bone
  63.         virtual const QuatTS      GetAttWorldAbsolute() const;
  64.         virtual const QuatT&      GetAdditionalTransformation() const    { return m_addTransformation; }
  65.         virtual void              UpdateAttModelRelative();
  66.  
  67.         virtual uint32            GetJointID() const     { return -1; };
  68.  
  69.         virtual void              AlignJointAttachment() {};
  70.  
  71.         virtual SimulationParams& GetSimulationParams()  { return m_Simulation;  };
  72.         virtual void              PostUpdateSimulationParams(bool bAttachmentSortingRequired, const char* pJointName = 0);
  73.  
  74.         uint32                    ProjectAttachment(const Skeleton::CPoseData* pPoseData);
  75.         void                      ComputeTriMat();
  76.         void                      Update_Empty(Skeleton::CPoseData& pPoseData);
  77.         void                      Update_Static(Skeleton::CPoseData& pPoseData);
  78.         void                      Update_Execute(Skeleton::CPoseData& pPoseData);
  79.  
  80.         virtual void              Serialize(TSerialize ser);
  81.         virtual size_t            SizeOfThis() const;
  82.         virtual void              GetMemoryUsage(ICrySizer* pSizer) const;
  83.  
  84.         QuatT       m_AttRelativeDefault; //attachment location relative to the facematrix/bonematrix in default pose;
  85.         QuatT       m_AttAbsoluteDefault; //attachment location relative to the model when character is in default-pose
  86.         QuatT       m_AttModelRelative;   //the position and orientation of the attachment in animated relative model-space (=relative to Vec3(0,0,0))
  87.         QuatT       m_addTransformation;  //additional rotation applied during rendering.
  88.         ClosestTri  m_Triangle;
  89.         CSimulation m_Simulation;
  90. protected:
  91.         void ClearBinding_Internal(bool release);
  92. };
  93.  
downloadAttachmentFace.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