feat: 建立关卡工坊并整理项目目录
- 加入 Godot 基础试玩、画风展示和通孔验证场景 - 支持自由放球、多层叠放、墙壁、锥口球洞及固定 +5 m/s 定向加速方块 - 保存 Blender 源资产、模型导出、资源制作脚本和关卡编辑存档逻辑 - 按七类目录归档工程,集中 zsh 启动入口并补充 AGENTS.md 文件索引 - 同步设计规则、依赖锁定、验证报告和目录迁移记录 验证:目录迁移后的资源导入与四个场景加载通过;本次提交前检查暂存内容,未重复运行整套物理测试。
This commit is contained in:
Binary file not shown.
@@ -0,0 +1,45 @@
|
||||
[remap]
|
||||
|
||||
importer="scene"
|
||||
importer_version=1
|
||||
type="PackedScene"
|
||||
uid="uid://bqbwiuklxhu3m"
|
||||
path="res://.godot/imported/model.glb-5e055581ba61e2c0c52215a9c57579de.scn"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/balls/iron_ball/baseline/model.glb"
|
||||
dest_files=["res://.godot/imported/model.glb-5e055581ba61e2c0c52215a9c57579de.scn"]
|
||||
|
||||
[params]
|
||||
|
||||
nodes/root_type=""
|
||||
nodes/root_name=""
|
||||
nodes/root_script=null
|
||||
mesh_library/use_node_names_as_mesh_names=false
|
||||
array_mesh/deduplicate_surfaces=true
|
||||
nodes/apply_root_scale=true
|
||||
nodes/root_scale=1.0
|
||||
nodes/import_as_skeleton_bones=false
|
||||
nodes/use_name_suffixes=true
|
||||
nodes/use_node_type_suffixes=true
|
||||
meshes/ensure_tangents=true
|
||||
meshes/generate_lods=true
|
||||
meshes/create_shadow_meshes=true
|
||||
meshes/light_baking=1
|
||||
meshes/lightmap_texel_size=0.2
|
||||
meshes/force_disable_compression=false
|
||||
skins/use_named_skins=true
|
||||
animation/import=true
|
||||
animation/fps=30
|
||||
animation/trimming=false
|
||||
animation/remove_immutable_tracks=true
|
||||
animation/import_rest_as_RESET=false
|
||||
import_script/path=""
|
||||
materials/extract=0
|
||||
materials/extract_format=0
|
||||
materials/extract_path=""
|
||||
_subresources={}
|
||||
gltf/naming_version=2
|
||||
gltf/embedded_image_handling=1
|
||||
gltf/texture_map_mode=1
|
||||
Binary file not shown.
@@ -0,0 +1,45 @@
|
||||
[remap]
|
||||
|
||||
importer="scene"
|
||||
importer_version=1
|
||||
type="PackedScene"
|
||||
uid="uid://u75pywkqa11i"
|
||||
path="res://.godot/imported/model.glb-84ea59e03d48e9c4a39ea66137920174.scn"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/balls/iron_ball/model.glb"
|
||||
dest_files=["res://.godot/imported/model.glb-84ea59e03d48e9c4a39ea66137920174.scn"]
|
||||
|
||||
[params]
|
||||
|
||||
nodes/root_type=""
|
||||
nodes/root_name=""
|
||||
nodes/root_script=null
|
||||
mesh_library/use_node_names_as_mesh_names=false
|
||||
array_mesh/deduplicate_surfaces=true
|
||||
nodes/apply_root_scale=true
|
||||
nodes/root_scale=1.0
|
||||
nodes/import_as_skeleton_bones=false
|
||||
nodes/use_name_suffixes=true
|
||||
nodes/use_node_type_suffixes=true
|
||||
meshes/ensure_tangents=true
|
||||
meshes/generate_lods=true
|
||||
meshes/create_shadow_meshes=true
|
||||
meshes/light_baking=1
|
||||
meshes/lightmap_texel_size=0.2
|
||||
meshes/force_disable_compression=false
|
||||
skins/use_named_skins=true
|
||||
animation/import=true
|
||||
animation/fps=30
|
||||
animation/trimming=false
|
||||
animation/remove_immutable_tracks=true
|
||||
animation/import_rest_as_RESET=false
|
||||
import_script/path=""
|
||||
materials/extract=0
|
||||
materials/extract_format=0
|
||||
materials/extract_path=""
|
||||
_subresources={}
|
||||
gltf/naming_version=2
|
||||
gltf/embedded_image_handling=1
|
||||
gltf/texture_map_mode=1
|
||||
@@ -0,0 +1,70 @@
|
||||
extends RigidBody3D
|
||||
|
||||
const Booster = preload("res://assets/blocks/directional_boost/behavior.gd")
|
||||
var boost_controller = Booster.new()
|
||||
var radius: float = 0.3
|
||||
var drag_coefficient: float = 0.47
|
||||
var air_density: float = 1.225
|
||||
var wind_velocity := Vector3.ZERO
|
||||
var mu_static: float = 0.42
|
||||
var mu_dynamic: float = 0.32
|
||||
var rolling_resistance: float = 0.025
|
||||
var friction_enabled := true
|
||||
var rolling_enabled := true
|
||||
var drag_enabled := true
|
||||
var contact_count := 0
|
||||
var ball_contact_count := 0
|
||||
var contact_slip := 0.0
|
||||
var air_force := Vector3.ZERO
|
||||
var rolling_torque := Vector3.ZERO
|
||||
var travelled := 0.0
|
||||
var previous_position := Vector3.ZERO
|
||||
var tracking_started := false
|
||||
|
||||
func _ready() -> void:
|
||||
continuous_cd = true
|
||||
contact_monitor = true
|
||||
max_contacts_reported = 12
|
||||
can_sleep = false
|
||||
linear_damp_mode = RigidBody3D.DAMP_MODE_REPLACE
|
||||
angular_damp_mode = RigidBody3D.DAMP_MODE_REPLACE
|
||||
linear_damp = 0.0
|
||||
angular_damp = 0.0
|
||||
|
||||
func _integrate_forces(state: PhysicsDirectBodyState3D) -> void:
|
||||
if freeze:
|
||||
return
|
||||
contact_count = state.get_contact_count()
|
||||
ball_contact_count = 0
|
||||
contact_slip = 0.0
|
||||
var support_normal := Vector3.ZERO
|
||||
for i in range(contact_count):
|
||||
if state.get_contact_collider_object(i) is RigidBody3D:ball_contact_count+=1
|
||||
# Contact positions are global; the sphere's radial direction is unambiguous.
|
||||
var n := (state.transform.origin - state.get_contact_local_position(i)).normalized()
|
||||
var relative := state.get_contact_local_velocity_at_position(i) - state.get_contact_collider_velocity_at_position(i)
|
||||
var slip := relative - n * relative.dot(n)
|
||||
contact_slip = maxf(contact_slip, slip.length())
|
||||
if n.dot(Vector3.UP) > 0.15:
|
||||
support_normal += n
|
||||
# Godot exposes one native friction coefficient. Select a slip-dependent
|
||||
# coefficient; native contact solver still owns the friction impulse.
|
||||
physics_material_override.friction = (mu_static if contact_slip < 0.035 else mu_dynamic) if friction_enabled else 0.0
|
||||
boost_controller.integrate(state, radius)
|
||||
var relative_air := state.linear_velocity - wind_velocity
|
||||
air_force = -0.5 * air_density * drag_coefficient * PI * radius * radius * relative_air.length() * relative_air if drag_enabled else Vector3.ZERO
|
||||
state.apply_central_force(air_force)
|
||||
rolling_torque = Vector3.ZERO
|
||||
if rolling_enabled and support_normal.length_squared() > 0.001:
|
||||
var n := support_normal.normalized()
|
||||
var roll := state.angular_velocity - n * state.angular_velocity.dot(n)
|
||||
if roll.length() > 0.0001:
|
||||
var support := maxf(0.0, -(mass * state.total_gravity + air_force).dot(n))
|
||||
var moment := 0.4 * mass * radius * radius
|
||||
var limit := roll.length() * moment / state.step
|
||||
rolling_torque = -roll.normalized() * minf(rolling_resistance * support * radius, limit)
|
||||
state.apply_torque(rolling_torque)
|
||||
if tracking_started:
|
||||
travelled += state.transform.origin.distance_to(previous_position)
|
||||
previous_position = state.transform.origin
|
||||
tracking_started = true
|
||||
@@ -0,0 +1 @@
|
||||
uid://ieaoae3mjv03
|
||||
@@ -0,0 +1,8 @@
|
||||
"""Rebuild only this resource using the shared collection authoring code."""
|
||||
from pathlib import Path
|
||||
import runpy
|
||||
|
||||
RESOURCE = Path(__file__).resolve().parent.parent.name
|
||||
ROOT = Path(__file__).resolve().parents[4]
|
||||
runpy.run_path(str(ROOT / 'assets/collections/storybook/source/build.py'),
|
||||
init_globals={'ONLY_ASSET': RESOURCE}, run_name='__main__')
|
||||
Binary file not shown.
Reference in New Issue
Block a user