pose.lua 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. return {
  2. summary = 'Set the pose of a single node, or clear the pose.',
  3. description = [[
  4. Applies a pose to a single node of the Model. The input pose is assumed to be relative to the
  5. pose of the node's parent. This is useful for applying inverse kinematics (IK) to a chain of
  6. bones in a skeleton.
  7. The alpha parameter can be used to mix between the node's current pose and the input pose.
  8. ]],
  9. arguments = {
  10. name = {
  11. type = 'string',
  12. description = 'The name of the node.'
  13. },
  14. index = {
  15. type = 'number',
  16. description = 'The node index.'
  17. },
  18. x = {
  19. type = 'number',
  20. description = 'The x position.'
  21. },
  22. y = {
  23. type = 'number',
  24. description = 'The y position.'
  25. },
  26. z = {
  27. type = 'number',
  28. description = 'The z position.'
  29. },
  30. angle = {
  31. type = 'number',
  32. description = 'The angle of rotation around the axis, in radians.'
  33. },
  34. ax = {
  35. type = 'number',
  36. description = 'The x component of the rotation axis.'
  37. },
  38. ay = {
  39. type = 'number',
  40. description = 'The y component of the rotation axis.'
  41. },
  42. az = {
  43. type = 'number',
  44. description = 'The z component of the rotation axis.'
  45. },
  46. alpha = {
  47. type = 'number',
  48. default = '1',
  49. description = 'How much of the pose to mix in, from 0 to 1.'
  50. }
  51. },
  52. returns = {},
  53. variants = {
  54. {
  55. arguments = { 'name', 'x', 'y', 'z', 'angle', 'ax', 'ay', 'az', 'alpha' },
  56. returns = {}
  57. },
  58. {
  59. arguments = { 'index', 'x', 'y', 'z', 'angle', 'ax', 'ay', 'az', 'alpha' },
  60. returns = {}
  61. },
  62. {
  63. description = 'Clear the pose of the Model.',
  64. arguments = {},
  65. returns = {}
  66. }
  67. },
  68. notes = [[
  69. For skinned nodes to render correctly, use a Shader created with the `animated` flag set to
  70. `true`. See `lovr.graphics.newShader` for more.
  71. ]],
  72. related = {
  73. 'Model:getNodePose',
  74. 'Model:animate',
  75. 'Model:getNodeName',
  76. 'Model:getNodeCount'
  77. }
  78. }