2014-03-10 14:04:58 +08:00
--------------------------------
-- @module PhysicsBody
2014-03-20 10:21:28 +08:00
-- @extend Ref
2014-06-25 17:36:50 +08:00
-- @parent_module cc
2014-03-18 15:55:30 +08:00
2014-03-10 14:04:58 +08:00
--------------------------------
2015-03-19 20:30:15 +08:00
-- Whether this physics body is affected by the physics world’ s gravitational force.
2014-03-10 14:04:58 +08:00
-- @function [parent=#PhysicsBody] isGravityEnabled
-- @param self
-- @return bool#bool ret (return value: bool)
--------------------------------
2015-03-19 20:30:15 +08:00
-- reset all the force applied to body.
2014-03-10 14:04:58 +08:00
-- @function [parent=#PhysicsBody] resetForces
-- @param self
2015-01-21 17:33:26 +08:00
-- @return PhysicsBody#PhysicsBody self (return value: cc.PhysicsBody)
2014-03-10 14:04:58 +08:00
--------------------------------
2014-09-02 13:45:07 +08:00
-- get the max of velocity
2014-03-10 14:04:58 +08:00
-- @function [parent=#PhysicsBody] getVelocityLimit
-- @param self
-- @return float#float ret (return value: float)
--------------------------------
2015-03-19 20:30:15 +08:00
-- Set the group of body.<br>
-- Collision groups let you specify an integral group index. You can have all fixtures with the same group index always collide (positive index) or never collide (negative index).<br>
-- It have high priority than bit masks.
2014-03-10 14:04:58 +08:00
-- @function [parent=#PhysicsBody] setGroup
-- @param self
2014-09-02 13:45:07 +08:00
-- @param #int group
2015-01-21 17:33:26 +08:00
-- @return PhysicsBody#PhysicsBody self (return value: cc.PhysicsBody)
2014-03-10 14:04:58 +08:00
--------------------------------
2015-03-19 20:30:15 +08:00
-- Get the body mass.
2014-03-10 14:04:58 +08:00
-- @function [parent=#PhysicsBody] getMass
-- @param self
-- @return float#float ret (return value: float)
--------------------------------
2015-03-19 20:30:15 +08:00
-- Return bitmask of first shape.<br>
-- return If there is no shape in body, return default value.(0xFFFFFFFF)
2014-03-10 14:04:58 +08:00
-- @function [parent=#PhysicsBody] getCollisionBitmask
-- @param self
-- @return int#int ret (return value: int)
--------------------------------
2014-09-02 13:45:07 +08:00
-- set the body rotation offset
2014-03-10 14:04:58 +08:00
-- @function [parent=#PhysicsBody] getRotationOffset
-- @param self
-- @return float#float ret (return value: float)
--------------------------------
2014-09-02 13:45:07 +08:00
-- get the body rotation.
2014-03-10 14:04:58 +08:00
-- @function [parent=#PhysicsBody] getRotation
-- @param self
-- @return float#float ret (return value: float)
--------------------------------
2015-03-19 20:30:15 +08:00
-- Get the body moment of inertia.
2014-03-10 14:04:58 +08:00
-- @function [parent=#PhysicsBody] getMoment
-- @param self
-- @return float#float ret (return value: float)
--------------------------------
2014-07-17 10:28:34 +08:00
-- @overload self, vec2_table, vec2_table
-- @overload self, vec2_table
2014-03-10 14:04:58 +08:00
-- @function [parent=#PhysicsBody] applyImpulse
-- @param self
2014-09-02 13:45:07 +08:00
-- @param #vec2_table impulse
-- @param #vec2_table offset
2015-01-21 17:33:26 +08:00
-- @return PhysicsBody#PhysicsBody self (return value: cc.PhysicsBody)
2014-03-10 14:04:58 +08:00
--------------------------------
2014-09-02 13:45:07 +08:00
-- set body rotation offset, it's the rotation witch relative to node
2014-03-10 14:04:58 +08:00
-- @function [parent=#PhysicsBody] setRotationOffset
-- @param self
2014-09-02 13:45:07 +08:00
-- @param #float rotation
2015-01-21 17:33:26 +08:00
-- @return PhysicsBody#PhysicsBody self (return value: cc.PhysicsBody)
2014-03-10 14:04:58 +08:00
--------------------------------
2014-07-17 10:28:34 +08:00
-- @overload self, vec2_table, vec2_table
-- @overload self, vec2_table
2014-03-10 14:04:58 +08:00
-- @function [parent=#PhysicsBody] applyForce
-- @param self
2014-09-02 13:45:07 +08:00
-- @param #vec2_table force
-- @param #vec2_table offset
2015-01-21 17:33:26 +08:00
-- @return PhysicsBody#PhysicsBody self (return value: cc.PhysicsBody)
2014-03-10 14:04:58 +08:00
--------------------------------
2015-03-19 20:30:15 +08:00
-- brief Add a shape to body.<br>
-- param shape The shape to be added.<br>
-- param addMassAndMoment If this is true, the shape's mass and moment will be added to body. The default is true.<br>
-- return This shape's pointer if added success or nullptr if failed.
2014-03-10 14:04:58 +08:00
-- @function [parent=#PhysicsBody] addShape
-- @param self
2014-09-02 13:45:07 +08:00
-- @param #cc.PhysicsShape shape
-- @param #bool addMassAndMoment
2014-03-10 14:04:58 +08:00
-- @return PhysicsShape#PhysicsShape ret (return value: cc.PhysicsShape)
--------------------------------
2015-03-19 20:30:15 +08:00
-- Applies a torque force to body. <br>
-- param torque The torque is applies to this body.
2014-03-10 14:04:58 +08:00
-- @function [parent=#PhysicsBody] applyTorque
-- @param self
2014-09-02 13:45:07 +08:00
-- @param #float torque
2015-01-21 17:33:26 +08:00
-- @return PhysicsBody#PhysicsBody self (return value: cc.PhysicsBody)
2014-03-10 14:04:58 +08:00
--------------------------------
2014-09-02 13:45:07 +08:00
-- get the max of angular velocity
2014-03-10 14:04:58 +08:00
-- @function [parent=#PhysicsBody] getAngularVelocityLimit
-- @param self
-- @return float#float ret (return value: float)
--------------------------------
2014-09-02 13:45:07 +08:00
-- set the max of angular velocity
2014-03-10 14:04:58 +08:00
-- @function [parent=#PhysicsBody] setAngularVelocityLimit
-- @param self
2014-09-02 13:45:07 +08:00
-- @param #float limit
2015-01-21 17:33:26 +08:00
-- @return PhysicsBody#PhysicsBody self (return value: cc.PhysicsBody)
2014-03-10 14:04:58 +08:00
--------------------------------
2015-03-19 20:30:15 +08:00
-- Get the velocity of a body.
2014-03-10 14:04:58 +08:00
-- @function [parent=#PhysicsBody] getVelocity
-- @param self
2014-05-27 14:31:18 +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
-- get linear damping.
2014-03-10 14:04:58 +08:00
-- @function [parent=#PhysicsBody] getLinearDamping
-- @param self
-- @return float#float ret (return value: float)
--------------------------------
2015-03-19 20:30:15 +08:00
-- Remove all shapes.<br>
-- param reduceMassAndMoment If this is true, the body mass and moment will be reduced by shape. The default is true.
2014-03-10 14:04:58 +08:00
-- @function [parent=#PhysicsBody] removeAllShapes
-- @param self
2015-01-21 17:33:26 +08:00
-- @return PhysicsBody#PhysicsBody self (return value: cc.PhysicsBody)
2014-03-10 14:04:58 +08:00
--------------------------------
2015-03-19 20:30:15 +08:00
-- Set angular damping.<br>
-- It is used to simulate fluid or air friction forces on the body.<br>
-- param damping The value is 0.0f to 1.0f.
2014-03-10 14:04:58 +08:00
-- @function [parent=#PhysicsBody] setAngularDamping
-- @param self
2014-09-02 13:45:07 +08:00
-- @param #float damping
2015-01-21 17:33:26 +08:00
-- @return PhysicsBody#PhysicsBody self (return value: cc.PhysicsBody)
2014-03-10 14:04:58 +08:00
--------------------------------
2014-09-02 13:45:07 +08:00
-- set the max of velocity
2014-03-10 14:04:58 +08:00
-- @function [parent=#PhysicsBody] setVelocityLimit
-- @param self
2014-09-02 13:45:07 +08:00
-- @param #float limit
2015-01-21 17:33:26 +08:00
-- @return PhysicsBody#PhysicsBody self (return value: cc.PhysicsBody)
2014-03-10 14:04:58 +08:00
--------------------------------
2014-09-02 13:45:07 +08:00
-- set body to rest
2014-03-10 14:04:58 +08:00
-- @function [parent=#PhysicsBody] setResting
-- @param self
2014-09-02 13:45:07 +08:00
-- @param #bool rest
2015-01-21 17:33:26 +08:00
-- @return PhysicsBody#PhysicsBody self (return value: cc.PhysicsBody)
2014-03-10 14:04:58 +08:00
--------------------------------
2014-09-02 13:45:07 +08:00
-- get body position offset.
2014-03-10 14:04:58 +08:00
-- @function [parent=#PhysicsBody] getPositionOffset
-- @param self
2014-05-27 14:31:18 +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
-- A mask that defines which categories this physics body belongs to.<br>
-- Every physics body in a scene can be assigned to up to 32 different categories, each corresponding to a bit in the bit mask. You define the mask values used in your game. In conjunction with the collisionBitMask and contactTestBitMask properties, you define which physics bodies interact with each other and when your game is notified of these interactions.<br>
2015-03-19 20:30:15 +08:00
-- param bitmask An interger number, the default value is 0xFFFFFFFF (all bits set).
2014-03-10 14:04:58 +08:00
-- @function [parent=#PhysicsBody] setCategoryBitmask
-- @param self
2014-09-02 13:45:07 +08:00
-- @param #int bitmask
2015-01-21 17:33:26 +08:00
-- @return PhysicsBody#PhysicsBody self (return value: cc.PhysicsBody)
2014-03-10 14:04:58 +08:00
--------------------------------
2014-09-02 13:45:07 +08:00
-- get the world body added to.
2014-03-10 14:04:58 +08:00
-- @function [parent=#PhysicsBody] getWorld
-- @param self
-- @return PhysicsWorld#PhysicsWorld ret (return value: cc.PhysicsWorld)
--------------------------------
2014-09-02 13:45:07 +08:00
-- get the angular velocity of a body
2014-03-10 14:04:58 +08:00
-- @function [parent=#PhysicsBody] getAngularVelocity
-- @param self
-- @return float#float ret (return value: float)
--------------------------------
2014-09-02 13:45:07 +08:00
-- get the body position.
2014-03-10 14:04:58 +08:00
-- @function [parent=#PhysicsBody] getPosition
-- @param self
2014-05-27 14:31:18 +08:00
-- @return vec2_table#vec2_table ret (return value: vec2_table)
2014-03-10 14:04:58 +08:00
--------------------------------
2015-03-19 20:30:15 +08:00
-- Set the enable value.<br>
-- If the body it isn't enabled, it will not has simulation by world.
2014-03-10 14:04:58 +08:00
-- @function [parent=#PhysicsBody] setEnable
-- @param self
2014-09-02 13:45:07 +08:00
-- @param #bool enable
2015-01-21 17:33:26 +08:00
-- @return PhysicsBody#PhysicsBody self (return value: cc.PhysicsBody)
2014-03-10 14:04:58 +08:00
--------------------------------
2015-03-19 20:30:15 +08:00
-- Set the body is affected by the physics world's gravitational force or not.
2014-03-10 14:04:58 +08:00
-- @function [parent=#PhysicsBody] setGravityEnable
-- @param self
2014-09-02 13:45:07 +08:00
-- @param #bool enable
2015-01-21 17:33:26 +08:00
-- @return PhysicsBody#PhysicsBody self (return value: cc.PhysicsBody)
2014-03-10 14:04:58 +08:00
--------------------------------
2015-03-19 20:30:15 +08:00
-- Return group of first shape.<br>
-- return If there is no shape in body, return default value.(0)
2014-03-10 14:04:58 +08:00
-- @function [parent=#PhysicsBody] getGroup
-- @param self
-- @return int#int ret (return value: int)
--------------------------------
2015-03-19 20:30:15 +08:00
-- brief Set the body moment of inertia.<br>
-- note If you need add/subtract moment to body, don't use setMoment(getMoment() +/- moment), because the moment of body may be equal to PHYSICS_INFINITY, it will cause some unexpected result, please use addMoment() instead.
2014-03-10 14:04:58 +08:00
-- @function [parent=#PhysicsBody] setMoment
-- @param self
2014-09-02 13:45:07 +08:00
-- @param #float moment
2015-01-21 17:33:26 +08:00
-- @return PhysicsBody#PhysicsBody self (return value: cc.PhysicsBody)
2014-03-10 14:04:58 +08:00
--------------------------------
2015-03-19 20:30:15 +08:00
-- Get the body's tag.
2014-03-10 14:04:58 +08:00
-- @function [parent=#PhysicsBody] getTag
-- @param self
-- @return int#int ret (return value: int)
--------------------------------
2015-03-19 20:30:15 +08:00
-- Convert the local point to world.
2014-03-10 14:04:58 +08:00
-- @function [parent=#PhysicsBody] local2World
-- @param self
2014-09-02 13:45:07 +08:00
-- @param #vec2_table point
2014-05-27 14:31:18 +08:00
-- @return vec2_table#vec2_table ret (return value: vec2_table)
2014-03-10 14:04:58 +08:00
--------------------------------
2015-03-19 20:30:15 +08:00
-- Return bitmask of first shape.<br>
-- return If there is no shape in body, return default value.(0xFFFFFFFF)
2014-03-10 14:04:58 +08:00
-- @function [parent=#PhysicsBody] getCategoryBitmask
-- @param self
-- @return int#int ret (return value: int)
--------------------------------
2015-03-19 20:30:15 +08:00
-- brief Set dynamic to body.<br>
-- A dynamic body will effect with gravity.
2014-03-10 14:04:58 +08:00
-- @function [parent=#PhysicsBody] setDynamic
-- @param self
2014-09-02 13:45:07 +08:00
-- @param #bool dynamic
2015-01-21 17:33:26 +08:00
-- @return PhysicsBody#PhysicsBody self (return value: cc.PhysicsBody)
2014-03-10 14:04:58 +08:00
--------------------------------
2015-03-19 20:30:15 +08:00
-- Get the first shape of the body shapes.<br>
-- return The first shape in this body.
2014-03-10 14:04:58 +08:00
-- @function [parent=#PhysicsBody] getFirstShape
-- @param self
-- @return PhysicsShape#PhysicsShape ret (return value: cc.PhysicsShape)
--------------------------------
2015-03-19 20:30:15 +08:00
-- Get the body shapes.<br>
-- return A Vector<PhysicsShape*> object contains PhysicsShape pointer.
2014-03-10 14:04:58 +08:00
-- @function [parent=#PhysicsBody] getShapes
-- @param self
-- @return array_table#array_table ret (return value: array_table)
--------------------------------
2015-03-19 20:30:15 +08:00
-- Return bitmask of first shape.<br>
-- return If there is no shape in body, return default value.(0x00000000)
2014-03-10 14:04:58 +08:00
-- @function [parent=#PhysicsBody] getContactTestBitmask
-- @param self
-- @return int#int ret (return value: int)
--------------------------------
2015-03-19 20:30:15 +08:00
-- Set the angular velocity of a body.<br>
-- param velocity The angular velocity is set to this body.
2014-03-10 14:04:58 +08:00
-- @function [parent=#PhysicsBody] setAngularVelocity
-- @param self
2014-09-02 13:45:07 +08:00
-- @param #float velocity
2015-01-21 17:33:26 +08:00
-- @return PhysicsBody#PhysicsBody self (return value: cc.PhysicsBody)
2014-03-10 14:04:58 +08:00
--------------------------------
2015-03-19 20:30:15 +08:00
-- Convert the world point to local.
2014-03-10 14:04:58 +08:00
-- @function [parent=#PhysicsBody] world2Local
-- @param self
2014-09-02 13:45:07 +08:00
-- @param #vec2_table point
2014-05-27 14:31:18 +08:00
-- @return vec2_table#vec2_table ret (return value: vec2_table)
2014-03-10 14:04:58 +08:00
--------------------------------
2015-03-19 20:30:15 +08:00
-- Whether the body is enabled.<br>
-- If the body it isn't enabled, it will not has simulation by world.
2014-03-10 14:04:58 +08:00
-- @function [parent=#PhysicsBody] isEnabled
-- @param self
-- @return bool#bool ret (return value: bool)
--------------------------------
2014-07-17 10:28:34 +08:00
-- @overload self, int, bool
-- @overload self, cc.PhysicsShape, bool
2014-03-10 14:04:58 +08:00
-- @function [parent=#PhysicsBody] removeShape
-- @param self
2014-09-02 13:45:07 +08:00
-- @param #cc.PhysicsShape shape
-- @param #bool reduceMassAndMoment
2015-01-21 17:33:26 +08:00
-- @return PhysicsBody#PhysicsBody self (return value: cc.PhysicsBody)
2014-03-10 14:04:58 +08:00
--------------------------------
2015-03-19 20:30:15 +08:00
-- brief Set the body mass.<br>
2015-03-27 13:46:01 +08:00
-- attention If you need add/subtract mass to body, don't use setMass(getMass() +/- mass), because the mass of body may be equal to PHYSICS_INFINITY, it will cause some unexpected result, please use addMass() instead.
2014-03-10 14:04:58 +08:00
-- @function [parent=#PhysicsBody] setMass
-- @param self
2014-09-02 13:45:07 +08:00
-- @param #float mass
2015-01-21 17:33:26 +08:00
-- @return PhysicsBody#PhysicsBody self (return value: cc.PhysicsBody)
2014-03-10 14:04:58 +08:00
--------------------------------
2015-03-19 20:30:15 +08:00
-- brief Add moment of inertia to body.<br>
-- param moment If _moment(moment of the body) == PHYSICS_INFINITY, it remains.<br>
2014-09-02 13:45:07 +08:00
-- if moment == PHYSICS_INFINITY, _moment will be PHYSICS_INFINITY.<br>
-- if moment == -PHYSICS_INFINITY, _moment will not change.<br>
-- if moment + _moment <= 0, _moment will equal to MASS_DEFAULT(1.0)<br>
-- other wise, moment = moment + _moment;
2014-03-10 14:04:58 +08:00
-- @function [parent=#PhysicsBody] addMoment
-- @param self
2014-09-02 13:45:07 +08:00
-- @param #float moment
2015-01-21 17:33:26 +08:00
-- @return PhysicsBody#PhysicsBody self (return value: cc.PhysicsBody)
2014-03-10 14:04:58 +08:00
--------------------------------
2015-03-19 20:30:15 +08:00
-- Set the velocity of a body.<br>
-- param velocity The velocity is set to this body.
2014-03-10 14:04:58 +08:00
-- @function [parent=#PhysicsBody] setVelocity
-- @param self
2014-09-02 13:45:07 +08:00
-- @param #vec2_table velocity
2015-01-21 17:33:26 +08:00
-- @return PhysicsBody#PhysicsBody self (return value: cc.PhysicsBody)
2014-03-10 14:04:58 +08:00
--------------------------------
2015-03-19 20:30:15 +08:00
-- Set linear damping.<br>
-- it is used to simulate fluid or air friction forces on the body.<br>
-- param damping The value is 0.0f to 1.0f.
2014-03-10 14:04:58 +08:00
-- @function [parent=#PhysicsBody] setLinearDamping
-- @param self
2014-09-02 13:45:07 +08:00
-- @param #float damping
2015-01-21 17:33:26 +08:00
-- @return PhysicsBody#PhysicsBody self (return value: cc.PhysicsBody)
2014-03-10 14:04:58 +08:00
--------------------------------
2014-09-02 13:45:07 +08:00
-- A mask that defines which categories of physics bodies can collide with this physics body.<br>
-- When two physics bodies contact each other, a collision may occur. This body’ s collision mask is compared to the other body’ s category mask by performing a logical AND operation. If the result is a non-zero value, then this body is affected by the collision. Each body independently chooses whether it wants to be affected by the other body. For example, you might use this to avoid collision calculations that would make negligible changes to a body’ s velocity.<br>
2015-03-19 20:30:15 +08:00
-- param bitmask An interger number, the default value is 0xFFFFFFFF (all bits set).
2014-03-10 14:04:58 +08:00
-- @function [parent=#PhysicsBody] setCollisionBitmask
-- @param self
2014-09-02 13:45:07 +08:00
-- @param #int bitmask
2015-01-21 17:33:26 +08:00
-- @return PhysicsBody#PhysicsBody self (return value: cc.PhysicsBody)
2014-03-10 14:04:58 +08:00
--------------------------------
2014-09-02 13:45:07 +08:00
-- set body position offset, it's the position witch relative to node
2014-03-10 14:04:58 +08:00
-- @function [parent=#PhysicsBody] setPositionOffset
-- @param self
2014-09-02 13:45:07 +08:00
-- @param #vec2_table position
2015-01-21 17:33:26 +08:00
-- @return PhysicsBody#PhysicsBody self (return value: cc.PhysicsBody)
2014-03-10 14:04:58 +08:00
--------------------------------
2015-03-19 20:30:15 +08:00
-- Set the body is allow rotation or not
2014-03-10 14:04:58 +08:00
-- @function [parent=#PhysicsBody] setRotationEnable
-- @param self
2014-09-02 13:45:07 +08:00
-- @param #bool enable
2015-01-21 17:33:26 +08:00
-- @return PhysicsBody#PhysicsBody self (return value: cc.PhysicsBody)
2014-03-10 14:04:58 +08:00
--------------------------------
2015-03-19 20:30:15 +08:00
-- Whether the body can rotation.
2014-03-10 14:04:58 +08:00
-- @function [parent=#PhysicsBody] isRotationEnabled
-- @param self
-- @return bool#bool ret (return value: bool)
2015-01-07 10:27:01 +08:00
--------------------------------
2015-03-19 20:30:15 +08:00
-- Get the rigid body of chipmunk.
2015-01-07 10:27:01 +08:00
-- @function [parent=#PhysicsBody] getCPBody
-- @param self
-- @return cpBody#cpBody ret (return value: cpBody)
2014-03-10 14:04:58 +08:00
--------------------------------
2015-03-19 20:30:15 +08:00
-- Get angular damping.
2014-03-10 14:04:58 +08:00
-- @function [parent=#PhysicsBody] getAngularDamping
-- @param self
-- @return float#float ret (return value: float)
--------------------------------
2015-03-19 20:30:15 +08:00
-- Get the angular velocity of a body at a local point.
2014-03-10 14:04:58 +08:00
-- @function [parent=#PhysicsBody] getVelocityAtLocalPoint
-- @param self
2014-09-02 13:45:07 +08:00
-- @param #vec2_table point
2014-05-27 14:31:18 +08:00
-- @return vec2_table#vec2_table ret (return value: vec2_table)
2014-03-10 14:04:58 +08:00
--------------------------------
2015-03-19 20:30:15 +08:00
-- Whether the body is at rest.
2014-03-10 14:04:58 +08:00
-- @function [parent=#PhysicsBody] isResting
-- @param self
-- @return bool#bool ret (return value: bool)
--------------------------------
2015-03-19 20:30:15 +08:00
-- brief Add mass to body.<br>
-- param mass If _mass(mass of the body) == PHYSICS_INFINITY, it remains.<br>
2014-09-02 13:45:07 +08:00
-- if mass == PHYSICS_INFINITY, _mass will be PHYSICS_INFINITY.<br>
-- if mass == -PHYSICS_INFINITY, _mass will not change.<br>
-- if mass + _mass <= 0, _mass will equal to MASS_DEFAULT(1.0)<br>
-- other wise, mass = mass + _mass;
2014-03-10 14:04:58 +08:00
-- @function [parent=#PhysicsBody] addMass
-- @param self
2014-09-02 13:45:07 +08:00
-- @param #float mass
2015-01-21 17:33:26 +08:00
-- @return PhysicsBody#PhysicsBody self (return value: cc.PhysicsBody)
2014-03-10 14:04:58 +08:00
--------------------------------
2015-03-19 20:30:15 +08:00
-- get the shape of the body. <br>
-- param tag An interger number that identifies a PhysicsShape object.<br>
-- return A PhysicsShape object pointer or nullptr if no shapes were found.
2014-03-10 14:04:58 +08:00
-- @function [parent=#PhysicsBody] getShape
-- @param self
2014-09-02 13:45:07 +08:00
-- @param #int tag
2014-03-10 14:04:58 +08:00
-- @return PhysicsShape#PhysicsShape ret (return value: cc.PhysicsShape)
--------------------------------
2015-03-19 20:30:15 +08:00
-- set the body's tag.
2014-03-10 14:04:58 +08:00
-- @function [parent=#PhysicsBody] setTag
-- @param self
2014-09-02 13:45:07 +08:00
-- @param #int tag
2015-01-21 17:33:26 +08:00
-- @return PhysicsBody#PhysicsBody self (return value: cc.PhysicsBody)
2014-03-10 14:04:58 +08:00
--------------------------------
2014-09-02 13:45:07 +08:00
-- get the angular velocity of a body at a world point
2014-03-10 14:04:58 +08:00
-- @function [parent=#PhysicsBody] getVelocityAtWorldPoint
-- @param self
2014-09-02 13:45:07 +08:00
-- @param #vec2_table point
2014-05-27 14:31:18 +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
-- A mask that defines which categories of bodies cause intersection notifications with this physics body.<br>
-- When two bodies share the same space, each body’ s category mask is tested against the other body’ s contact mask by performing a logical AND operation. If either comparison results in a non-zero value, an PhysicsContact object is created and passed to the physics world’ s delegate. For best performance, only set bits in the contacts mask for interactions you are interested in.<br>
2015-03-19 20:30:15 +08:00
-- param bitmask An interger number, the default value is 0x00000000 (all bits cleared).
2014-03-10 14:04:58 +08:00
-- @function [parent=#PhysicsBody] setContactTestBitmask
-- @param self
2014-09-02 13:45:07 +08:00
-- @param #int bitmask
2015-01-21 17:33:26 +08:00
-- @return PhysicsBody#PhysicsBody self (return value: cc.PhysicsBody)
2014-03-10 14:04:58 +08:00
--------------------------------
2014-09-02 13:45:07 +08:00
-- remove the body from the world it added to
2014-03-10 14:04:58 +08:00
-- @function [parent=#PhysicsBody] removeFromWorld
-- @param self
2015-01-21 17:33:26 +08:00
-- @return PhysicsBody#PhysicsBody self (return value: cc.PhysicsBody)
2014-03-10 14:04:58 +08:00
--------------------------------
2015-03-19 20:30:15 +08:00
-- brief Test the body is dynamic or not.<br>
-- A dynamic body will effect with gravity.
2014-03-10 14:04:58 +08:00
-- @function [parent=#PhysicsBody] isDynamic
-- @param self
-- @return bool#bool ret (return value: bool)
--------------------------------
2014-09-02 13:45:07 +08:00
-- get the sprite the body set to.
2014-03-10 14:04:58 +08:00
-- @function [parent=#PhysicsBody] getNode
-- @param self
-- @return Node#Node ret (return value: cc.Node)
--------------------------------
2015-03-19 20:30:15 +08:00
-- Create a body contains a box shape.<br>
-- param size Size contains this box's width and height.<br>
-- param material A PhysicsMaterial object, the default value is PHYSICSSHAPE_MATERIAL_DEFAULT.<br>
-- param offset A Vec2 object, it is the offset from the body’ s center of gravity in body local coordinates.<br>
-- return An autoreleased PhysicsBody object pointer.
2014-03-10 14:04:58 +08:00
-- @function [parent=#PhysicsBody] createBox
-- @param self
-- @param #size_table size
2014-09-02 13:45:07 +08:00
-- @param #cc.PhysicsMaterial material
-- @param #vec2_table offset
2014-03-10 14:04:58 +08:00
-- @return PhysicsBody#PhysicsBody ret (return value: cc.PhysicsBody)
--------------------------------
2015-03-19 20:30:15 +08:00
-- Create a body contains a EdgeSegment shape. <br>
-- param a It's the edge's begin position.<br>
-- param b It's the edge's end position.<br>
-- param material A PhysicsMaterial object, the default value is PHYSICSSHAPE_MATERIAL_DEFAULT.<br>
-- param border It's a edge's border width.<br>
-- return An autoreleased PhysicsBody object pointer.
2014-03-10 14:04:58 +08:00
-- @function [parent=#PhysicsBody] createEdgeSegment
-- @param self
2014-09-02 13:45:07 +08:00
-- @param #vec2_table a
-- @param #vec2_table b
-- @param #cc.PhysicsMaterial material
-- @param #float border
2014-03-10 14:04:58 +08:00
-- @return PhysicsBody#PhysicsBody ret (return value: cc.PhysicsBody)
--------------------------------
2014-07-17 10:28:34 +08:00
-- @overload self, float
-- @overload self
-- @overload self, float, float
2014-03-10 14:04:58 +08:00
-- @function [parent=#PhysicsBody] create
-- @param self
2014-09-02 13:45:07 +08:00
-- @param #float mass
-- @param #float moment
2014-10-17 22:56:22 +08:00
-- @return PhysicsBody#PhysicsBody ret (return value: cc.PhysicsBody)
2014-03-10 14:04:58 +08:00
--------------------------------
2015-03-19 20:30:15 +08:00
-- Create a body contains a EdgeBox shape. <br>
-- param size Size contains this box's width and height.<br>
-- param material A PhysicsMaterial object, the default value is PHYSICSSHAPE_MATERIAL_DEFAULT.<br>
-- param border It's a edge's border width.<br>
-- param offset A Vec2 object, it is the offset from the body’ s center of gravity in body local coordinates.<br>
-- return An autoreleased PhysicsBody object pointer.
2014-03-10 14:04:58 +08:00
-- @function [parent=#PhysicsBody] createEdgeBox
-- @param self
-- @param #size_table size
2014-09-02 13:45:07 +08:00
-- @param #cc.PhysicsMaterial material
-- @param #float border
-- @param #vec2_table offset
2014-03-10 14:04:58 +08:00
-- @return PhysicsBody#PhysicsBody ret (return value: cc.PhysicsBody)
--------------------------------
2015-03-19 20:30:15 +08:00
-- Create a body contains a circle.<br>
-- param radius A float number, it is the circle's radius.<br>
-- param material A PhysicsMaterial object, the default value is PHYSICSSHAPE_MATERIAL_DEFAULT.<br>
-- param offset A Vec2 object, it is the offset from the body’ s center of gravity in body local coordinates.<br>
-- return An autoreleased PhysicsBody object pointer.
2014-03-10 14:04:58 +08:00
-- @function [parent=#PhysicsBody] createCircle
-- @param self
2014-09-02 13:45:07 +08:00
-- @param #float radius
-- @param #cc.PhysicsMaterial material
-- @param #vec2_table offset
2014-03-10 14:04:58 +08:00
-- @return PhysicsBody#PhysicsBody ret (return value: cc.PhysicsBody)
return nil