summaryrefslogtreecommitdiffhomepage
path: root/not/PhysicalBody.lua
diff options
context:
space:
mode:
Diffstat (limited to 'not/PhysicalBody.lua')
-rw-r--r--not/PhysicalBody.lua19
1 files changed, 19 insertions, 0 deletions
diff --git a/not/PhysicalBody.lua b/not/PhysicalBody.lua
index a7abcc0..a9ac63b 100644
--- a/not/PhysicalBody.lua
+++ b/not/PhysicalBody.lua
@@ -38,6 +38,14 @@ function PhysicalBody:setPosition (x, y)
self.body:setPosition(x, y)
end
+-- Velocity-related methods.
+function PhysicalBody:setLinearVelocity (x, y)
+ self.body:setLinearVelocity(x, y)
+end
+function PhysicalBody:getLinearVelocity ()
+ return self.body:getLinearVelocity()
+end
+
-- Various setters from Body.
-- type: BodyType ("static", "dynamic", "kinematic")
function PhysicalBody:setBodyType (type)
@@ -46,6 +54,17 @@ end
function PhysicalBody:setBodyFixedRotation (bool)
self.body:setFixedRotation(bool)
end
+function PhysicalBody:setBodyActive (bool)
+ self.body:setActive(bool)
+end
+
+-- Physical influence methods.
+function PhysicalBody:applyLinearImpulse (x, y)
+ self.body:applyLinearImpulse(x, y)
+end
+function PhysicalBody:applyForce (x, y)
+ self.body:applyForce(x, y)
+end
-- Update of `PhysicalBody`.
function PhysicalBody:update (dt)