getBoundingBox.lua 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. return {
  2. summary = 'Get the bounding box of the Mesh.',
  3. description = [[
  4. Returns the axis-aligned bounding box of the Mesh, or `nil` if the Mesh doesn't have a bounding
  5. box.
  6. Meshes with the `cpu` storage mode can compute their bounding box automatically using
  7. `Mesh:computeBoundingBox`. The bounding box can also be set manually using
  8. `Mesh:setBoundingBox`.
  9. Passes will use the bounding box of a Mesh to cull it against the cameras when
  10. `Pass:setViewCull` is enabled, which avoids rendering it when it's out of view.
  11. ]],
  12. arguments = {},
  13. returns = {
  14. minx = {
  15. type = 'number',
  16. description = 'The minimum x coordinate of the bounding box.'
  17. },
  18. maxx = {
  19. type = 'number',
  20. description = 'The maximum x coordinate of the bounding box.'
  21. },
  22. miny = {
  23. type = 'number',
  24. description = 'The minimum y coordinate of the bounding box.'
  25. },
  26. maxy = {
  27. type = 'number',
  28. description = 'The maximum y coordinate of the bounding box.'
  29. },
  30. minz = {
  31. type = 'number',
  32. description = 'The minimum z coordinate of the bounding box.'
  33. },
  34. maxz = {
  35. type = 'number',
  36. description = 'The maximum z coordinate of the bounding box.'
  37. }
  38. },
  39. variants = {
  40. {
  41. arguments = {},
  42. returns = { 'minx', 'maxx', 'miny', 'maxy', 'minz', 'maxz' }
  43. }
  44. },
  45. related = {
  46. 'Mesh:computeBoundingBox',
  47. 'Pass:setViewCull',
  48. 'Collider:getAABB',
  49. 'Shape:getAABB',
  50. 'Model:getBoundingBox',
  51. 'ModelData:getBoundingBox'
  52. }
  53. }