2014-03-10 14:04:58 +08:00
--------------------------------
-- @module PhysicsWorld
2014-07-02 10:15:26 +08:00
-- @parent_module cc
2014-03-18 15:55:30 +08:00
2014-03-10 14:04:58 +08:00
--------------------------------
2014-09-02 13:45:07 +08:00
-- set the gravity value
2014-08-13 14:42:14 +08:00
-- @function [parent=#PhysicsWorld] setGravity
2014-03-10 14:04:58 +08:00
-- @param self
2014-09-02 13:45:07 +08:00
-- @param #vec2_table gravity
2015-01-21 17:33:26 +08:00
-- @return PhysicsWorld#PhysicsWorld self (return value: cc.PhysicsWorld)
2014-03-10 14:04:58 +08:00
--------------------------------
2014-09-02 13:45:07 +08:00
-- Get all the bodys that in the physics world.
2014-03-10 14:04:58 +08:00
-- @function [parent=#PhysicsWorld] getAllBodies
-- @param self
-- @return array_table#array_table ret (return value: array_table)
2014-05-02 08:37:21 +08:00
--------------------------------
2014-09-02 13:45:07 +08:00
-- get the bebug draw mask
2014-08-13 14:42:14 +08:00
-- @function [parent=#PhysicsWorld] getDebugDrawMask
2014-05-02 08:37:21 +08:00
-- @param self
2014-08-13 14:42:14 +08:00
-- @return int#int ret (return value: int)
2014-05-02 08:37:21 +08:00
2014-09-09 10:32:49 +08:00
--------------------------------
-- set the number of substeps in an update of the physics world.<br>
-- One physics update will be divided into several substeps to increase its accuracy.<br>
-- default value is 1
-- @function [parent=#PhysicsWorld] setSubsteps
-- @param self
-- @param #int steps
2015-01-21 17:33:26 +08:00
-- @return PhysicsWorld#PhysicsWorld self (return value: cc.PhysicsWorld)
2014-09-09 10:32:49 +08:00
2014-03-10 14:04:58 +08:00
--------------------------------
2014-09-02 13:45:07 +08:00
-- To control the step of physics, if you want control it by yourself( fixed-timestep for example ), you can set this to false and call step by yourself.<br>
-- Defaut value is true.<br>
2014-09-09 10:32:49 +08:00
-- Note: if you set auto step to false, setSpeed setSubsteps and setUpdateRate won't work, you need to control the time step by yourself.
2014-08-13 14:42:14 +08:00
-- @function [parent=#PhysicsWorld] setAutoStep
2014-03-10 14:04:58 +08:00
-- @param self
2014-09-02 13:45:07 +08:00
-- @param #bool autoStep
2015-01-21 17:33:26 +08:00
-- @return PhysicsWorld#PhysicsWorld self (return value: cc.PhysicsWorld)
2014-08-13 14:42:14 +08:00
--------------------------------
2014-09-02 13:45:07 +08:00
-- Adds a joint to the physics world.
2014-08-13 14:42:14 +08:00
-- @function [parent=#PhysicsWorld] addJoint
-- @param self
2014-09-02 13:45:07 +08:00
-- @param #cc.PhysicsJoint joint
2015-01-21 17:33:26 +08:00
-- @return PhysicsWorld#PhysicsWorld self (return value: cc.PhysicsWorld)
2014-08-13 14:42:14 +08:00
--------------------------------
2014-09-02 13:45:07 +08:00
-- Remove all joints from physics world.
2014-08-13 14:42:14 +08:00
-- @function [parent=#PhysicsWorld] removeAllJoints
-- @param self
2015-01-21 17:33:26 +08:00
-- @return PhysicsWorld#PhysicsWorld self (return value: cc.PhysicsWorld)
2014-08-13 14:42:14 +08:00
--------------------------------
2014-09-02 13:45:07 +08:00
-- Get the auto step
2014-08-13 14:42:14 +08:00
-- @function [parent=#PhysicsWorld] isAutoStep
-- @param self
-- @return bool#bool ret (return value: bool)
2014-03-10 14:04:58 +08:00
--------------------------------
2014-07-17 10:28:34 +08:00
-- @overload self, int
-- @overload self, cc.PhysicsBody
2014-03-10 14:04:58 +08:00
-- @function [parent=#PhysicsWorld] removeBody
-- @param self
2014-09-02 13:45:07 +08:00
-- @param #cc.PhysicsBody body
2015-01-21 17:33:26 +08:00
-- @return PhysicsWorld#PhysicsWorld self (return value: cc.PhysicsWorld)
2014-03-10 14:04:58 +08:00
--------------------------------
2014-09-02 13:45:07 +08:00
-- Remove a joint from physics world.
2014-03-10 14:04:58 +08:00
-- @function [parent=#PhysicsWorld] removeJoint
-- @param self
2014-09-02 13:45:07 +08:00
-- @param #cc.PhysicsJoint joint
-- @param #bool destroy
2015-01-21 17:33:26 +08:00
-- @return PhysicsWorld#PhysicsWorld self (return value: cc.PhysicsWorld)
2014-03-10 14:04:58 +08:00
--------------------------------
2014-09-02 13:45:07 +08:00
-- Get phsyics shapes that contains the point.
2014-08-13 14:42:14 +08:00
-- @function [parent=#PhysicsWorld] getShapes
2014-03-10 14:04:58 +08:00
-- @param self
2014-09-02 13:45:07 +08:00
-- @param #vec2_table point
2014-08-13 14:42:14 +08:00
-- @return array_table#array_table ret (return value: array_table)
2014-03-10 14:04:58 +08:00
--------------------------------
2014-09-02 13:45:07 +08:00
-- The step for physics world, The times passing for simulate the physics.<br>
-- Note: you need to setAutoStep(false) first before it can work.
2014-08-13 14:42:14 +08:00
-- @function [parent=#PhysicsWorld] step
2014-03-10 14:04:58 +08:00
-- @param self
2014-09-02 13:45:07 +08:00
-- @param #float delta
2015-01-21 17:33:26 +08:00
-- @return PhysicsWorld#PhysicsWorld self (return value: cc.PhysicsWorld)
2014-03-10 14:04:58 +08:00
--------------------------------
2014-09-02 13:45:07 +08:00
-- set the debug draw mask
2014-08-13 14:42:14 +08:00
-- @function [parent=#PhysicsWorld] setDebugDrawMask
2014-03-10 14:04:58 +08:00
-- @param self
2014-09-02 13:45:07 +08:00
-- @param #int mask
2015-01-21 17:33:26 +08:00
-- @return PhysicsWorld#PhysicsWorld self (return value: cc.PhysicsWorld)
2014-03-10 14:04:58 +08:00
--------------------------------
2014-09-02 13:45:07 +08:00
-- get the gravity value
2014-08-13 14:42:14 +08:00
-- @function [parent=#PhysicsWorld] getGravity
2014-03-10 14:04:58 +08:00
-- @param self
2014-08-13 14:42:14 +08:00
-- @return vec2_table#vec2_table ret (return value: vec2_table)
2014-03-10 14:04:58 +08:00
--------------------------------
2014-09-02 13:45:07 +08:00
-- set the update rate of physics world, update rate is the value of EngineUpdateTimes/PhysicsWorldUpdateTimes.<br>
-- set it higher can improve performance, set it lower can improve accuracy of physics world simulation.<br>
-- default value is 1.0<br>
-- Note: if you setAutoStep(false), this won't work.
2014-08-13 14:42:14 +08:00
-- @function [parent=#PhysicsWorld] setUpdateRate
2014-03-10 14:04:58 +08:00
-- @param self
2014-09-02 13:45:07 +08:00
-- @param #int rate
2015-01-21 17:33:26 +08:00
-- @return PhysicsWorld#PhysicsWorld self (return value: cc.PhysicsWorld)
2014-03-10 14:04:58 +08:00
2014-09-09 10:32:49 +08:00
--------------------------------
-- get the number of substeps
-- @function [parent=#PhysicsWorld] getSubsteps
-- @param self
-- @return int#int ret (return value: int)
2014-03-10 14:04:58 +08:00
--------------------------------
2014-09-02 13:45:07 +08:00
-- get the speed of physics world
2014-08-13 14:42:14 +08:00
-- @function [parent=#PhysicsWorld] getSpeed
2014-03-10 14:04:58 +08:00
-- @param self
2014-08-13 14:42:14 +08:00
-- @return float#float ret (return value: float)
2014-03-10 14:04:58 +08:00
--------------------------------
2014-09-02 13:45:07 +08:00
-- get the update rate
2014-08-13 14:42:14 +08:00
-- @function [parent=#PhysicsWorld] getUpdateRate
2014-03-10 14:04:58 +08:00
-- @param self
-- @return int#int ret (return value: int)
--------------------------------
2014-09-02 13:45:07 +08:00
-- Remove all bodies from physics world.
2014-08-13 14:42:14 +08:00
-- @function [parent=#PhysicsWorld] removeAllBodies
2014-03-10 14:04:58 +08:00
-- @param self
2015-01-21 17:33:26 +08:00
-- @return PhysicsWorld#PhysicsWorld self (return value: cc.PhysicsWorld)
2014-03-10 14:04:58 +08:00
--------------------------------
2014-09-02 13:45:07 +08:00
-- Set the speed of physics world, speed is the rate at which the simulation executes. default value is 1.0<br>
-- Note: if you setAutoStep(false), this won't work.
2014-08-13 14:42:14 +08:00
-- @function [parent=#PhysicsWorld] setSpeed
2014-03-10 14:04:58 +08:00
-- @param self
2014-09-02 13:45:07 +08:00
-- @param #float speed
2015-01-21 17:33:26 +08:00
-- @return PhysicsWorld#PhysicsWorld self (return value: cc.PhysicsWorld)
2014-03-10 14:04:58 +08:00
--------------------------------
2014-09-02 13:45:07 +08:00
-- return physics shape that contains the point.
2014-08-13 14:42:14 +08:00
-- @function [parent=#PhysicsWorld] getShape
2014-03-10 14:04:58 +08:00
-- @param self
2014-09-02 13:45:07 +08:00
-- @param #vec2_table point
2014-08-13 14:42:14 +08:00
-- @return PhysicsShape#PhysicsShape ret (return value: cc.PhysicsShape)
2014-03-10 14:04:58 +08:00
--------------------------------
2014-09-02 13:45:07 +08:00
-- Get body by tag
2014-08-13 14:42:14 +08:00
-- @function [parent=#PhysicsWorld] getBody
2014-03-10 14:04:58 +08:00
-- @param self
2014-09-02 13:45:07 +08:00
-- @param #int tag
2014-08-13 14:42:14 +08:00
-- @return PhysicsBody#PhysicsBody ret (return value: cc.PhysicsBody)
2014-03-10 14:04:58 +08:00
return nil