Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

71 lines
2.2 KiB

  1. //========= Copyright c 1996-2008, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $Workfile: $
  6. // $Date: $
  7. //
  8. //-----------------------------------------------------------------------------
  9. // $Log: $
  10. //
  11. // $NoKeywords: $
  12. //=============================================================================//
  13. #ifndef COLLISION_MODEL_OPTIONS_H
  14. #define COLLISION_MODEL_OPTIONS_H
  15. #include "tier1/utlvector.h"
  16. #define MAX_EXTRA_COLLISION_MODELS 24
  17. struct extramodel_t
  18. {
  19. struct s_source_t *m_pSrc;
  20. matrix3x4_t m_matOffset;
  21. bool m_bConcave;
  22. };
  23. class CCollisionModelSource
  24. {
  25. public:
  26. struct s_source_t *m_pModel;
  27. extramodel_t m_ExtraModels[MAX_EXTRA_COLLISION_MODELS+1];
  28. bool m_isJointed;
  29. bool m_bAssumeWorldspace; // assume the model is already declared in worldspace, regardless of bone names
  30. bool m_allowConcave;
  31. int m_maxConvex;
  32. char * m_pOverrideName;
  33. CUtlVector<int> m_bonemap/*[MAXSTUDIOSRCBONES]*/;
  34. char m_rootName[128];
  35. bool m_allowConcaveJoints;
  36. bool m_bRootCollisionIsEmpty;
  37. public:
  38. void ConvertToWorldSpace(CUtlVector<Vector> &worldVerts, s_source_t *pmodel);
  39. void ConvertToBoneSpace( int boneIndex, CUtlVector<Vector> &boneVerts );
  40. bool ShouldProcessBone( int boneIndex );
  41. void Simplify();
  42. void SkipBone( int boneIndex );
  43. void InitBoneMap( void );
  44. void MergeBones( int parent, int child );
  45. void MergeBones(const char *parent, const char *child);
  46. int FindLocalBoneNamed( const char *pName );
  47. bool FaceHasVertOnBone( const struct s_face_t &face, int boneIndex );
  48. s_face_t GetGlobalFace( struct s_mesh_t *pMesh, int nFace );
  49. void FindBoundBones(struct s_mesh_t *pMesh, CUtlVector<int>&setBones);
  50. void FindBoundBones(struct s_boneweight_t &weights, CUtlVector<int>&setBones);
  51. int RemapBone( int boneIndex ) const;
  52. };
  53. // list of vertex indices that form a convex element
  54. struct convexlist_t
  55. {
  56. int firstVertIndex;
  57. int numVertIndex;
  58. };
  59. // Purpose: Fixup the pointers in this face to reference the mesh globally (source relative)
  60. // (faces are mesh relative, each source has several meshes)
  61. extern void GlobalFace( s_face_t *pout, s_mesh_t *pmesh, s_face_t *pin );
  62. #endif