Cocos Creator
手册文档
API 参考
Cocos Creator 3D
手册文档
API 参考
Cocos2d-x
手册文档
API 参考
Version: 3.1
Version: 3.5
Version: 3.4
Version: 3.3
Version: 3.2
Version: 3.0
Version: 2.4
Version: 2.3
Version: 2.2
Version: 2.1
Version: 2.0
Version: 1.10
Version: 1.9
Search
Preparing search index...
The search index is not available
CocosCreatorAPI
Options
All
Public
Public/Protected
All
Inherited
Externals
Only exported
Menu
Globals
physics2d
box2d
b2RigidBody2D
Class b2RigidBody2D
Hierarchy
b2RigidBody2D
Implements
IRigidBody2D
Index
Properties
_animated
Angle
_animated
Pos
_body
_inited
_rigid
Body
Accessors
imp
impl
is
Awake
is
Sleeping
rigid
Body
Methods
destroy
init
on
Node
Transform
Changed
register
Node
Events
unregister
Node
Events
animate
apply
Angular
Impulse
apply
Force
apply
Force
ToCenter
apply
Linear
Impulse
apply
Linear
Impulse
ToCenter
apply
Torque
get
Angular
Velocity
get
Inertia
get
Linear
Velocity
get
Linear
Velocity
From
World
Point
get
Local
Point
get
Local
Vector
get
Mass
get
World
Point
get
World
Vector
initialize
is
Active
on
Destroy
on
Disable
on
Enable
reset
Velocity
set
Active
set
Allow
Sleep
set
Angular
Damping
set
Angular
Velocity
set
Fixed
Rotation
set
Gravity
Scale
set
Linear
Damping
set
Linear
Velocity
set
Type
sleep
sync
Position
ToPhysics
sync
Rotation
ToPhysics
wake
Up
Properties
_animated
Angle
_animated
Angle
:
number
= 0
_animated
Pos
_animated
Pos
:
Vec2
= new Vec2()
Private
_body
_body
:
b2.Body
|
null
= null
Private
_inited
_inited
:
boolean
= false
Private
_rigid
Body
_rigid
Body
:
RigidBody2D
Accessors
imp
set
imp
(
v
:
b2.Body
|
null
)
:
void
Parameters
v:
b2.Body
|
null
Returns
void
impl
get
impl
(
)
:
null
|
b2Body
Returns
null
|
b2Body
is
Awake
get
isAwake
(
)
:
boolean
Returns
boolean
is
Sleeping
get
isSleeping
(
)
:
boolean
Returns
boolean
rigid
Body
get
rigidBody
(
)
:
RigidBody2D
Returns
RigidBody2D
Methods
destroy
_destroy
(
)
:
void
Returns
void
init
_init
(
)
:
void
Returns
void
on
Node
Transform
Changed
on
Node
Transform
Changed
(
type
:
any
)
:
void
Parameters
type:
any
Returns
void
register
Node
Events
_register
Node
Events
(
)
:
void
Returns
void
unregister
Node
Events
_unregister
Node
Events
(
)
:
void
Returns
void
animate
animate
(
dt
:
number
)
:
void
Parameters
dt:
number
Returns
void
apply
Angular
Impulse
apply
Angular
Impulse
(
impulse
:
number
, wake
:
boolean
)
:
void
Parameters
impulse:
number
wake:
boolean
Returns
void
apply
Force
apply
Force
(
force
:
IVec2Like
, point
:
IVec2Like
, wake
:
boolean
)
:
void
Parameters
force:
IVec2Like
point:
IVec2Like
wake:
boolean
Returns
void
apply
Force
ToCenter
apply
Force
ToCenter
(
force
:
IVec2Like
, wake
:
boolean
)
:
void
Parameters
force:
IVec2Like
wake:
boolean
Returns
void
apply
Linear
Impulse
apply
Linear
Impulse
(
impulse
:
IVec2Like
, point
:
IVec2Like
, wake
:
boolean
)
:
void
Parameters
impulse:
IVec2Like
point:
IVec2Like
wake:
boolean
Returns
void
apply
Linear
Impulse
ToCenter
apply
Linear
Impulse
ToCenter
(
impulse
:
IVec2Like
, wake
:
boolean
)
:
void
Parameters
impulse:
IVec2Like
wake:
boolean
Returns
void
apply
Torque
apply
Torque
(
torque
:
number
, wake
:
boolean
)
:
void
Parameters
torque:
number
wake:
boolean
Returns
void
get
Angular
Velocity
get
Angular
Velocity
(
)
:
number
Returns
number
get
Inertia
get
Inertia
(
)
:
number
Returns
number
get
Linear
Velocity
get
Linear
Velocity<Out>
(
out
:
Out
)
:
Out
Type parameters
Out
:
IVec2Like
Parameters
out:
Out
Returns
Out
get
Linear
Velocity
From
World
Point
get
Linear
Velocity
From
World
Point<Out>
(
worldPoint
:
IVec2Like
, out
:
Out
)
:
Out
Type parameters
Out
:
IVec2Like
Parameters
worldPoint:
IVec2Like
out:
Out
Returns
Out
get
Local
Point
get
Local
Point<Out>
(
worldPoint
:
IVec2Like
, out
:
Out
)
:
Out
Type parameters
Out
:
IVec2Like
Parameters
worldPoint:
IVec2Like
out:
Out
Returns
Out
get
Local
Vector
get
Local
Vector<Out>
(
worldVector
:
IVec2Like
, out
:
Out
)
:
Out
Type parameters
Out
:
IVec2Like
Parameters
worldVector:
IVec2Like
out:
Out
Returns
Out
get
Mass
get
Mass
(
)
:
number
Returns
number
get
World
Point
get
World
Point<Out>
(
localPoint
:
IVec2Like
, out
:
Out
)
:
Out
Type parameters
Out
:
IVec2Like
Parameters
localPoint:
IVec2Like
out:
Out
Returns
Out
get
World
Vector
get
World
Vector<Out>
(
localVector
:
IVec2Like
, out
:
Out
)
:
Out
Type parameters
Out
:
IVec2Like
Parameters
localVector:
IVec2Like
out:
Out
Returns
Out
initialize
initialize
(
com
:
RigidBody2D
)
:
void
Parameters
com:
RigidBody2D
Returns
void
is
Active
is
Active
(
)
:
boolean
Returns
boolean
on
Destroy
on
Destroy
(
)
:
void
Returns
void
on
Disable
on
Disable
(
)
:
void
Returns
void
on
Enable
on
Enable
(
)
:
void
Returns
void
reset
Velocity
reset
Velocity
(
)
:
void
Returns
void
set
Active
set
Active
(
v
:
boolean
)
:
void
Parameters
v:
boolean
Returns
void
set
Allow
Sleep
set
Allow
Sleep
(
v
:
boolean
)
:
void
Parameters
v:
boolean
Returns
void
set
Angular
Damping
set
Angular
Damping
(
v
:
number
)
:
void
Parameters
v:
number
Returns
void
set
Angular
Velocity
set
Angular
Velocity
(
v
:
number
)
:
void
Parameters
v:
number
Returns
void
set
Fixed
Rotation
set
Fixed
Rotation
(
v
:
boolean
)
:
void
Parameters
v:
boolean
Returns
void
set
Gravity
Scale
set
Gravity
Scale
(
v
:
number
)
:
void
Parameters
v:
number
Returns
void
set
Linear
Damping
set
Linear
Damping
(
v
:
number
)
:
void
Parameters
v:
number
Returns
void
set
Linear
Velocity
set
Linear
Velocity
(
v
:
IVec2Like
)
:
void
Parameters
v:
IVec2Like
Returns
void
set
Type
set
Type
(
v
:
ERigidBody2DType
)
:
void
Parameters
v:
ERigidBody2DType
Returns
void
sleep
sleep
(
)
:
void
Returns
void
sync
Position
ToPhysics
sync
Position
ToPhysics
(
enableAnimated
?:
boolean
)
:
void
Parameters
Default value
enableAnimated:
boolean
= false
Returns
void
sync
Rotation
ToPhysics
sync
Rotation
ToPhysics
(
enableAnimated
?:
boolean
)
:
void
Parameters
Default value
enableAnimated:
boolean
= false
Returns
void
wake
Up
wake
Up
(
)
:
void
Returns
void
Globals
physics2d
box2d
Manifold
Point
PhysicsAABBQuery
Callback
Physics
Contact
Physics
Contact
Listener
Physics
Debug
Draw
Physics
Ray
Cast
Callback
b2
Distance
Joint
b2
Fixed
Joint
b2
Hinge
Joint
b2
Joint
b2
Mouse
Joint
b2
Physics
World
b2
Relative
Joint
b2
Rigid
Body2D
_animated
Angle
_animated
Pos
_body
_inited
_rigid
Body
imp
impl
is
Awake
is
Sleeping
rigid
Body
destroy
init
on
Node
Transform
Changed
register
Node
Events
unregister
Node
Events
animate
apply
Angular
Impulse
apply
Force
apply
Force
ToCenter
apply
Linear
Impulse
apply
Linear
Impulse
ToCenter
apply
Torque
get
Angular
Velocity
get
Inertia
get
Linear
Velocity
get
Linear
Velocity
From
World
Point
get
Local
Point
get
Local
Vector
get
Mass
get
World
Point
get
World
Vector
initialize
is
Active
on
Destroy
on
Disable
on
Enable
reset
Velocity
set
Active
set
Allow
Sleep
set
Angular
Damping
set
Angular
Velocity
set
Fixed
Rotation
set
Gravity
Scale
set
Linear
Damping
set
Linear
Velocity
set
Type
sleep
sync
Position
ToPhysics
sync
Rotation
ToPhysics
wake
Up
b2
Slider
Joint
b2
Spring
Joint
b2
Wheel
Joint
b2
Contact
Extends
GREEN_
COLOR
RED_
COLOR
_tmp_
color
_tmp_
vec2
b2worldmanifold
manifold
Point
Cache
point
Cache
pools
temo
Body
Def
temp
B2AABB
temp
B2Vec2
temp
Vec2_
1
temp
Vec2_
1
temp
Vec2_
2
temp
Vec3
temp
Vec3
test
Results
impulse
manifold
worldmanifold
Generated using
TypeDoc