-------------------------------- -- @module PhysicsWorld -- @parent_module cc -------------------------------- -- set the gravity value of this physics world.
-- param gravity A gravity value of this physics world. -- @function [parent=#PhysicsWorld] setGravity -- @param self -- @param #vec2_table gravity -- @return PhysicsWorld#PhysicsWorld self (return value: cc.PhysicsWorld) -------------------------------- -- Get all the bodys that in this physics world.
-- return A Vector& object contains all bodies in this physics world. -- @function [parent=#PhysicsWorld] getAllBodies -- @param self -- @return array_table#array_table ret (return value: array_table) -------------------------------- -- Get the bebug draw mask.
-- return An interger number. -- @function [parent=#PhysicsWorld] getDebugDrawMask -- @param self -- @return int#int ret (return value: int) -------------------------------- -- set the number of substeps in an update of the physics world.
-- One physics update will be divided into several substeps to increase its accuracy.
-- param steps An interger number, default value is 1. -- @function [parent=#PhysicsWorld] setSubsteps -- @param self -- @param #int steps -- @return PhysicsWorld#PhysicsWorld self (return value: cc.PhysicsWorld) -------------------------------- -- 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.
-- attention If you set auto step to false, setSpeed setSubsteps and setUpdateRate won't work, you need to control the time step by yourself.
-- param autoStep A bool object, defaut value is true. -- @function [parent=#PhysicsWorld] setAutoStep -- @param self -- @param #bool autoStep -- @return PhysicsWorld#PhysicsWorld self (return value: cc.PhysicsWorld) -------------------------------- -- Adds a joint to this physics world.
-- This joint will be added to this physics world at next frame.
-- attention If this joint is already added to another physics world, it will be removed from that world first and then add to this world.
-- param joint A pointer to an existing PhysicsJoint object. -- @function [parent=#PhysicsWorld] addJoint -- @param self -- @param #cc.PhysicsJoint joint -- @return PhysicsWorld#PhysicsWorld self (return value: cc.PhysicsWorld) -------------------------------- -- Remove all joints from this physics world.
-- attention This function is invoked in the destructor of this physics world, you do not use this api in common.
-- param destroy true all joints will be destroyed after remove from this world, false otherwise. -- @function [parent=#PhysicsWorld] removeAllJoints -- @param self -- @return PhysicsWorld#PhysicsWorld self (return value: cc.PhysicsWorld) -------------------------------- -- Get the auto step of this physics world.
-- return A bool object. -- @function [parent=#PhysicsWorld] isAutoStep -- @param self -- @return bool#bool ret (return value: bool) -------------------------------- -- @overload self, int -- @overload self, cc.PhysicsBody -- @function [parent=#PhysicsWorld] removeBody -- @param self -- @param #cc.PhysicsBody body -- @return PhysicsWorld#PhysicsWorld self (return value: cc.PhysicsWorld) -------------------------------- -- Remove a joint from this physics world.
-- If this world is not locked, the joint is removed immediately, otherwise at next frame.
-- If this joint is connected with a body, it will be removed from the body also.
-- param joint A pointer to an existing PhysicsJoint object.
-- param destroy true this joint will be destroyed after remove from this world, false otherwise. -- @function [parent=#PhysicsWorld] removeJoint -- @param self -- @param #cc.PhysicsJoint joint -- @param #bool destroy -- @return PhysicsWorld#PhysicsWorld self (return value: cc.PhysicsWorld) -------------------------------- -- Get phsyics shapes that contains the point.
-- All shapes contains the point will be pushed in a Vector object.
-- attention The point must lie inside a shape.
-- param point A Vec2 object contains the position of the point.
-- return A Vector object contains all found PhysicsShape pointer. -- @function [parent=#PhysicsWorld] getShapes -- @param self -- @param #vec2_table point -- @return array_table#array_table ret (return value: array_table) -------------------------------- -- The step for physics world.
-- The times passing for simulate the physics.
-- attention You need to setAutoStep(false) first before it can work.
-- param delta A float number. -- @function [parent=#PhysicsWorld] step -- @param self -- @param #float delta -- @return PhysicsWorld#PhysicsWorld self (return value: cc.PhysicsWorld) -------------------------------- -- Set the debug draw mask of this physics world.
-- This physics world will draw shapes and joints by DrawNode acoording to mask.
-- param mask Mask has four value:DEBUGDRAW_NONE, DEBUGDRAW_SHAPE, DEBUGDRAW_JOINT, DEBUGDRAW_CONTACT and DEBUGDRAW_ALL, default is DEBUGDRAW_NONE -- @function [parent=#PhysicsWorld] setDebugDrawMask -- @param self -- @param #int mask -- @return PhysicsWorld#PhysicsWorld self (return value: cc.PhysicsWorld) -------------------------------- -- Get the gravity value of this physics world.
-- return A Vect object. -- @function [parent=#PhysicsWorld] getGravity -- @param self -- @return vec2_table#vec2_table ret (return value: vec2_table) -------------------------------- -- Set the update rate of this physics world
-- Update rate is the value of EngineUpdateTimes/PhysicsWorldUpdateTimes.
-- Set it higher can improve performance, set it lower can improve accuracy of physics world simulation.
-- attention if you setAutoStep(false), this won't work.
-- param rate An interger number, default value is 1.0. -- @function [parent=#PhysicsWorld] setUpdateRate -- @param self -- @param #int rate -- @return PhysicsWorld#PhysicsWorld self (return value: cc.PhysicsWorld) -------------------------------- -- Get the number of substeps of this physics world.
-- return An interger number. -- @function [parent=#PhysicsWorld] getSubsteps -- @param self -- @return int#int ret (return value: int) -------------------------------- -- Get the speed of this physics world.
-- return A float number. -- @function [parent=#PhysicsWorld] getSpeed -- @param self -- @return float#float ret (return value: float) -------------------------------- -- Get the update rate of this physics world.
-- return An interger number. -- @function [parent=#PhysicsWorld] getUpdateRate -- @param self -- @return int#int ret (return value: int) -------------------------------- -- Remove all bodies from physics world.
-- If this world is not locked, those body are removed immediately, otherwise at next frame. -- @function [parent=#PhysicsWorld] removeAllBodies -- @param self -- @return PhysicsWorld#PhysicsWorld self (return value: cc.PhysicsWorld) -------------------------------- -- Set the speed of this physics world.
-- attention if you setAutoStep(false), this won't work.
-- param speed A float number. Speed is the rate at which the simulation executes. default value is 1.0. -- @function [parent=#PhysicsWorld] setSpeed -- @param self -- @param #float speed -- @return PhysicsWorld#PhysicsWorld self (return value: cc.PhysicsWorld) -------------------------------- -- Get the nearest phsyics shape that contains the point.
-- Query this physics world at point and return the closest shape.
-- param point A Vec2 object contains the position of the point.
-- return A PhysicsShape object pointer or nullptr if no shapes were found -- @function [parent=#PhysicsWorld] getShape -- @param self -- @param #vec2_table point -- @return PhysicsShape#PhysicsShape ret (return value: cc.PhysicsShape) -------------------------------- -- Get a body by tag.
-- param tag An interger number that identifies a PhysicsBody object.
-- return A PhysicsBody object pointer or nullptr if no shapes were found. -- @function [parent=#PhysicsWorld] getBody -- @param self -- @param #int tag -- @return PhysicsBody#PhysicsBody ret (return value: cc.PhysicsBody) return nil