animate.lua 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. return {
  2. tag = 'input',
  3. summary = 'Animate a model to match its Device input state.',
  4. description = [[
  5. Animates a device model to match its current input state. The buttons and joysticks on a
  6. controller will move as they're pressed/moved and hand models will move to match skeletal input.
  7. The model should have been created using `lovr.headset.newModel` with the `animated` flag set to
  8. `true`.
  9. ]],
  10. arguments = {
  11. {
  12. name = 'device',
  13. type = 'Device',
  14. default = [['head']],
  15. description = 'The device to use for the animation data.'
  16. },
  17. {
  18. name = 'model',
  19. type = 'Model',
  20. description = 'The model to animate.'
  21. }
  22. },
  23. returns = {
  24. {
  25. name = 'success',
  26. type = 'boolean',
  27. description = [[
  28. Whether the animation was applied successfully to the Model. If the Model was not
  29. compatible or animation data for the device was not available, this will be `false`.
  30. ]]
  31. }
  32. },
  33. notes = [[
  34. Currently this function is supported for OpenVR controller models and Oculus hand models.
  35. This function may animate using node-based animation or skeletal animation. `Model:hasJoints`
  36. can be used on a Model so you know if a Shader with the `animated` ShaderFlag needs to be used
  37. to render the results properly.
  38. It's possible to use models that weren't created with `lovr.headset.newModel` but they need to
  39. be set up carefully to have the same structure as the models provided by the headset SDK.
  40. ]],
  41. related = {
  42. 'lovr.headset.newModel',
  43. 'Model:animate',
  44. 'Model:pose'
  45. }
  46. }