Browse Source

Collider:isDestroyed;

bjorn 1 year ago
parent
commit
bba6233a2e
2 changed files with 27 additions and 0 deletions
  1. 1 0
      api/lovr/physics/Collider/destroy.lua
  2. 26 0
      api/lovr/physics/Collider/isDestroyed.lua

+ 1 - 0
api/lovr/physics/Collider/destroy.lua

@@ -13,6 +13,7 @@ return {
     Calling functions on the collider after destroying it is a bad idea.
     Calling functions on the collider after destroying it is a bad idea.
   ]],
   ]],
   related = {
   related = {
+    'Collider:isDestroyed',
     'World:destroy',
     'World:destroy',
     'Shape:destroy',
     'Shape:destroy',
     'Joint:destroy'
     'Joint:destroy'

+ 26 - 0
api/lovr/physics/Collider/isDestroyed.lua

@@ -0,0 +1,26 @@
+return {
+  summary = 'Check if the Collider has been destroyed.',
+  description = 'Returns whether the collider has been destroyed.',
+  arguments = {},
+  returns = {
+    destroyed = {
+      type = 'boolean',
+      description = 'Whether the collider has been destroyed.'
+    }
+  },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'destroyed' }
+    }
+  },
+  notes = [[
+    Calling functions on a collider after destroying it is a bad idea.
+  ]],
+  related = {
+    'Collider:destroy',
+    'World:destroy',
+    'Shape:destroy',
+    'Joint:destroy'
+  }
+}