pull/2/head
jaysunxiao 2022-06-26 17:56:01 +08:00
parent cb3be20e00
commit 18cbe2723c
6 changed files with 75 additions and 5 deletions

View File

@ -12,7 +12,7 @@
![Image text](image/collision-5.png) ![Image text](image/collision-5.png)
![Image text](image/collision-6.png) ![Image text](image/collision-6.png)
# 2. 刚体 # 2. RigidBody
- 刚体是组成物理世界的基本对象,你可以将刚体想象成一个你不能看到(绘制)也不能摸到(碰撞)的带有属性的物体。 - 刚体是组成物理世界的基本对象,你可以将刚体想象成一个你不能看到(绘制)也不能摸到(碰撞)的带有属性的物体。
@ -26,7 +26,7 @@
- torque扭矩 - torque扭矩
- damp衰减系数值越大物体移动越慢可以用来模拟空气摩擦力等效果。 - damp衰减系数值越大物体移动越慢可以用来模拟空气摩擦力等效果。
# 3. 物理实战 # 3. 刚体
- RigidBody动态刚体有质量可以设置速度会受到重力影响。 - RigidBody动态刚体有质量可以设置速度会受到重力影响。
@ -36,4 +36,7 @@
- Area2D一块区域能够检测到物体的碰撞但是不会做任何操作 - Area2D一块区域能够检测到物体的碰撞但是不会做任何操作
- 碰撞检测Layer和Mask - 碰撞检测Layer和MaskLayer表明当前刚体属于那一层Mask表面当前
![Image text](image/collision-9.JPG)
![Image text](image/collision-10.JPG)

Binary file not shown.

After

Width:  |  Height:  |  Size: 162 KiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/collision-10.JPG-43a1d950b76c7ebd07e260480ea153e2.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://doc/demo07_collision/image/collision-10.JPG"
dest_files=[ "res://.import/collision-10.JPG-43a1d950b76c7ebd07e260480ea153e2.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/collision-9.JPG-e1dae7ad681902cbeeb4238adb430b10.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://doc/demo07_collision/image/collision-9.JPG"
dest_files=[ "res://.import/collision-9.JPG-e1dae7ad681902cbeeb4238adb430b10.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

View File

@ -45,7 +45,6 @@ extents = Vector2( 30.17, 29.3458 )
[node name="StaticBody2D" type="StaticBody2D" parent="."] [node name="StaticBody2D" type="StaticBody2D" parent="."]
position = Vector2( 64.5824, 547.095 ) position = Vector2( 64.5824, 547.095 )
collision_layer = 2
[node name="Polygon2D" type="Polygon2D" parent="StaticBody2D"] [node name="Polygon2D" type="Polygon2D" parent="StaticBody2D"]
color = Color( 0.329412, 0.580392, 0.270588, 1 ) color = Color( 0.329412, 0.580392, 0.270588, 1 )