getMass.lua 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. return {
  2. summary = 'Compute mass properties of the Shape.',
  3. description = 'Computes mass properties of the Shape.',
  4. arguments = {
  5. density = {
  6. type = 'number',
  7. description = 'The density to use, in kilograms per cubic meter.'
  8. },
  9. },
  10. returns = {
  11. cx = {
  12. type = 'number',
  13. description = 'The x position of the center of mass.'
  14. },
  15. cy = {
  16. type = 'number',
  17. description = 'The y position of the center of mass.'
  18. },
  19. cz = {
  20. type = 'number',
  21. description = 'The z position of the center of mass.'
  22. },
  23. mass = {
  24. type = 'number',
  25. description = 'The mass of the Shape.'
  26. },
  27. inertia = {
  28. type = 'table',
  29. description = [[
  30. A table containing 6 values of the rotational inertia tensor matrix. The table contains the
  31. 3 diagonal elements of the matrix (upper left to bottom right), followed by the 3 elements
  32. of the upper right portion of the 3x3 matrix.
  33. ]]
  34. }
  35. },
  36. variants = {
  37. {
  38. arguments = { 'density' },
  39. returns = { 'cx', 'cy', 'cz', 'mass', 'inertia' }
  40. }
  41. },
  42. related = {
  43. 'Collider:getMass',
  44. 'Collider:setMass',
  45. 'Collider:getMassData',
  46. 'Collider:setMassData'
  47. }
  48. }