llskinningutil.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /**
  2. * @file llskinningutil.h
  3. * @brief Functions for mesh object skinning
  4. * @author [email protected]
  5. *
  6. * $LicenseInfo:firstyear=2015&license=viewerlgpl$
  7. * Second Life Viewer Source Code
  8. * Copyright (C) 2015, Linden Research, Inc.
  9. *
  10. * This library is free software; you can redistribute it and/or
  11. * modify it under the terms of the GNU Lesser General Public
  12. * License as published by the Free Software Foundation;
  13. * version 2.1 of the License only.
  14. *
  15. * This library is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  18. * Lesser General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU Lesser General Public
  21. * License along with this library; if not, write to the Free Software
  22. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  23. *
  24. * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
  25. * $/LicenseInfo$
  26. */
  27. #ifndef LLSKINNINGUTIL_H
  28. #define LLSKINNINGUTIL_H
  29. #include "stdtypes.h"
  30. class LLMatrix4a;
  31. class LLMeshSkinInfo;
  32. class LLQuaternion;
  33. class LLVOAvatar;
  34. class LLVolumeFace;
  35. class LLSkinningUtil
  36. {
  37. public:
  38. static void scrubInvalidJoints(LLVOAvatar* avatar, LLMeshSkinInfo* skin);
  39. static U32 initSkinningMatrixPalette(LLMatrix4a* mat,
  40. const LLMeshSkinInfo* skin,
  41. LLVOAvatar* avatar);
  42. static void checkSkinWeights(const LLVector4a* weights, U32 num_vertices,
  43. const LLMeshSkinInfo* skin);
  44. static void scrubSkinWeights(LLVector4a* weights, U32 num_vertices,
  45. const LLMeshSkinInfo* skin);
  46. static void getPerVertexSkinMatrix(const LLVector4a& weights,
  47. const LLMatrix4a* mat,
  48. LLMatrix4a& final_mat,
  49. bool handle_bad_scale = false);
  50. static void updateRiggingInfo(const LLMeshSkinInfo* skin,
  51. LLVOAvatar* avatar, LLVolumeFace& volface);
  52. static LLQuaternion getUnscaledQuaternion(const LLMatrix4& mat4);
  53. };
  54. #endif