-------------------------------- -- @module PhysicsShape -- @extend Ref -- @parent_module cc -------------------------------- -- Get this shape's friction.
-- return A float number. -- @function [parent=#PhysicsShape] getFriction -- @param self -- @return float#float ret (return value: float) -------------------------------- -- Set the group of body.
-- 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).
-- param group An interger number, it have high priority than bit masks. -- @function [parent=#PhysicsShape] setGroup -- @param self -- @param #int group -- @return PhysicsShape#PhysicsShape self (return value: cc.PhysicsShape) -------------------------------- -- Set this shape's density.
-- It will change the body's mass this shape attaches.
-- param density A float number. -- @function [parent=#PhysicsShape] setDensity -- @param self -- @param #float density -- @return PhysicsShape#PhysicsShape self (return value: cc.PhysicsShape) -------------------------------- -- Get the mass of this shape.
-- return A float number. -- @function [parent=#PhysicsShape] getMass -- @param self -- @return float#float ret (return value: float) -------------------------------- -- Get this shape's PhysicsMaterial object.
-- return A PhysicsMaterial object reference. -- @function [parent=#PhysicsShape] getMaterial -- @param self -- @return PhysicsMaterial#PhysicsMaterial ret (return value: cc.PhysicsMaterial) -------------------------------- -- -- @function [parent=#PhysicsShape] setSensor -- @param self -- @param #bool sensor -- @return PhysicsShape#PhysicsShape self (return value: cc.PhysicsShape) -------------------------------- -- Get a mask that defines which categories of physics bodies can collide with this physics body.
-- return An interger number. -- @function [parent=#PhysicsShape] getCollisionBitmask -- @param self -- @return int#int ret (return value: int) -------------------------------- -- Return this shape's area.
-- return A float number. -- @function [parent=#PhysicsShape] getArea -- @param self -- @return float#float ret (return value: float) -------------------------------- -- Set a mask that defines which categories this physics body belongs to.
-- 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.
-- param bitmask An interger number, the default value is 0xFFFFFFFF (all bits set). -- @function [parent=#PhysicsShape] setCategoryBitmask -- @param self -- @param #int bitmask -- @return PhysicsShape#PhysicsShape self (return value: cc.PhysicsShape) -------------------------------- -- Get the group of body.
-- return An interger number. -- @function [parent=#PhysicsShape] getGroup -- @param self -- @return int#int ret (return value: int) -------------------------------- -- Set this shape's moment.
-- It will change the body's moment this shape attaches.
-- param moment A float number. -- @function [parent=#PhysicsShape] setMoment -- @param self -- @param #float moment -- @return PhysicsShape#PhysicsShape self (return value: cc.PhysicsShape) -------------------------------- -- Test point is inside this shape or not.
-- param point A Vec2 object.
-- return A bool object. -- @function [parent=#PhysicsShape] containsPoint -- @param self -- @param #vec2_table point -- @return bool#bool ret (return value: bool) -------------------------------- -- Get a mask that defines which categories this physics body belongs to.
-- return An interger number. -- @function [parent=#PhysicsShape] getCategoryBitmask -- @param self -- @return int#int ret (return value: int) -------------------------------- -- -- @function [parent=#PhysicsShape] isSensor -- @param self -- @return bool#bool ret (return value: bool) -------------------------------- -- Return this shape's type.
-- return A Type object. -- @function [parent=#PhysicsShape] getType -- @param self -- @return int#int ret (return value: int) -------------------------------- -- Get a mask that defines which categories of bodies cause intersection notifications with this physics body.
-- return An interger number. -- @function [parent=#PhysicsShape] getContactTestBitmask -- @param self -- @return int#int ret (return value: int) -------------------------------- -- Get this shape's center position.
-- This function should be overrided in inherit classes.
-- return A Vec2 object. -- @function [parent=#PhysicsShape] getCenter -- @param self -- @return vec2_table#vec2_table ret (return value: vec2_table) -------------------------------- -- Get this shape's density.
-- return A float number. -- @function [parent=#PhysicsShape] getDensity -- @param self -- @return float#float ret (return value: float) -------------------------------- -- Set this shape's mass.
-- It will change the body's mass this shape attaches.
-- param mass A float number. -- @function [parent=#PhysicsShape] setMass -- @param self -- @param #float mass -- @return PhysicsShape#PhysicsShape self (return value: cc.PhysicsShape) -------------------------------- -- Get this shape's tag.
-- return An interger number. -- @function [parent=#PhysicsShape] getTag -- @param self -- @return int#int ret (return value: int) -------------------------------- -- Calculate the default moment value.
-- This function should be overrided in inherit classes.
-- return A float number, equals 0.0. -- @function [parent=#PhysicsShape] calculateDefaultMoment -- @param self -- @return float#float ret (return value: float) -------------------------------- -- A mask that defines which categories of physics bodies can collide with this physics body.
-- 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.
-- param bitmask An interger number, the default value is 0xFFFFFFFF (all bits set). -- @function [parent=#PhysicsShape] setCollisionBitmask -- @param self -- @param #int bitmask -- @return PhysicsShape#PhysicsShape self (return value: cc.PhysicsShape) -------------------------------- -- Get this shape's moment.
-- return A float number. -- @function [parent=#PhysicsShape] getMoment -- @param self -- @return float#float ret (return value: float) -------------------------------- -- Get this shape's position offset.
-- This function should be overrided in inherit classes.
-- return A Vec2 object. -- @function [parent=#PhysicsShape] getOffset -- @param self -- @return vec2_table#vec2_table ret (return value: vec2_table) -------------------------------- -- Get this shape's restitution.
-- return A float number. -- @function [parent=#PhysicsShape] getRestitution -- @param self -- @return float#float ret (return value: float) -------------------------------- -- Set this shape's friction.
-- It will change the shape's friction.
-- param friction A float number. -- @function [parent=#PhysicsShape] setFriction -- @param self -- @param #float friction -- @return PhysicsShape#PhysicsShape self (return value: cc.PhysicsShape) -------------------------------- -- Set this shape's material.
-- It will change the shape's mass, elasticity and friction.
-- param material A PhysicsMaterial object. -- @function [parent=#PhysicsShape] setMaterial -- @param self -- @param #cc.PhysicsMaterial material -- @return PhysicsShape#PhysicsShape self (return value: cc.PhysicsShape) -------------------------------- -- Set this shape's tag.
-- param tag An interger number that identifies a shape object. -- @function [parent=#PhysicsShape] setTag -- @param self -- @param #int tag -- @return PhysicsShape#PhysicsShape self (return value: cc.PhysicsShape) -------------------------------- -- A mask that defines which categories of bodies cause intersection notifications with this physics body.
-- 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.
-- param bitmask An interger number, the default value is 0x00000000 (all bits cleared). -- @function [parent=#PhysicsShape] setContactTestBitmask -- @param self -- @param #int bitmask -- @return PhysicsShape#PhysicsShape self (return value: cc.PhysicsShape) -------------------------------- -- Set this shape's restitution.
-- It will change the shape's elasticity.
-- param restitution A float number. -- @function [parent=#PhysicsShape] setRestitution -- @param self -- @param #float restitution -- @return PhysicsShape#PhysicsShape self (return value: cc.PhysicsShape) -------------------------------- -- Get the body that this shape attaches.
-- return A PhysicsBody object pointer. -- @function [parent=#PhysicsShape] getBody -- @param self -- @return PhysicsBody#PhysicsBody ret (return value: cc.PhysicsBody) return nil