@playcraft/skills 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +333 -0
- package/dist/src/index.d.ts +3 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +2 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/skills.loader.d.ts +31 -0
- package/dist/src/skills.loader.d.ts.map +1 -0
- package/dist/src/skills.loader.js +200 -0
- package/dist/src/skills.loader.js.map +1 -0
- package/dist/src/skills.types.d.ts +44 -0
- package/dist/src/skills.types.d.ts.map +1 -0
- package/dist/src/skills.types.js +9 -0
- package/dist/src/skills.types.js.map +1 -0
- package/package.json +35 -0
- package/skills/2048_core.aigameplay/SKILL.md +123 -0
- package/skills/2048_core.aigameplay/manifest.json +159 -0
- package/skills/2048_core.aigameplay/ref/pgs-schema.json +194 -0
- package/skills/2048_core.aigameplay/ref/reducer.template.ts +189 -0
- package/skills/SKILL.md +46 -0
- package/skills/ad_compliance_rules.aiconfig/SKILL.md +85 -0
- package/skills/ad_compliance_rules.aiconfig/manifest.json +60 -0
- package/skills/agent_remix_orchestrator.aicomponent/SKILL.md +257 -0
- package/skills/agent_remix_orchestrator.aicomponent/manifest.json +12 -0
- package/skills/app_metadata.aiconfig/SKILL.md +53 -0
- package/skills/app_metadata.aiconfig/manifest.json +32 -0
- package/skills/appear_sfx.aiaudio/SKILL.md +59 -0
- package/skills/appear_sfx.aiaudio/manifest.json +45 -0
- package/skills/appear_sfx.aiaudio/ref/appear.mp3 +0 -0
- package/skills/arrow_move_error_sfx.aiaudio/SKILL.md +59 -0
- package/skills/arrow_move_error_sfx.aiaudio/manifest.json +45 -0
- package/skills/arrow_move_error_sfx.aiaudio/ref/arrow_move_error.mp3 +0 -0
- package/skills/arrow_path_data_format.aicomponent/SKILL.md +152 -0
- package/skills/arrow_path_data_format.aicomponent/manifest.json +57 -0
- package/skills/arrow_path_data_format.aicomponent/ref/LevelParser.ts +188 -0
- package/skills/arrow_path_data_format.aicomponent/ref/LevelTypes.ts +131 -0
- package/skills/arrow_pick_match_rules.aigameplay/SKILL.md +117 -0
- package/skills/arrow_pick_match_rules.aigameplay/manifest.json +105 -0
- package/skills/arrow_pick_match_rules.aigameplay/ref/pgs-schema.json +180 -0
- package/skills/asset_pipeline_scripts.aicomponent/SKILL.md +117 -0
- package/skills/asset_pipeline_scripts.aicomponent/manifest.json +17 -0
- package/skills/asset_pipeline_scripts.aicomponent/ref/gen-sprite.sh +105 -0
- package/skills/ball_sort.aigameplay/SKILL.md +109 -0
- package/skills/ball_sort.aigameplay/manifest.json +155 -0
- package/skills/ball_sort.aigameplay/ref/pgs-schema.json +192 -0
- package/skills/ball_sort.aigameplay/ref/reducer.template.ts +156 -0
- package/skills/basketball_shot.aigameplay/SKILL.md +94 -0
- package/skills/basketball_shot.aigameplay/manifest.json +150 -0
- package/skills/basketball_shot.aigameplay/ref/pgs-schema.json +229 -0
- package/skills/basketball_shot.aigameplay/ref/reducer.template.ts +189 -0
- package/skills/bg_music.aiaudio/SKILL.md +61 -0
- package/skills/bg_music.aiaudio/manifest.json +48 -0
- package/skills/bg_music.aiaudio/ref/bg.mp3 +0 -0
- package/skills/big_watermelon.aigameplay/SKILL.md +94 -0
- package/skills/big_watermelon.aigameplay/manifest.json +155 -0
- package/skills/big_watermelon.aigameplay/ref/pgs-schema.json +191 -0
- package/skills/big_watermelon.aigameplay/ref/reducer.template.ts +202 -0
- package/skills/block_puzzle.aigameplay/SKILL.md +121 -0
- package/skills/block_puzzle.aigameplay/manifest.json +154 -0
- package/skills/block_puzzle.aigameplay/ref/pgs-schema.json +170 -0
- package/skills/block_puzzle.aigameplay/ref/reducer.template.ts +182 -0
- package/skills/board_entity_sprite.aiimage/SKILL.md +255 -0
- package/skills/board_entity_sprite.aiimage/manifest.json +153 -0
- package/skills/board_entity_sprite.aiimage/ref/ProceduralCar.ts +357 -0
- package/skills/board_entity_sprite.aiimage/ref/car.png +0 -0
- package/skills/board_entity_sprite.aiimage/ref/car.webp +0 -0
- package/skills/bottom_ui_bar.aicomponent/SKILL.md +50 -0
- package/skills/bottom_ui_bar.aicomponent/manifest.json +31 -0
- package/skills/bottom_ui_bar.aicomponent/ref/GameBottomUI.ts +27 -0
- package/skills/bubble_shooter.aigameplay/SKILL.md +129 -0
- package/skills/bubble_shooter.aigameplay/manifest.json +181 -0
- package/skills/bubble_shooter.aigameplay/ref/pgs-schema.json +226 -0
- package/skills/bubble_shooter.aigameplay/ref/reducer.template.ts +228 -0
- package/skills/button_click_sfx.aiaudio/SKILL.md +59 -0
- package/skills/button_click_sfx.aiaudio/manifest.json +45 -0
- package/skills/button_click_sfx.aiaudio/ref/button_click.mp3 +0 -0
- package/skills/calm_piano.aiaudio/SKILL.md +68 -0
- package/skills/calm_piano.aiaudio/manifest.json +50 -0
- package/skills/camera_controller_3d.aicomponent/SKILL.md +100 -0
- package/skills/camera_controller_3d.aicomponent/manifest.json +52 -0
- package/skills/camera_controller_3d.aicomponent/ref/CameraController.ts +199 -0
- package/skills/camera_controller_3d.aicomponent/ref/OrbitControlsAdapter.ts +152 -0
- package/skills/candy_tile.aiimage/SKILL.md +62 -0
- package/skills/candy_tile.aiimage/manifest.json +49 -0
- package/skills/car_parking.aigameplay/SKILL.md +105 -0
- package/skills/car_parking.aigameplay/manifest.json +164 -0
- package/skills/car_parking.aigameplay/ref/pgs-schema.json +163 -0
- package/skills/car_parking.aigameplay/ref/reducer.template.ts +166 -0
- package/skills/castle.aiimage/SKILL.md +64 -0
- package/skills/castle.aiimage/manifest.json +48 -0
- package/skills/cheerful_ukulele.aiaudio/SKILL.md +72 -0
- package/skills/cheerful_ukulele.aiaudio/manifest.json +50 -0
- package/skills/click_sfx.aiaudio/SKILL.md +59 -0
- package/skills/click_sfx.aiaudio/manifest.json +45 -0
- package/skills/click_sfx.aiaudio/ref/click.mp3 +0 -0
- package/skills/combo_display.aicomponent/SKILL.md +45 -0
- package/skills/combo_display.aicomponent/manifest.json +31 -0
- package/skills/combo_display.aicomponent/ref/ComboManager.ts +362 -0
- package/skills/combo_display.aicomponent/ref/ComboSmallUI.ts +232 -0
- package/skills/combo_praise_text.aicomponent/SKILL.md +56 -0
- package/skills/combo_praise_text.aicomponent/manifest.json +34 -0
- package/skills/combo_praise_text.aicomponent/ref/ComboManager.ts +362 -0
- package/skills/countdown_timer.aicomponent/SKILL.md +44 -0
- package/skills/countdown_timer.aicomponent/manifest.json +35 -0
- package/skills/countdown_timer.aicomponent/ref/CountdownDisplay.ts +213 -0
- package/skills/cta_platform_config.aiconfig/SKILL.md +72 -0
- package/skills/cta_platform_config.aiconfig/manifest.json +56 -0
- package/skills/debug_overlay.aicomponent/SKILL.md +75 -0
- package/skills/debug_overlay.aicomponent/manifest.json +17 -0
- package/skills/debug_overlay.aicomponent/ref/DebugOverlay.ts +144 -0
- package/skills/desert.aiimage/SKILL.md +63 -0
- package/skills/desert.aiimage/manifest.json +49 -0
- package/skills/difficulty_curve_designer.aiconfig/SKILL.md +68 -0
- package/skills/difficulty_curve_designer.aiconfig/manifest.json +36 -0
- package/skills/digit_renderer.aicomponent/SKILL.md +43 -0
- package/skills/digit_renderer.aicomponent/manifest.json +25 -0
- package/skills/digit_renderer.aicomponent/ref/DigitRenderer.ts +237 -0
- package/skills/download_button.aicomponent/SKILL.md +44 -0
- package/skills/download_button.aicomponent/manifest.json +25 -0
- package/skills/download_button.aicomponent/ref/DownloadButton.ts +137 -0
- package/skills/draw_line_puzzle.aigameplay/SKILL.md +84 -0
- package/skills/draw_line_puzzle.aigameplay/manifest.json +152 -0
- package/skills/draw_line_puzzle.aigameplay/ref/pgs-schema.json +189 -0
- package/skills/draw_line_puzzle.aigameplay/ref/reducer.template.ts +194 -0
- package/skills/easy_to_hard.aiconfig/SKILL.md +52 -0
- package/skills/easy_to_hard.aiconfig/manifest.json +33 -0
- package/skills/eight_ball_pool.aigameplay/SKILL.md +104 -0
- package/skills/eight_ball_pool.aigameplay/manifest.json +152 -0
- package/skills/eight_ball_pool.aigameplay/ref/pgs-schema.json +205 -0
- package/skills/eight_ball_pool.aigameplay/ref/reducer.template.ts +198 -0
- package/skills/energetic_electronic.aiaudio/SKILL.md +69 -0
- package/skills/energetic_electronic.aiaudio/manifest.json +51 -0
- package/skills/fail_sfx.aiaudio/SKILL.md +59 -0
- package/skills/fail_sfx.aiaudio/manifest.json +44 -0
- package/skills/fail_sfx.aiaudio/ref/fail.mp3 +0 -0
- package/skills/figer_icon.aiimage/SKILL.md +58 -0
- package/skills/figer_icon.aiimage/manifest.json +48 -0
- package/skills/figer_icon.aiimage/ref/figer.png +0 -0
- package/skills/figer_icon.aiimage/ref/figer.webp +0 -0
- package/skills/forest.aiimage/SKILL.md +74 -0
- package/skills/forest.aiimage/manifest.json +48 -0
- package/skills/fruit_tile.aiimage/SKILL.md +68 -0
- package/skills/fruit_tile.aiimage/manifest.json +48 -0
- package/skills/game_over_panel.aicomponent/SKILL.md +47 -0
- package/skills/game_over_panel.aicomponent/manifest.json +61 -0
- package/skills/game_over_panel.aicomponent/ref/GameOverPanel.ts +74 -0
- package/skills/game_scene.aicomponent/SKILL.md +57 -0
- package/skills/game_scene.aicomponent/manifest.json +36 -0
- package/skills/game_scene.aicomponent/ref/Game.ts +748 -0
- package/skills/gameplay_balance_check.aivalidator/SKILL.md +69 -0
- package/skills/gameplay_balance_check.aivalidator/manifest.json +21 -0
- package/skills/gameplay_unit_test.aivalidator/SKILL.md +89 -0
- package/skills/gameplay_unit_test.aivalidator/manifest.json +17 -0
- package/skills/gameplay_unit_test.aivalidator/ref/gameplay.test.ts +202 -0
- package/skills/gameplay_unit_test.aivalidator/ref/vitest.config.ts +13 -0
- package/skills/grid_board_layout.aicomponent/SKILL.md +85 -0
- package/skills/grid_board_layout.aicomponent/manifest.json +69 -0
- package/skills/grid_board_layout.aicomponent/ref/BoardLayout.ts +416 -0
- package/skills/grid_board_layout.aicomponent/ref/BoardLayout3D.ts +125 -0
- package/skills/grid_board_layout.aicomponent/ref/BoardLayoutMath.ts +85 -0
- package/skills/grid_board_layout.aicomponent/ref/BoardRenderer3D.ts +298 -0
- package/skills/heart_lives.aicomponent/SKILL.md +42 -0
- package/skills/heart_lives.aicomponent/manifest.json +25 -0
- package/skills/heart_lives.aicomponent/ref/HeartDisplay.ts +96 -0
- package/skills/idle-breathe.aicomponent/SKILL.md +27 -0
- package/skills/idle-breathe.aicomponent/manifest.json +20 -0
- package/skills/idle-breathe.aicomponent/ref/phaser.js +25 -0
- package/skills/idle-breathe.aicomponent/ref/playcanvas.js +29 -0
- package/skills/jewel_tile.aiimage/SKILL.md +63 -0
- package/skills/jewel_tile.aiimage/manifest.json +49 -0
- package/skills/knife_hit.aigameplay/SKILL.md +103 -0
- package/skills/knife_hit.aigameplay/manifest.json +151 -0
- package/skills/knife_hit.aigameplay/ref/pgs-schema.json +202 -0
- package/skills/knife_hit.aigameplay/ref/reducer.template.ts +196 -0
- package/skills/left_right_parkour.aigameplay/SKILL.md +120 -0
- package/skills/left_right_parkour.aigameplay/manifest.json +165 -0
- package/skills/left_right_parkour.aigameplay/ref/pgs-schema.json +200 -0
- package/skills/left_right_parkour.aigameplay/ref/reducer.template.ts +194 -0
- package/skills/level_data_pack.aiconfig/SKILL.md +64 -0
- package/skills/level_data_pack.aiconfig/manifest.json +37 -0
- package/skills/level_data_validator.aivalidator/SKILL.md +85 -0
- package/skills/level_data_validator.aivalidator/manifest.json +17 -0
- package/skills/level_data_validator.aivalidator/ref/LevelValidator.ts +113 -0
- package/skills/level_lifecycle.aicomponent/SKILL.md +81 -0
- package/skills/level_lifecycle.aicomponent/manifest.json +87 -0
- package/skills/level_lifecycle.aicomponent/ref/LevelLifecycle.ts +235 -0
- package/skills/level_solvability_validator.aivalidator/SKILL.md +74 -0
- package/skills/level_solvability_validator.aivalidator/manifest.json +23 -0
- package/skills/level_solvability_validator.aivalidator/ref/LevelValidator.ts +186 -0
- package/skills/level_state.aicomponent/SKILL.md +55 -0
- package/skills/level_state.aicomponent/manifest.json +34 -0
- package/skills/level_state.aicomponent/ref/LevelDataManager.ts +26 -0
- package/skills/level_state.aicomponent/ref/LevelManager.ts +26 -0
- package/skills/loading_screen.aicomponent/SKILL.md +57 -0
- package/skills/loading_screen.aicomponent/manifest.json +43 -0
- package/skills/loading_screen.aicomponent/ref/LoadingUI.ts +339 -0
- package/skills/lose_result_panel.aiimage/SKILL.md +58 -0
- package/skills/lose_result_panel.aiimage/manifest.json +47 -0
- package/skills/lose_result_panel.aiimage/ref/lose.png +0 -0
- package/skills/lose_result_panel.aiimage/ref/lose.webp +0 -0
- package/skills/lose_sfx.aiaudio/SKILL.md +59 -0
- package/skills/lose_sfx.aiaudio/manifest.json +45 -0
- package/skills/lose_sfx.aiaudio/ref/lose.mp3 +0 -0
- package/skills/match-pop.aicomponent/SKILL.md +29 -0
- package/skills/match-pop.aicomponent/manifest.json +19 -0
- package/skills/match-pop.aicomponent/ref/phaser.js +30 -0
- package/skills/match-pop.aicomponent/ref/playcanvas.js +22 -0
- package/skills/match3_core.aigameplay/SKILL.md +125 -0
- package/skills/match3_core.aigameplay/manifest.json +107 -0
- package/skills/match3_core.aigameplay/ref/pgs-schema.json +154 -0
- package/skills/match3_core.aigameplay/ref/reducer.template.ts +191 -0
- package/skills/match_engine.aicomponent/SKILL.md +84 -0
- package/skills/match_engine.aicomponent/manifest.json +23 -0
- package/skills/match_engine.aicomponent/ref/MatchEngine.ts +75 -0
- package/skills/memory_match.aigameplay/SKILL.md +111 -0
- package/skills/memory_match.aigameplay/manifest.json +164 -0
- package/skills/memory_match.aigameplay/ref/pgs-schema.json +190 -0
- package/skills/memory_match.aigameplay/ref/reducer.template.ts +162 -0
- package/skills/merge_core.aigameplay/SKILL.md +112 -0
- package/skills/merge_core.aigameplay/manifest.json +154 -0
- package/skills/merge_core.aigameplay/ref/pgs-schema.json +202 -0
- package/skills/merge_core.aigameplay/ref/reducer.template.ts +179 -0
- package/skills/mistake_sfx.aiaudio/SKILL.md +59 -0
- package/skills/mistake_sfx.aiaudio/manifest.json +45 -0
- package/skills/mistake_sfx.aiaudio/ref/mistake.mp3 +0 -0
- package/skills/nomove_hint_overlay.aiimage/SKILL.md +58 -0
- package/skills/nomove_hint_overlay.aiimage/manifest.json +48 -0
- package/skills/nomove_hint_overlay.aiimage/ref/nomove_hint.png +0 -0
- package/skills/nomove_hint_overlay.aiimage/ref/nomove_hint.webp +0 -0
- package/skills/normal_dot.aiimage/SKILL.md +58 -0
- package/skills/normal_dot.aiimage/manifest.json +46 -0
- package/skills/normal_dot.aiimage/ref/normal_dot.png +0 -0
- package/skills/normal_dot.aiimage/ref/normal_dot.webp +0 -0
- package/skills/ocean.aiimage/SKILL.md +71 -0
- package/skills/ocean.aiimage/manifest.json +49 -0
- package/skills/particle-confetti.aicomponent/SKILL.md +32 -0
- package/skills/particle-confetti.aicomponent/manifest.json +21 -0
- package/skills/particle-confetti.aicomponent/ref/html5-spritesheet.js +17 -0
- package/skills/particle-confetti.aicomponent/ref/phaser.js +38 -0
- package/skills/particle-explosion.aicomponent/SKILL.md +37 -0
- package/skills/particle-explosion.aicomponent/manifest.json +24 -0
- package/skills/particle-explosion.aicomponent/ref/html5-spritesheet.js +40 -0
- package/skills/particle-explosion.aicomponent/ref/phaser.js +46 -0
- package/skills/particle-explosion.aicomponent/ref/playcanvas.js +33 -0
- package/skills/particle-trail.aicomponent/SKILL.md +25 -0
- package/skills/particle-trail.aicomponent/manifest.json +22 -0
- package/skills/particle-trail.aicomponent/ref/phaser.js +31 -0
- package/skills/path_animation.aicomponent/SKILL.md +82 -0
- package/skills/path_animation.aicomponent/manifest.json +77 -0
- package/skills/path_animation.aicomponent/ref/AnimationManager.ts +694 -0
- package/skills/path_animation.aicomponent/ref/AnimationManager3D.ts +317 -0
- package/skills/path_elimination_rules.aigameplay/SKILL.md +88 -0
- package/skills/path_elimination_rules.aigameplay/manifest.json +119 -0
- package/skills/path_elimination_rules.aigameplay/ref/pgs-schema.json +227 -0
- package/skills/path_input_handler.aicomponent/SKILL.md +87 -0
- package/skills/path_input_handler.aicomponent/manifest.json +97 -0
- package/skills/path_input_handler.aicomponent/ref/InputHandler.ts +714 -0
- package/skills/path_input_handler.aicomponent/ref/InputHandler3D.ts +204 -0
- package/skills/path_renderer.aicomponent/SKILL.md +101 -0
- package/skills/path_renderer.aicomponent/manifest.json +69 -0
- package/skills/path_renderer.aicomponent/ref/PathRenderer.ts +509 -0
- package/skills/path_renderer.aicomponent/ref/PathRenderer3D.ts +176 -0
- package/skills/path_renderer.aicomponent/ref/PathRenderers.ts +640 -0
- package/skills/phaser.aicomponent/SKILL.md +315 -0
- package/skills/phaser.aicomponent/manifest.json +156 -0
- package/skills/phaser.aicomponent/ref/BootScene.ts +29 -0
- package/skills/phaser.aicomponent/ref/GameConfig.ts +29 -0
- package/skills/phaser.aicomponent/ref/GameScene.ts +88 -0
- package/skills/phaser.aicomponent/ref/PreloaderScene.ts +78 -0
- package/skills/phaser.aicomponent/ref/SceneKeys.ts +7 -0
- package/skills/phaser.aicomponent/ref/SoundUtils.ts +21 -0
- package/skills/phaser.aicomponent/ref/UiLayout.ts +74 -0
- package/skills/phaser.aicomponent/ref/globals.d.ts +52 -0
- package/skills/phaser.aicomponent/ref/index.css +40 -0
- package/skills/phaser.aicomponent/ref/index.html +14 -0
- package/skills/phaser.aicomponent/ref/index.ts +48 -0
- package/skills/phaser.aicomponent/ref/main.ts +16 -0
- package/skills/phaser.aicomponent/ref/package.json +22 -0
- package/skills/phaser.aicomponent/ref/tsconfig.json +25 -0
- package/skills/phaser.aicomponent/ref/webpack.config.js +57 -0
- package/skills/phaser_scene_lifecycle.aicomponent/SKILL.md +63 -0
- package/skills/phaser_scene_lifecycle.aicomponent/manifest.json +33 -0
- package/skills/pick_and_match_rules.aigameplay/SKILL.md +113 -0
- package/skills/pick_and_match_rules.aigameplay/manifest.json +121 -0
- package/skills/pick_and_match_rules.aigameplay/ref/pgs-schema.json +354 -0
- package/skills/pin_pull.aigameplay/SKILL.md +110 -0
- package/skills/pin_pull.aigameplay/manifest.json +164 -0
- package/skills/pin_pull.aigameplay/ref/pgs-schema.json +201 -0
- package/skills/pin_pull.aigameplay/ref/reducer.template.ts +216 -0
- package/skills/playable_app_logo.aiimage/SKILL.md +58 -0
- package/skills/playable_app_logo.aiimage/manifest.json +47 -0
- package/skills/playable_app_logo.aiimage/ref/logo.png +0 -0
- package/skills/playable_app_logo.aiimage/ref/logo.webp +0 -0
- package/skills/playable_end_screen_layout.aicomponent/SKILL.md +75 -0
- package/skills/playable_end_screen_layout.aicomponent/manifest.json +24 -0
- package/skills/playable_guidance_layer.aicomponent/SKILL.md +89 -0
- package/skills/playable_guidance_layer.aicomponent/manifest.json +24 -0
- package/skills/playable_hud_layout.aicomponent/SKILL.md +96 -0
- package/skills/playable_hud_layout.aicomponent/manifest.json +24 -0
- package/skills/playable_scripts_build.aicomponent/SKILL.md +69 -0
- package/skills/playable_scripts_build.aicomponent/manifest.json +53 -0
- package/skills/playable_scripts_build.aicomponent/ref/builds.config.js +257 -0
- package/skills/playcraft-3d-flip-sprite/SKILL.md +336 -0
- package/skills/playcraft-3d-flip-sprite/renderer/flatten_glb.mjs +62 -0
- package/skills/playcraft-3d-flip-sprite/renderer/render.mjs +325 -0
- package/skills/playcraft-3d-flip-sprite/renderer/render_single.mjs +138 -0
- package/skills/playcraft-asset-management/SKILL.md +73 -0
- package/skills/playcraft-audio-generation/SKILL.md +126 -0
- package/skills/playcraft-build/SKILL.md +44 -0
- package/skills/playcraft-code-editor/SKILL.md +71 -0
- package/skills/playcraft-create-remix/SKILL.md +62 -0
- package/skills/playcraft-deploy/SKILL.md +59 -0
- package/skills/playcraft-image-generation/SKILL.md +148 -0
- package/skills/playcraft-image-processing/SKILL.md +216 -0
- package/skills/playcraft-platform-intro/SKILL.md +41 -0
- package/skills/playcraft-prefab/SKILL.md +98 -0
- package/skills/playcraft-project-management/SKILL.md +57 -0
- package/skills/playcraft-remix-workflow/SKILL.md +119 -0
- package/skills/playcraft-remix-workflow/references/xplatform.schema.json5 +31 -0
- package/skills/playcraft-save/SKILL.md +46 -0
- package/skills/playcraft-skill-recommender/SKILL.md +152 -0
- package/skills/playcraft-sprite-generation/SKILL.md +534 -0
- package/skills/playcraft-sprite-remix/SKILL.md +155 -0
- package/skills/playcraft-sprite-sheet/SKILL.md +97 -0
- package/skills/playtest_report.aivalidator/SKILL.md +103 -0
- package/skills/playtest_report.aivalidator/manifest.json +21 -0
- package/skills/preloader_scene.aicomponent/SKILL.md +58 -0
- package/skills/preloader_scene.aicomponent/manifest.json +43 -0
- package/skills/preloader_scene.aicomponent/ref/Preloader.ts +339 -0
- package/skills/progress_bar.aicomponent/SKILL.md +38 -0
- package/skills/progress_bar.aicomponent/manifest.json +25 -0
- package/skills/progress_bar.aicomponent/ref/ProgressDisplay.ts +140 -0
- package/skills/references/xplatform.schema.json5 +31 -0
- package/skills/responsive_2d_layout.aicomponent/SKILL.md +161 -0
- package/skills/responsive_2d_layout.aicomponent/manifest.json +43 -0
- package/skills/responsive_2d_layout.aicomponent/ref/UiLayout.ts +56 -0
- package/skills/run_context_state.aicomponent/SKILL.md +54 -0
- package/skills/run_context_state.aicomponent/manifest.json +40 -0
- package/skills/run_context_state.aicomponent/ref/RunContextRuntime.ts +30 -0
- package/skills/score-fly.aicomponent/SKILL.md +31 -0
- package/skills/score-fly.aicomponent/manifest.json +21 -0
- package/skills/score-fly.aicomponent/ref/phaser.js +26 -0
- package/skills/score-fly.aicomponent/ref/playcanvas.js +28 -0
- package/skills/score_goal.aiconfig/SKILL.md +46 -0
- package/skills/score_goal.aiconfig/manifest.json +33 -0
- package/skills/screen-flash.aicomponent/SKILL.md +30 -0
- package/skills/screen-flash.aicomponent/manifest.json +20 -0
- package/skills/screen-flash.aicomponent/ref/phaser.js +48 -0
- package/skills/screen-shake.aicomponent/SKILL.md +30 -0
- package/skills/screen-shake.aicomponent/manifest.json +19 -0
- package/skills/screen-shake.aicomponent/ref/phaser.js +23 -0
- package/skills/screen-shake.aicomponent/ref/playcanvas.js +44 -0
- package/skills/screw_puzzle.aigameplay/SKILL.md +116 -0
- package/skills/screw_puzzle.aigameplay/manifest.json +164 -0
- package/skills/screw_puzzle.aigameplay/ref/pgs-schema.json +235 -0
- package/skills/screw_puzzle.aigameplay/ref/reducer.template.ts +213 -0
- package/skills/settings_state.aicomponent/SKILL.md +61 -0
- package/skills/settings_state.aicomponent/manifest.json +33 -0
- package/skills/settings_state.aicomponent/ref/SettingsManager.ts +130 -0
- package/skills/slide_out_to_tray_animation.aicomponent/SKILL.md +64 -0
- package/skills/slide_out_to_tray_animation.aicomponent/manifest.json +58 -0
- package/skills/slide_out_to_tray_animation.aicomponent/ref/AnimationManager.ts +164 -0
- package/skills/slide_out_to_tray_animation.aicomponent/ref/AnimationManager3D.ts +198 -0
- package/skills/slide_out_to_tray_animation.aicomponent/ref/BezierUtils.ts +59 -0
- package/skills/slot_machine.aigameplay/SKILL.md +119 -0
- package/skills/slot_machine.aigameplay/manifest.json +166 -0
- package/skills/slot_machine.aigameplay/ref/pgs-schema.json +212 -0
- package/skills/slot_machine.aigameplay/ref/reducer.template.ts +212 -0
- package/skills/sniper_shot.aigameplay/SKILL.md +84 -0
- package/skills/sniper_shot.aigameplay/manifest.json +153 -0
- package/skills/sniper_shot.aigameplay/ref/pgs-schema.json +211 -0
- package/skills/sniper_shot.aigameplay/ref/reducer.template.ts +211 -0
- package/skills/solitaire.aigameplay/SKILL.md +101 -0
- package/skills/solitaire.aigameplay/manifest.json +151 -0
- package/skills/solitaire.aigameplay/ref/pgs-schema.json +200 -0
- package/skills/solitaire.aigameplay/ref/reducer.template.ts +176 -0
- package/skills/sound-effects/SKILL.md +46 -0
- package/skills/sound_utils.aicomponent/SKILL.md +52 -0
- package/skills/sound_utils.aicomponent/manifest.json +30 -0
- package/skills/sound_utils.aicomponent/ref/SoundUtils.ts +29 -0
- package/skills/sprite-animation-2d.aicomponent/SKILL.md +45 -0
- package/skills/sprite-animation-2d.aicomponent/manifest.json +28 -0
- package/skills/sprite-animation-2d.aicomponent/ref/html5.js +83 -0
- package/skills/sprite-animation-2d.aicomponent/ref/phaser.js +38 -0
- package/skills/sprite-animation-2d.aicomponent/ref/playcanvas.js +67 -0
- package/skills/sprite_entity_renderer.aicomponent/SKILL.md +148 -0
- package/skills/sprite_entity_renderer.aicomponent/manifest.json +17 -0
- package/skills/sprite_entity_renderer.aicomponent/ref/SpriteEntityRenderer.ts +126 -0
- package/skills/success_sfx.aiaudio/SKILL.md +59 -0
- package/skills/success_sfx.aiaudio/manifest.json +45 -0
- package/skills/success_sfx.aiaudio/ref/success.mp3 +0 -0
- package/skills/tap_blast.aigameplay/SKILL.md +116 -0
- package/skills/tap_blast.aigameplay/manifest.json +153 -0
- package/skills/tap_blast.aigameplay/ref/pgs-schema.json +208 -0
- package/skills/tap_blast.aigameplay/ref/reducer.template.ts +202 -0
- package/skills/theme_state.aicomponent/SKILL.md +53 -0
- package/skills/theme_state.aicomponent/manifest.json +33 -0
- package/skills/theme_state.aicomponent/ref/ThemeManager.ts +174 -0
- package/skills/theme_switcher_build.aicomponent/SKILL.md +62 -0
- package/skills/theme_switcher_build.aicomponent/manifest.json +38 -0
- package/skills/theme_switcher_build.aicomponent/ref/theme-index.ts +8 -0
- package/skills/theme_variant.aiconfig/SKILL.md +78 -0
- package/skills/theme_variant.aiconfig/manifest.json +39 -0
- package/skills/theme_variant.aiconfig/ref/ExampleTheme/index.ts +16 -0
- package/skills/theme_variant.aiconfig/ref/ExampleTheme/levelEasy.json +141 -0
- package/skills/threejs.aicomponent/SKILL.md +422 -0
- package/skills/threejs.aicomponent/manifest.json +166 -0
- package/skills/threejs.aicomponent/ref/AssetLoader.ts +158 -0
- package/skills/threejs.aicomponent/ref/BaseScene.ts +88 -0
- package/skills/threejs.aicomponent/ref/GameConfig.ts +47 -0
- package/skills/threejs.aicomponent/ref/MainScene.ts +170 -0
- package/skills/threejs.aicomponent/ref/PreloaderScene.ts +93 -0
- package/skills/threejs.aicomponent/ref/SceneKeys.ts +6 -0
- package/skills/threejs.aicomponent/ref/SceneManager.ts +69 -0
- package/skills/threejs.aicomponent/ref/ViewportManager.ts +62 -0
- package/skills/threejs.aicomponent/ref/globals.d.ts +74 -0
- package/skills/threejs.aicomponent/ref/index.css +80 -0
- package/skills/threejs.aicomponent/ref/index.html +20 -0
- package/skills/threejs.aicomponent/ref/index.ts +117 -0
- package/skills/threejs.aicomponent/ref/main.ts +10 -0
- package/skills/threejs.aicomponent/ref/package.json +23 -0
- package/skills/threejs.aicomponent/ref/tsconfig.json +24 -0
- package/skills/threejs.aicomponent/ref/webpack.config.js +61 -0
- package/skills/time_clear_goal.aiconfig/SKILL.md +46 -0
- package/skills/time_clear_goal.aiconfig/manifest.json +32 -0
- package/skills/time_icon.aiimage/SKILL.md +58 -0
- package/skills/time_icon.aiimage/manifest.json +47 -0
- package/skills/time_icon.aiimage/ref/time.png +0 -0
- package/skills/time_icon.aiimage/ref/time.webp +0 -0
- package/skills/top_ui_bar.aicomponent/SKILL.md +45 -0
- package/skills/top_ui_bar.aicomponent/manifest.json +27 -0
- package/skills/top_ui_bar.aicomponent/ref/GameTopUI.ts +229 -0
- package/skills/tower_defence.aigameplay/SKILL.md +117 -0
- package/skills/tower_defence.aigameplay/manifest.json +175 -0
- package/skills/tower_defence.aigameplay/ref/pgs-schema.json +247 -0
- package/skills/tower_defence.aigameplay/ref/reducer.template.ts +239 -0
- package/skills/tray_container.aicomponent/SKILL.md +143 -0
- package/skills/tray_container.aicomponent/manifest.json +58 -0
- package/skills/tray_container.aicomponent/ref/TrayRenderer.ts +155 -0
- package/skills/tray_container.aicomponent/ref/TrayRenderer3D.ts +281 -0
- package/skills/tray_container.aicomponent/ref/TrayRendererHtmlOverlay.ts +228 -0
- package/skills/tutorial_overlay.aicomponent/SKILL.md +46 -0
- package/skills/tutorial_overlay.aicomponent/manifest.json +34 -0
- package/skills/tutorial_overlay.aicomponent/ref/TutorialManager.ts +367 -0
- package/skills/tween-animation-2d.aicomponent/SKILL.md +35 -0
- package/skills/tween-animation-2d.aicomponent/manifest.json +28 -0
- package/skills/tween-animation-2d.aicomponent/ref/phaser.js +49 -0
- package/skills/tween-animation-2d.aicomponent/ref/playcanvas.js +36 -0
- package/skills/typescript_module_patterns.aicomponent/SKILL.md +209 -0
- package/skills/typescript_module_patterns.aicomponent/manifest.json +28 -0
- package/skills/typescript_module_patterns.aicomponent/ref/globals.d.ts +31 -0
- package/skills/ui-transition.aicomponent/SKILL.md +33 -0
- package/skills/ui-transition.aicomponent/manifest.json +19 -0
- package/skills/ui-transition.aicomponent/ref/phaser.js +45 -0
- package/skills/ux_flow_spec.aiconfig/SKILL.md +82 -0
- package/skills/ux_flow_spec.aiconfig/manifest.json +39 -0
- package/skills/wave_difficulty.aiconfig/SKILL.md +46 -0
- package/skills/wave_difficulty.aiconfig/manifest.json +33 -0
- package/skills/webpack_build.aicomponent/SKILL.md +204 -0
- package/skills/webpack_build.aicomponent/manifest.json +29 -0
- package/skills/webpack_build.aicomponent/ref/package.json +16 -0
- package/skills/webpack_build.aicomponent/ref/webpack.config.js +53 -0
- package/skills/win_anim_sfx.aiaudio/SKILL.md +59 -0
- package/skills/win_anim_sfx.aiaudio/manifest.json +46 -0
- package/skills/win_anim_sfx.aiaudio/ref/win_anim.mp3 +0 -0
- package/skills/win_dot.aiimage/SKILL.md +58 -0
- package/skills/win_dot.aiimage/manifest.json +47 -0
- package/skills/win_dot.aiimage/ref/win_dot.png +0 -0
- package/skills/win_dot.aiimage/ref/win_dot.webp +0 -0
- package/skills/win_result_panel.aiimage/SKILL.md +58 -0
- package/skills/win_result_panel.aiimage/manifest.json +47 -0
- package/skills/win_result_panel.aiimage/ref/win.png +0 -0
- package/skills/win_result_panel.aiimage/ref/win.webp +0 -0
- package/skills/word_connect.aigameplay/SKILL.md +86 -0
- package/skills/word_connect.aigameplay/manifest.json +154 -0
- package/skills/word_connect.aigameplay/ref/pgs-schema.json +212 -0
- package/skills/word_connect.aigameplay/ref/reducer.template.ts +186 -0
- package/src/index.ts +10 -0
- package/src/skills.loader.ts +225 -0
- package/src/skills.types.ts +42 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"atomId": "button_click_sfx.aiaudio",
|
|
4
|
+
"bundleType": "aiaudio",
|
|
5
|
+
"category": "audio",
|
|
6
|
+
"mode": "generative",
|
|
7
|
+
"label": {
|
|
8
|
+
"zh": "按钮点击音效",
|
|
9
|
+
"en": "Button click SFX"
|
|
10
|
+
},
|
|
11
|
+
"tags": [
|
|
12
|
+
"audio",
|
|
13
|
+
"sfx",
|
|
14
|
+
"button",
|
|
15
|
+
"click",
|
|
16
|
+
"ui"
|
|
17
|
+
],
|
|
18
|
+
"bindingRoles": [
|
|
19
|
+
"sfxButtonClick"
|
|
20
|
+
],
|
|
21
|
+
"generation": {
|
|
22
|
+
"kind": "sfx",
|
|
23
|
+
"prompt": "clean button tap sound for UI buttons in mobile game",
|
|
24
|
+
"duration": 1,
|
|
25
|
+
"loop": false,
|
|
26
|
+
"referenceAudio": "ref/button_click.mp3",
|
|
27
|
+
"platformSkill": "playcraft-audio-generation"
|
|
28
|
+
},
|
|
29
|
+
"result": {
|
|
30
|
+
"outputFile": "ref/button_click.mp3",
|
|
31
|
+
"format": "mp3",
|
|
32
|
+
"constraints": {
|
|
33
|
+
"maxDuration": 1
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"binding": {
|
|
37
|
+
"role": "sfxButtonClick",
|
|
38
|
+
"target": "assets/sounds/button_click.mp3",
|
|
39
|
+
"type": "audio-asset-reference"
|
|
40
|
+
},
|
|
41
|
+
"files": {
|
|
42
|
+
"skill": "SKILL.md",
|
|
43
|
+
"asset": "ref/button_click.mp3"
|
|
44
|
+
}
|
|
45
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: calm_piano.aiaudio
|
|
3
|
+
description: 舒缓钢琴 BGM 封包 - 平静柔和的钢琴循环背景音乐,适合文字解谜、拉针解谜等需要专注氛围的游戏
|
|
4
|
+
triggers: 背景音乐,bgm,舒缓,calm,钢琴,piano,放松,relaxing,平静,gentle,ambient
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# calm_piano.aiaudio
|
|
8
|
+
|
|
9
|
+
舒缓钢琴 BGM 封包。提供平静专注的音乐氛围,适合文字解谜、数字合成、分类排序等需要玩家思考的玩法。
|
|
10
|
+
|
|
11
|
+
## Recipe
|
|
12
|
+
|
|
13
|
+
- **基础 prompt**:`gentle calming piano melody loop, soft ambient background music for mobile game, peaceful atmosphere, 80 BPM`
|
|
14
|
+
- **时长**:30 秒(循环)
|
|
15
|
+
- **BPM**:约 80
|
|
16
|
+
- **风格**:舒缓、环境音乐、空灵
|
|
17
|
+
- **可 fork 变体**:
|
|
18
|
+
- 加弦乐:加入 cello 或 violin 伴奏
|
|
19
|
+
- 爵士风:更多 jazz chord 进行
|
|
20
|
+
- 冥想风:更低 BPM,加入自然环境音
|
|
21
|
+
|
|
22
|
+
**生成步骤:**
|
|
23
|
+
1. 调用音频生成 API,传入 prompt 和 30s 时长
|
|
24
|
+
2. 验证时长并检查循环无缝衔接
|
|
25
|
+
3. 写入 `audio.mp3`,更新 manifest
|
|
26
|
+
|
|
27
|
+
## Result
|
|
28
|
+
|
|
29
|
+
- **产物文件**:`audio.mp3`
|
|
30
|
+
- **格式**:MP3,15-60 秒循环
|
|
31
|
+
|
|
32
|
+
## Binding
|
|
33
|
+
|
|
34
|
+
- **Binding Role**:`backgroundMusic`
|
|
35
|
+
- **挂载目标**:`scene://entities/AudioManager/bgm/asset`
|
|
36
|
+
- **引用类型**:`audio-asset-reference`
|
|
37
|
+
- **播放模式**:loop
|
|
38
|
+
|
|
39
|
+
## 生成方式
|
|
40
|
+
|
|
41
|
+
Platform Skill: `playcraft-audio-generation`
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
# 1. 生成 BGM(Google Lyria 3,固定 30s)
|
|
45
|
+
playcraft tools generate-bgm \
|
|
46
|
+
--prompt "gentle calming piano melody loop, soft ambient background music for mobile game, peaceful atmosphere, 80 BPM" \
|
|
47
|
+
--style ambient \
|
|
48
|
+
--bpm 80 \
|
|
49
|
+
--output ta-workspace/raw_bgm.mp3
|
|
50
|
+
|
|
51
|
+
# 2. 处理无缝循环 + 归一化
|
|
52
|
+
playcraft audio loop --input ta-workspace/raw_bgm.mp3 --output ta-workspace/bgm_loop.mp3 --crossfade 0.5
|
|
53
|
+
playcraft audio normalize --input ta-workspace/bgm_loop.mp3 --output ta-workspace/bgm_loop.mp3 --target-loudness -16
|
|
54
|
+
|
|
55
|
+
# 3. 压缩至体积预算(Facebook 可玩广告 BGM 目标 ≤60KB)
|
|
56
|
+
playcraft audio compress --input ta-workspace/bgm_loop.mp3 --output ta-workspace/asset --target-size 60KB
|
|
57
|
+
|
|
58
|
+
# 4. 将产物写入 sandbox 对应路径(见 binding.target)
|
|
59
|
+
```
|
|
60
|
+
## Skill Definition
|
|
61
|
+
|
|
62
|
+
tools:
|
|
63
|
+
- bash
|
|
64
|
+
- write
|
|
65
|
+
- read
|
|
66
|
+
prompt_extension: |
|
|
67
|
+
You are generating a calm piano BGM for a puzzle or word game.
|
|
68
|
+
Follow the Recipe to generate a soft, loop-ready piano track. Apply the Binding.
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"atomId": "calm_piano.aiaudio",
|
|
4
|
+
"bundleType": "aiaudio",
|
|
5
|
+
"category": "audio",
|
|
6
|
+
"mode": "generative",
|
|
7
|
+
"label": {
|
|
8
|
+
"zh": "舒缓钢琴 BGM",
|
|
9
|
+
"en": "Calm piano BGM"
|
|
10
|
+
},
|
|
11
|
+
"tags": [
|
|
12
|
+
"audio",
|
|
13
|
+
"bgm",
|
|
14
|
+
"music",
|
|
15
|
+
"calm",
|
|
16
|
+
"piano",
|
|
17
|
+
"relaxing",
|
|
18
|
+
"loop",
|
|
19
|
+
"gentle"
|
|
20
|
+
],
|
|
21
|
+
"bindingRoles": ["bgMusic"],
|
|
22
|
+
"generation": {
|
|
23
|
+
"kind": "bgm",
|
|
24
|
+
"prompt": "gentle calming piano melody loop, soft ambient background music for mobile game, peaceful atmosphere, 80 BPM",
|
|
25
|
+
"duration": 30,
|
|
26
|
+
"loop": true,
|
|
27
|
+
"platformSkill": "playcraft-audio-generation",
|
|
28
|
+
"bgmStyle": "ambient",
|
|
29
|
+
"bpm": 80
|
|
30
|
+
},
|
|
31
|
+
"result": {
|
|
32
|
+
"outputFile": "audio.mp3",
|
|
33
|
+
"format": "mp3",
|
|
34
|
+
"constraints": {
|
|
35
|
+
"minDuration": 15,
|
|
36
|
+
"maxDuration": 60
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"binding": {
|
|
40
|
+
"role": "backgroundMusic",
|
|
41
|
+
"target": "scene://entities/AudioManager/bgm/asset",
|
|
42
|
+
"type": "audio-asset-reference",
|
|
43
|
+
"constraints": {
|
|
44
|
+
"playMode": "loop"
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
"files": {
|
|
48
|
+
"skill": "SKILL.md"
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: camera_controller_3d.aicomponent
|
|
3
|
+
description: 3D 相机控制器,专为棋盘/拼图类游戏设计。支持自动棋盘俯瞰、平滑过渡、屏幕震动、多种视角模式。
|
|
4
|
+
triggers: 需要在 Three.js 3D 场景中管理相机位置/角度/视锥,或需要棋盘俯瞰/震动/过渡动画时触发。
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 3D 相机控制器(3D Camera Controller)
|
|
8
|
+
|
|
9
|
+
## 说明
|
|
10
|
+
|
|
11
|
+
本 skill 是 Three.js 3D 项目独有的组件(2D Phaser 无等价概念)。提供棋盘类游戏所需的相机管理:
|
|
12
|
+
|
|
13
|
+
- **自动棋盘俯瞰**:根据 rows/cols/cellSize 计算最优相机位置,确保棋盘完整可见
|
|
14
|
+
- **视角模式**:top-down-fixed / isometric-45 / orbit-debug
|
|
15
|
+
- **屏幕震动**:推出失败/阻挡时的反馈
|
|
16
|
+
- **平滑过渡**:关卡切换时的相机动画
|
|
17
|
+
|
|
18
|
+
## Scaffold
|
|
19
|
+
|
|
20
|
+
| 目标路径 | 来源 | 说明 |
|
|
21
|
+
|---------|-----|------|
|
|
22
|
+
| `src/game/utils/CameraController.ts` | `ref/CameraController.ts` | 相机控制器 |
|
|
23
|
+
|
|
24
|
+
## Imports
|
|
25
|
+
|
|
26
|
+
- `threejs.aicomponent`(硬依赖)
|
|
27
|
+
|
|
28
|
+
## Recipe
|
|
29
|
+
|
|
30
|
+
| 决策 | 原因 |
|
|
31
|
+
|------|------|
|
|
32
|
+
| **setupForBoard 自动计算** | 手动计算相机距离以使棋盘完整可见涉及 FOV + 三角函数;封装成一次调用,消除每个关卡都需要手动调参的工作 |
|
|
33
|
+
| **震动在原始位置叠加随机偏移** | 不修改 base position,震动结束后自然回到原位;避免震动后相机位移的 bug |
|
|
34
|
+
| **`update()` 每帧调用模式** | 使用 lerp/smoothstep 实现过渡动画,需要每帧推进;比 Tween 库更可控,支持动画途中中断或叠加 |
|
|
35
|
+
| **orbit-debug 模式** | 开发时可自由旋转检查 3D 场景;`enableOrbitControls: false` 从 `threejs.aicomponent` 主配置关闭不影响此控制器 |
|
|
36
|
+
|
|
37
|
+
## Adapter
|
|
38
|
+
|
|
39
|
+
- **Role**: `cameraController3D` — Three.js 棋盘俯瞰相机控制器(自动定位 + 震动 + 过渡动画)
|
|
40
|
+
- **Provides**: `CameraController` 类(`setupForBoard()`、`shake()`、`transitionTo()`、`update(dt)`)
|
|
41
|
+
- **Requires**: `threejs.aicomponent`(THREE.Camera API)
|
|
42
|
+
- **Consumed by**: 3D 模式的 `game_scene.aicomponent` 或自定义 BaseScene 子类(在 `onInit()` 初始化,`onUpdate()` 中每帧调用 `update(dt)`)
|
|
43
|
+
- **Integration point**: `src/game/utils/CameraController.ts` → BaseScene 子类的 `protected onInit()` 中实例化
|
|
44
|
+
|
|
45
|
+
## 使用示例
|
|
46
|
+
|
|
47
|
+
```typescript
|
|
48
|
+
import { CameraController } from "../utils/CameraController";
|
|
49
|
+
import * as THREE from "three";
|
|
50
|
+
|
|
51
|
+
// 在 BaseScene 子类中
|
|
52
|
+
protected onInit(): void {
|
|
53
|
+
this.cameraCtrl = new CameraController(this._camera!, "top-down-fixed");
|
|
54
|
+
|
|
55
|
+
// 自动定位相机使棋盘完整可见
|
|
56
|
+
this.cameraCtrl.setupForBoard(level.rows, level.cols, cellSize);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// 推出失败时震动
|
|
60
|
+
this.cameraCtrl.shake(0.15, 300);
|
|
61
|
+
|
|
62
|
+
// 关卡切换过渡
|
|
63
|
+
this.cameraCtrl.transitionTo(
|
|
64
|
+
new THREE.Vector3(newX, newY, newZ),
|
|
65
|
+
new THREE.Vector3(lookX, 0, lookZ),
|
|
66
|
+
800 // 毫秒
|
|
67
|
+
);
|
|
68
|
+
|
|
69
|
+
// 每帧更新(处理震动和过渡动画)
|
|
70
|
+
protected onUpdate(dt: number): void {
|
|
71
|
+
this.cameraCtrl.update(dt);
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## 相机模式
|
|
76
|
+
|
|
77
|
+
| 模式 | 视角 | 适用场景 |
|
|
78
|
+
|------|------|---------|
|
|
79
|
+
| `top-down-fixed` | 60° 俯瞰 | 拼图/三消游戏(推荐) |
|
|
80
|
+
| `isometric-45` | 45° 等距视角 | 策略/建造类 |
|
|
81
|
+
| `orbit-debug` | 自由轨道(OrbitControls) | 开发调试 |
|
|
82
|
+
|
|
83
|
+
## 关键设计
|
|
84
|
+
|
|
85
|
+
- **setupForBoard()** 使用 FOV 和三角函数计算相机距离:`distance = (maxDim / 2) / tan(fov / 2) * margin`
|
|
86
|
+
- **shake()** 通过在原始位置上叠加随机偏移实现,不影响 base position
|
|
87
|
+
- **transitionTo()** 使用 smoothstep lerp 插值 position + lookAt 目标
|
|
88
|
+
- **update()** 每帧调用,处理震动衰减和过渡进度
|
|
89
|
+
|
|
90
|
+
## Skill Definition
|
|
91
|
+
|
|
92
|
+
```yaml
|
|
93
|
+
tools:
|
|
94
|
+
- read_file
|
|
95
|
+
- write_file
|
|
96
|
+
inputs:
|
|
97
|
+
- source: ref/CameraController.ts
|
|
98
|
+
outputs:
|
|
99
|
+
- cameraController: CameraController class with setupForBoard/shake/transitionTo/update
|
|
100
|
+
```
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"atomId": "camera_controller_3d.aicomponent",
|
|
4
|
+
"bundleType": "aicomponent",
|
|
5
|
+
"category": "component",
|
|
6
|
+
"mode": "fixed",
|
|
7
|
+
"label": { "zh": "3D 相机控制器", "en": "3D Camera Controller" },
|
|
8
|
+
"tags": ["camera", "3d", "threejs", "isometric", "top-down", "follow", "shake", "transition", "puzzle-view"],
|
|
9
|
+
"bindingRoles": ["cameraController"],
|
|
10
|
+
"scaffold": {
|
|
11
|
+
"files": {
|
|
12
|
+
"src/game/utils/CameraController.ts": {
|
|
13
|
+
"source": "ref/CameraController.ts",
|
|
14
|
+
"mode": "full",
|
|
15
|
+
"weight": 10,
|
|
16
|
+
"_comment": "3D 相机控制器:棋盘俯瞰、震动、过渡动画"
|
|
17
|
+
},
|
|
18
|
+
"src/game/utils/OrbitControlsAdapter.ts": {
|
|
19
|
+
"source": "ref/OrbitControlsAdapter.ts",
|
|
20
|
+
"mode": "full",
|
|
21
|
+
"weight": 8,
|
|
22
|
+
"_comment": "OrbitControls 封装:拖动旋转/缩放/平移,与 CameraController 协同"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"imports": [
|
|
27
|
+
{ "slot": "engine", "pinAtomId": "threejs.aicomponent", "edgeKind": "requires", "bindAs": "engine" }
|
|
28
|
+
],
|
|
29
|
+
"exports": [
|
|
30
|
+
{ "name": "CameraController", "kind": "class", "location": "src/game/utils/CameraController.ts" },
|
|
31
|
+
{ "name": "CameraMode", "kind": "type", "location": "src/game/utils/CameraController.ts" },
|
|
32
|
+
{ "name": "OrbitControlsAdapter", "kind": "class", "location": "src/game/utils/OrbitControlsAdapter.ts" },
|
|
33
|
+
{ "name": "OrbitConfig", "kind": "interface", "location": "src/game/utils/OrbitControlsAdapter.ts" }
|
|
34
|
+
],
|
|
35
|
+
"neutralDescriptor": {
|
|
36
|
+
"geometry": "3D camera controller for board/puzzle games: auto-framing grid boards, smooth transitions, screen shake, multiple viewing modes (top-down, isometric, orbit-debug)",
|
|
37
|
+
"layers": ["camera-positioning", "animation", "screen-effects"],
|
|
38
|
+
"replaceable": ["camera mode", "tilt angle", "shake intensity", "transition easing", "FOV"]
|
|
39
|
+
},
|
|
40
|
+
"usageHints": [
|
|
41
|
+
"setupForBoard(rows, cols, cellSize) 自动计算相机位置和角度使棋盘完整可见",
|
|
42
|
+
"支持三种模式:top-down-fixed(俯视)、isometric-45(45°等距)、orbit-debug(自由轨道)",
|
|
43
|
+
"shake(intensity, duration) 提供推出/阻挡时的相机震动反馈",
|
|
44
|
+
"transitionTo(position, lookAt, duration) 支持关卡切换时的平滑相机过渡",
|
|
45
|
+
"游戏模式下自动禁用 OrbitControls,调试模式下可开启"
|
|
46
|
+
],
|
|
47
|
+
"files": {
|
|
48
|
+
"skill": "SKILL.md",
|
|
49
|
+
"cameraController": "ref/CameraController.ts",
|
|
50
|
+
"orbitControlsAdapter": "ref/OrbitControlsAdapter.ts"
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import * as THREE from "three";
|
|
2
|
+
|
|
3
|
+
export type CameraMode = "top-down-fixed" | "isometric-45" | "orbit-debug";
|
|
4
|
+
|
|
5
|
+
export interface CameraTransition {
|
|
6
|
+
startPos: THREE.Vector3;
|
|
7
|
+
endPos: THREE.Vector3;
|
|
8
|
+
startLookAt: THREE.Vector3;
|
|
9
|
+
endLookAt: THREE.Vector3;
|
|
10
|
+
duration: number;
|
|
11
|
+
elapsed: number;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* 3D 相机控制器
|
|
16
|
+
* 专为棋盘/拼图类游戏设计,支持自动俯瞰定位、震动、平滑过渡
|
|
17
|
+
*/
|
|
18
|
+
export class CameraController {
|
|
19
|
+
private camera: THREE.PerspectiveCamera;
|
|
20
|
+
private mode: CameraMode;
|
|
21
|
+
|
|
22
|
+
// 基础位置(未加震动偏移的原始位置)
|
|
23
|
+
private basePosition = new THREE.Vector3();
|
|
24
|
+
private baseLookAt = new THREE.Vector3();
|
|
25
|
+
|
|
26
|
+
// 震动状态
|
|
27
|
+
private shakeIntensity = 0;
|
|
28
|
+
private shakeDuration = 0;
|
|
29
|
+
private shakeElapsed = 0;
|
|
30
|
+
private shakeOffset = new THREE.Vector3();
|
|
31
|
+
|
|
32
|
+
// 过渡状态
|
|
33
|
+
private transition: CameraTransition | null = null;
|
|
34
|
+
|
|
35
|
+
constructor(camera: THREE.PerspectiveCamera, mode: CameraMode = "top-down-fixed") {
|
|
36
|
+
this.camera = camera;
|
|
37
|
+
this.mode = mode;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* 根据棋盘尺寸自动定位相机使棋盘完整可见。
|
|
42
|
+
* @param rows 棋盘行数
|
|
43
|
+
* @param cols 棋盘列数
|
|
44
|
+
* @param cellSize 格子世界单位大小
|
|
45
|
+
*/
|
|
46
|
+
setupForBoard(rows: number, cols: number, cellSize: number): void {
|
|
47
|
+
const boardWidth = cols * cellSize;
|
|
48
|
+
const boardHeight = rows * cellSize;
|
|
49
|
+
const centerX = boardWidth / 2;
|
|
50
|
+
const centerZ = boardHeight / 2;
|
|
51
|
+
|
|
52
|
+
const maxDim = Math.max(boardWidth, boardHeight);
|
|
53
|
+
const fovRad = (this.camera.fov * Math.PI) / 180;
|
|
54
|
+
// 留 20% 边距确保棋盘不贴边
|
|
55
|
+
const margin = 1.2;
|
|
56
|
+
|
|
57
|
+
switch (this.mode) {
|
|
58
|
+
case "top-down-fixed": {
|
|
59
|
+
// 60° 俯瞰(略微前倾,增加透视感)
|
|
60
|
+
const distance = (maxDim / 2) / Math.tan(fovRad / 2) * margin;
|
|
61
|
+
const tiltFactor = 0.3;
|
|
62
|
+
this.basePosition.set(
|
|
63
|
+
centerX,
|
|
64
|
+
distance,
|
|
65
|
+
centerZ + distance * tiltFactor
|
|
66
|
+
);
|
|
67
|
+
this.baseLookAt.set(centerX, 0, centerZ);
|
|
68
|
+
break;
|
|
69
|
+
}
|
|
70
|
+
case "isometric-45": {
|
|
71
|
+
// 45° 等距视角
|
|
72
|
+
const distance = (maxDim / 2) / Math.tan(fovRad / 2) * margin;
|
|
73
|
+
const angle45 = Math.PI / 4;
|
|
74
|
+
this.basePosition.set(
|
|
75
|
+
centerX + distance * Math.sin(angle45) * 0.5,
|
|
76
|
+
distance * Math.cos(angle45),
|
|
77
|
+
centerZ + distance * Math.sin(angle45)
|
|
78
|
+
);
|
|
79
|
+
this.baseLookAt.set(centerX, 0, centerZ);
|
|
80
|
+
break;
|
|
81
|
+
}
|
|
82
|
+
case "orbit-debug": {
|
|
83
|
+
// 调试模式:保持当前位置,只更新 lookAt
|
|
84
|
+
this.basePosition.copy(this.camera.position);
|
|
85
|
+
this.baseLookAt.set(centerX, 0, centerZ);
|
|
86
|
+
break;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
this.applyCamera();
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* 触发相机震动效果。
|
|
95
|
+
* @param intensity 震动强度(世界单位,推荐 0.05~0.3)
|
|
96
|
+
* @param duration 震动持续时间(毫秒)
|
|
97
|
+
*/
|
|
98
|
+
shake(intensity: number = 0.1, duration: number = 200): void {
|
|
99
|
+
this.shakeIntensity = intensity;
|
|
100
|
+
this.shakeDuration = duration / 1000; // 转为秒
|
|
101
|
+
this.shakeElapsed = 0;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* 启动相机平滑过渡到新位置。
|
|
106
|
+
* @param position 目标位置
|
|
107
|
+
* @param lookAt 目标注视点
|
|
108
|
+
* @param duration 过渡时间(毫秒)
|
|
109
|
+
*/
|
|
110
|
+
transitionTo(position: THREE.Vector3, lookAt: THREE.Vector3, duration: number): void {
|
|
111
|
+
this.transition = {
|
|
112
|
+
startPos: this.basePosition.clone(),
|
|
113
|
+
endPos: position.clone(),
|
|
114
|
+
startLookAt: this.baseLookAt.clone(),
|
|
115
|
+
endLookAt: lookAt.clone(),
|
|
116
|
+
duration: duration / 1000,
|
|
117
|
+
elapsed: 0,
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* 每帧更新。处理震动衰减和过渡动画。
|
|
123
|
+
* @param dt 帧间隔时间(秒)
|
|
124
|
+
*/
|
|
125
|
+
update(dt: number): void {
|
|
126
|
+
let dirty = false;
|
|
127
|
+
|
|
128
|
+
// 更新过渡
|
|
129
|
+
if (this.transition) {
|
|
130
|
+
this.transition.elapsed += dt;
|
|
131
|
+
const t = Math.min(this.transition.elapsed / this.transition.duration, 1);
|
|
132
|
+
// smoothstep easing
|
|
133
|
+
const ease = t * t * (3 - 2 * t);
|
|
134
|
+
|
|
135
|
+
this.basePosition.lerpVectors(this.transition.startPos, this.transition.endPos, ease);
|
|
136
|
+
this.baseLookAt.lerpVectors(this.transition.startLookAt, this.transition.endLookAt, ease);
|
|
137
|
+
|
|
138
|
+
if (t >= 1) {
|
|
139
|
+
this.transition = null;
|
|
140
|
+
}
|
|
141
|
+
dirty = true;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
// 更新震动
|
|
145
|
+
if (this.shakeElapsed < this.shakeDuration) {
|
|
146
|
+
this.shakeElapsed += dt;
|
|
147
|
+
const progress = this.shakeElapsed / this.shakeDuration;
|
|
148
|
+
// 线性衰减
|
|
149
|
+
const decay = 1 - progress;
|
|
150
|
+
const intensity = this.shakeIntensity * decay;
|
|
151
|
+
|
|
152
|
+
this.shakeOffset.set(
|
|
153
|
+
(Math.random() - 0.5) * 2 * intensity,
|
|
154
|
+
(Math.random() - 0.5) * 2 * intensity * 0.5, // Y 方向震动较小
|
|
155
|
+
(Math.random() - 0.5) * 2 * intensity
|
|
156
|
+
);
|
|
157
|
+
dirty = true;
|
|
158
|
+
} else if (this.shakeOffset.lengthSq() > 0) {
|
|
159
|
+
this.shakeOffset.set(0, 0, 0);
|
|
160
|
+
dirty = true;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
if (dirty) {
|
|
164
|
+
this.applyCamera();
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/** 获取当前模式 */
|
|
169
|
+
getMode(): CameraMode {
|
|
170
|
+
return this.mode;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/** 切换相机模式 */
|
|
174
|
+
setMode(mode: CameraMode): void {
|
|
175
|
+
this.mode = mode;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/** 获取当前相机注视点 */
|
|
179
|
+
getLookAt(): THREE.Vector3 {
|
|
180
|
+
return this.baseLookAt.clone();
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/** 判断是否正在过渡中 */
|
|
184
|
+
isTransitioning(): boolean {
|
|
185
|
+
return this.transition !== null;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/** 获取基础位置(不含震动偏移) */
|
|
189
|
+
getBasePosition(): THREE.Vector3 {
|
|
190
|
+
return this.basePosition.clone();
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
// ── 内部方法 ──
|
|
194
|
+
|
|
195
|
+
private applyCamera(): void {
|
|
196
|
+
this.camera.position.copy(this.basePosition).add(this.shakeOffset);
|
|
197
|
+
this.camera.lookAt(this.baseLookAt);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import * as THREE from "three";
|
|
2
|
+
import { OrbitControls } from "three/examples/jsm/controls/OrbitControls.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* OrbitControls 适配器
|
|
6
|
+
*
|
|
7
|
+
* 封装 Three.js OrbitControls 的初始化和常用配置,
|
|
8
|
+
* 专为棋盘/拼图类 3D 游戏设计:
|
|
9
|
+
* - 拖拽旋转视角(限制极角防止穿地)
|
|
10
|
+
* - 滚轮/pinch 缩放(限制距离范围)
|
|
11
|
+
* - 可选平移
|
|
12
|
+
* - 阻尼平滑
|
|
13
|
+
*
|
|
14
|
+
* 与 CameraController 协同使用:
|
|
15
|
+
* - CameraController 负责 setupForBoard(初始定位)+ shake + transition
|
|
16
|
+
* - OrbitControlsAdapter 负责用户交互旋转/缩放
|
|
17
|
+
* - 两者共享同一个 camera 实例
|
|
18
|
+
*
|
|
19
|
+
* 注意:启用 OrbitControls 后,CameraController 的 setupForBoard
|
|
20
|
+
* 不再直接控制 camera(因为 OrbitControls 会覆盖 camera.position)。
|
|
21
|
+
* 应改为设置 OrbitControlsAdapter.setTarget() 来调整视角中心。
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
export interface OrbitConfig {
|
|
25
|
+
/** 启用惯性阻尼(默认 true) */
|
|
26
|
+
enableDamping?: boolean;
|
|
27
|
+
/** 阻尼系数(默认 0.1) */
|
|
28
|
+
dampingFactor?: number;
|
|
29
|
+
/** 启用平移(默认 true) */
|
|
30
|
+
enablePan?: boolean;
|
|
31
|
+
/** 启用缩放(默认 true) */
|
|
32
|
+
enableZoom?: boolean;
|
|
33
|
+
/** 启用旋转(默认 true) */
|
|
34
|
+
enableRotate?: boolean;
|
|
35
|
+
/** 最小缩放距离(默认 3) */
|
|
36
|
+
minDistance?: number;
|
|
37
|
+
/** 最大缩放距离(默认 20) */
|
|
38
|
+
maxDistance?: number;
|
|
39
|
+
/** 最小极角 rad(默认 0.2,防止正上方看不清) */
|
|
40
|
+
minPolarAngle?: number;
|
|
41
|
+
/** 最大极角 rad(默认 Math.PI/2 - 0.1,防止穿地面) */
|
|
42
|
+
maxPolarAngle?: number;
|
|
43
|
+
/** 平移速度(默认 1.0) */
|
|
44
|
+
panSpeed?: number;
|
|
45
|
+
/** 旋转速度(默认 1.0) */
|
|
46
|
+
rotateSpeed?: number;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const DEFAULT_CONFIG: Required<OrbitConfig> = {
|
|
50
|
+
enableDamping: true,
|
|
51
|
+
dampingFactor: 0.1,
|
|
52
|
+
enablePan: true,
|
|
53
|
+
enableZoom: true,
|
|
54
|
+
enableRotate: true,
|
|
55
|
+
minDistance: 3,
|
|
56
|
+
maxDistance: 20,
|
|
57
|
+
minPolarAngle: 0.2,
|
|
58
|
+
maxPolarAngle: Math.PI / 2 - 0.1,
|
|
59
|
+
panSpeed: 1.0,
|
|
60
|
+
rotateSpeed: 1.0,
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export class OrbitControlsAdapter {
|
|
64
|
+
private controls: OrbitControls;
|
|
65
|
+
private _enabled = true;
|
|
66
|
+
|
|
67
|
+
constructor(
|
|
68
|
+
camera: THREE.PerspectiveCamera,
|
|
69
|
+
canvas: HTMLCanvasElement,
|
|
70
|
+
config?: OrbitConfig,
|
|
71
|
+
) {
|
|
72
|
+
const cfg = { ...DEFAULT_CONFIG, ...config };
|
|
73
|
+
|
|
74
|
+
this.controls = new OrbitControls(camera, canvas);
|
|
75
|
+
this.controls.enableDamping = cfg.enableDamping;
|
|
76
|
+
this.controls.dampingFactor = cfg.dampingFactor;
|
|
77
|
+
this.controls.enablePan = cfg.enablePan;
|
|
78
|
+
this.controls.enableZoom = cfg.enableZoom;
|
|
79
|
+
this.controls.enableRotate = cfg.enableRotate;
|
|
80
|
+
this.controls.minDistance = cfg.minDistance;
|
|
81
|
+
this.controls.maxDistance = cfg.maxDistance;
|
|
82
|
+
this.controls.minPolarAngle = cfg.minPolarAngle;
|
|
83
|
+
this.controls.maxPolarAngle = cfg.maxPolarAngle;
|
|
84
|
+
this.controls.panSpeed = cfg.panSpeed;
|
|
85
|
+
this.controls.rotateSpeed = cfg.rotateSpeed;
|
|
86
|
+
|
|
87
|
+
// 默认看向原点
|
|
88
|
+
this.controls.target.set(0, 0, 0);
|
|
89
|
+
this.controls.update();
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* 设置视角中心点(OrbitControls 的旋转目标)
|
|
94
|
+
*/
|
|
95
|
+
setTarget(position: THREE.Vector3): void {
|
|
96
|
+
this.controls.target.copy(position);
|
|
97
|
+
this.controls.update();
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* 获取当前 target
|
|
102
|
+
*/
|
|
103
|
+
getTarget(): THREE.Vector3 {
|
|
104
|
+
return this.controls.target.clone();
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* 每帧更新(需在 animation loop 中调用)
|
|
109
|
+
*/
|
|
110
|
+
update(): void {
|
|
111
|
+
if (this._enabled) {
|
|
112
|
+
this.controls.update();
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* 启用交互
|
|
118
|
+
*/
|
|
119
|
+
enable(): void {
|
|
120
|
+
this._enabled = true;
|
|
121
|
+
this.controls.enabled = true;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* 禁用交互(暂停拖动/缩放)
|
|
126
|
+
*/
|
|
127
|
+
disable(): void {
|
|
128
|
+
this._enabled = false;
|
|
129
|
+
this.controls.enabled = false;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* 是否启用状态
|
|
134
|
+
*/
|
|
135
|
+
get enabled(): boolean {
|
|
136
|
+
return this._enabled;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* 获取原始 OrbitControls 实例(高级用法)
|
|
141
|
+
*/
|
|
142
|
+
getRawControls(): OrbitControls {
|
|
143
|
+
return this.controls;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* 销毁
|
|
148
|
+
*/
|
|
149
|
+
dispose(): void {
|
|
150
|
+
this.controls.dispose();
|
|
151
|
+
}
|
|
152
|
+
}
|