getNodePose.lua 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. return {
  2. summary = 'Get the pose of a single node.',
  3. description = 'Returns the pose of a single node in the Model in a given `CoordinateSpace`.',
  4. arguments = {
  5. name = {
  6. type = 'string',
  7. description = 'The name of the node.'
  8. },
  9. index = {
  10. type = 'number',
  11. description = 'The node index.'
  12. },
  13. space = {
  14. type = 'CoordinateSpace',
  15. default = [['global']],
  16. description = [[
  17. Whether the pose should be returned relative to the node's parent or relative to the root
  18. node of the Model.
  19. ]]
  20. }
  21. },
  22. returns = {
  23. x = {
  24. type = 'number',
  25. description = 'The x position of the node.'
  26. },
  27. y = {
  28. type = 'number',
  29. description = 'The y position of the node.'
  30. },
  31. z = {
  32. type = 'number',
  33. description = 'The z position of the node.'
  34. },
  35. angle = {
  36. type = 'number',
  37. description = 'The number of radians the node is rotated around its rotational axis.'
  38. },
  39. ax = {
  40. type = 'number',
  41. description = 'The x component of the axis of rotation.'
  42. },
  43. ay = {
  44. type = 'number',
  45. description = 'The y component of the axis of rotation.'
  46. },
  47. az = {
  48. type = 'number',
  49. description = 'The z component of the axis of rotation.'
  50. }
  51. },
  52. variants = {
  53. {
  54. arguments = { 'name', 'space' },
  55. returns = { 'x', 'y', 'z', 'angle', 'ax', 'ay', 'az' }
  56. },
  57. {
  58. arguments = { 'index', 'space' },
  59. returns = { 'x', 'y', 'z', 'angle', 'ax', 'ay', 'az' }
  60. }
  61. },
  62. notes = [[
  63. For skinned nodes to render correctly, use a Shader created with the `animated` flag set to
  64. `true`. See `lovr.graphics.newShader` for more.
  65. ]],
  66. related = {
  67. 'Model:pose',
  68. 'Model:animate',
  69. 'Model:getNodeName',
  70. 'Model:getNodeCount'
  71. }
  72. }