Cocos Creator
手册文档
API 参考
Cocos Creator 3D
手册文档
API 参考
Cocos2d-x
手册文档
API 参考
Version: 3.2
Version: 3.5
Version: 3.4
Version: 3.3
Version: 3.1
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
b2PhysicsWorld
Class b2PhysicsWorld
Hierarchy
b2PhysicsWorld
Implements
IPhysicsWorld
Index
Constructors
constructor
Properties
_aabb
Query
Callback
_animated
Bodies
_b2
Debug
Drawer
_bodies
_contact
Listener
_debug
Draw
Flags
_debug
Graphics
_raycast
Query
Callback
_world
Accessors
debug
Draw
Flags
impl
Methods
check
Debug
Draw
Valid
on
Begin
Contact
on
End
Contact
on
Post
Solve
on
Pre
Solve
add
Body
draw
Debug
raycast
register
Contact
Fixture
remove
Body
set
Allow
Sleep
set
Gravity
step
sync
Physics
ToScene
sync
Scene
ToPhysics
testAABB
test
Point
unregister
Contact
Fixture
Constructors
constructor
new b2
Physics
World
(
)
:
b2PhysicsWorld
Returns
b2PhysicsWorld
Properties
Protected
_aabb
Query
Callback
_aabb
Query
Callback
:
PhysicsAABBQueryCallback
Protected
_animated
Bodies
_animated
Bodies
:
b2RigidBody2D
[]
= []
_b2
Debug
Drawer
_b2
Debug
Drawer
:
b2.Draw
|
null
= null
Protected
_bodies
_bodies
:
b2RigidBody2D
[]
= []
Protected
_contact
Listener
_contact
Listener
:
PhysicsContactListener
_debug
Draw
Flags
_debug
Draw
Flags
:
number
= 0
_debug
Graphics
_debug
Graphics
:
Graphics
|
null
= null
Protected
_raycast
Query
Callback
_raycast
Query
Callback
:
PhysicsRayCastCallback
Protected
_world
_world
:
b2.World
Accessors
debug
Draw
Flags
get
debugDrawFlags
(
)
:
number
set
debugDrawFlags
(
v
:
number
)
:
void
Returns
number
Parameters
v:
number
Returns
void
impl
get
impl
(
)
:
b2World
Returns
b2World
Methods
check
Debug
Draw
Valid
_check
Debug
Draw
Valid
(
)
:
void
Returns
void
on
Begin
Contact
on
Begin
Contact
(
b2contact
:
b2ContactExtends
)
:
void
Parameters
b2contact:
b2ContactExtends
Returns
void
on
End
Contact
on
End
Contact
(
b2contact
:
b2ContactExtends
)
:
void
Parameters
b2contact:
b2ContactExtends
Returns
void
on
Post
Solve
on
Post
Solve
(
b2contact
:
b2ContactExtends
, impulse
:
b2.ContactImpulse
)
:
void
Parameters
b2contact:
b2ContactExtends
impulse:
b2.ContactImpulse
Returns
void
on
Pre
Solve
on
Pre
Solve
(
b2contact
:
b2ContactExtends
)
:
void
Parameters
b2contact:
b2ContactExtends
Returns
void
add
Body
add
Body
(
body
:
b2RigidBody2D
)
:
void
Parameters
body:
b2RigidBody2D
Returns
void
draw
Debug
draw
Debug
(
)
:
void
Returns
void
raycast
raycast
(
p1
:
Vec2
, p2
:
Vec2
, type
:
ERaycast2DType
, mask
:
number
)
:
RaycastResult2D
[]
Parameters
p1:
Vec2
p2:
Vec2
type:
ERaycast2DType
mask:
number
Returns
RaycastResult2D
[]
register
Contact
Fixture
register
Contact
Fixture
(
fixture
:
b2.Fixture
)
:
void
Parameters
fixture:
b2.Fixture
Returns
void
remove
Body
remove
Body
(
body
:
b2RigidBody2D
)
:
void
Parameters
body:
b2RigidBody2D
Returns
void
set
Allow
Sleep
set
Allow
Sleep
(
v
:
boolean
)
:
void
Parameters
v:
boolean
Returns
void
set
Gravity
set
Gravity
(
v
:
IVec2Like
)
:
void
Parameters
v:
IVec2Like
Returns
void
step
step
(
deltaTime
:
number
, velocityIterations
?:
number
, positionIterations
?:
number
)
:
void
Parameters
deltaTime:
number
Default value
velocityIterations:
number
= 10
Default value
positionIterations:
number
= 10
Returns
void
sync
Physics
ToScene
sync
Physics
ToScene
(
)
:
void
Returns
void
sync
Scene
ToPhysics
sync
Scene
ToPhysics
(
)
:
void
Returns
void
testAABB
testAABB
(
rect
:
Rect
)
:
readonly
Collider2D
[]
Parameters
rect:
Rect
Returns
readonly
Collider2D
[]
test
Point
test
Point
(
point
:
Vec2
)
:
readonly
Collider2D
[]
Parameters
point:
Vec2
Returns
readonly
Collider2D
[]
unregister
Contact
Fixture
unregister
Contact
Fixture
(
fixture
:
b2.Fixture
)
:
void
Parameters
fixture:
b2.Fixture
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
constructor
_aabb
Query
Callback
_animated
Bodies
_b2
Debug
Drawer
_bodies
_contact
Listener
_debug
Draw
Flags
_debug
Graphics
_raycast
Query
Callback
_world
debug
Draw
Flags
impl
check
Debug
Draw
Valid
on
Begin
Contact
on
End
Contact
on
Post
Solve
on
Pre
Solve
add
Body
draw
Debug
raycast
register
Contact
Fixture
remove
Body
set
Allow
Sleep
set
Gravity
step
sync
Physics
ToScene
sync
Scene
ToPhysics
testAABB
test
Point
unregister
Contact
Fixture
b2
Relative
Joint
b2
Rigid
Body2D
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