Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
5921e6d
add scene for testing physics impulse
popuz Feb 11, 2026
e6db09c
add more test cubes
popuz Feb 11, 2026
04228f0
pendulums over the bridge
popuz Feb 11, 2026
8090bca
more test cases
popuz Feb 12, 2026
9a0d9d4
more test cases
popuz Feb 12, 2026
dc224cb
Merge remote-tracking branch 'origin/feat/apply-physics-impulse' into…
popuz Feb 12, 2026
c76f16b
adjusted forces
popuz Feb 12, 2026
d11b40d
small fix (tried to point to update js-toolchain, but seems not needed)
popuz Feb 12, 2026
86f1a00
pointed to updated js-toolchain
popuz Feb 12, 2026
d30fb45
add Force tunnels with comparison to Impulse tunnels
popuz Feb 12, 2026
cbf107f
added UI to change Force/Impulse in wind tubes
popuz Feb 18, 2026
4f46c35
add 2 boxes with controls
popuz Feb 18, 2026
2e8da9d
add UI for other cubes
popuz Feb 18, 2026
61ac79c
add UI for other cubes
popuz Feb 18, 2026
5cb1277
Merge remote-tracking branch 'origin/feat/apply-physics-impulse' into…
popuz Feb 20, 2026
3cbd443
wip on several forces
popuz Feb 23, 2026
6372d3d
Merge remote-tracking branch 'origin/main' into feat/apply-physics-im…
popuz Feb 24, 2026
3072c00
stale stuffs
popuz Feb 26, 2026
d1a7c10
updated packeages
popuz Feb 26, 2026
f9cc7c1
fixes for trigger areas
popuz Feb 26, 2026
151bdf5
updated packages
popuz Feb 27, 2026
da1a79f
use localToWorld instaed of manual rotation
popuz Feb 27, 2026
2c9f5ae
added simple carusel vihr'
popuz Feb 27, 2026
1a46ea6
nice carousel (but cutted)
popuz Feb 27, 2026
50950d9
carousel with vertical movement and UI
popuz Feb 28, 2026
61a7f3d
add cooldown
popuz Feb 28, 2026
899800d
add faceTriggers.ts
popuz Feb 28, 2026
9290253
ui for cooldoown and ideas
popuz Feb 28, 2026
3f2498a
add measures to the cubes
popuz Feb 28, 2026
36bb780
Disabled by default
popuz Feb 28, 2026
bfd1de0
add angle freeze
popuz Feb 28, 2026
c40c464
add buttons for tilt and hight
popuz Feb 28, 2026
0316184
add balls inverse knockback scene sketch
popuz Feb 28, 2026
4965178
MOARE BALLS
popuz Feb 28, 2026
29675f0
even more balls
popuz Feb 28, 2026
54c7f5f
add config for balls
popuz Feb 28, 2026
e05c146
removing bubbles
popuz Feb 28, 2026
6eb8bbf
adjusting defaults
popuz Mar 2, 2026
9c0b50d
adjustments for QA
popuz Mar 2, 2026
f842e51
scene for knockbacks
popuz Mar 2, 2026
54f6605
added repulsion and knockback
popuz Mar 2, 2026
c9fbe8a
add test for force with duration
popuz Mar 2, 2026
9bdd180
updated package
popuz Mar 2, 2026
d019d45
simplified UI
popuz Mar 9, 2026
4c3f5aa
pointed to new package
popuz Mar 9, 2026
8b4d1b8
update wuth local
popuz Mar 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions dcl-workspace.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@
{
"path": "scenes/1,0-visibility-comp-propagation"
},
{
"path": "scenes/0,7-physics-impulse"
},
{
"path": "scenes/0,6-ui-zindex-and-opacity"
},
Expand Down
20 changes: 20 additions & 0 deletions scenes/0,7-physics-impulse/.dclignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.*
bin/*.map
package-lock.json
yarn-lock.json
build.json
export
tsconfig.json
tslint.json
node_modules
*.ts
*.tsx
.vscode
Dockerfile
dist
README.md
*.blend
*.fbx
*.zip
*.rar
src
10 changes: 10 additions & 0 deletions scenes/0,7-physics-impulse/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package-lock.json
*.js
node_modules
bin/
.DS_Store
**/.DS_Store
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.editor
3 changes: 3 additions & 0 deletions scenes/0,7-physics-impulse/.vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": []
}
17 changes: 17 additions & 0 deletions scenes/0,7-physics-impulse/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
// Use the Decentraland Editor extension of VSCode to debug the scene
// in chrome from VSCode
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Debug Decentraland in Chrome",
"url": "${command:decentraland-sdk7.commands.getDebugURL}",
"webRoot": "${workspaceFolder}/bin",
"sourceMapPathOverrides": {
"dcl:///*": "${workspaceFolder}/*"
}
}
]
}
21 changes: 21 additions & 0 deletions scenes/0,7-physics-impulse/PhysicsForces/.dclignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.*
bin/*.map
package-lock.json
yarn-lock.json
build.json
export
tsconfig.json
tslint.json
node_modules
*.ts
*.tsx
.vscode
Dockerfile
dist
README.md
*.blend
*.fbx
*.zip
*.rar
*.md
src
10 changes: 10 additions & 0 deletions scenes/0,7-physics-impulse/PhysicsForces/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package-lock.json
*.js
node_modules
bin/
.DS_Store
**/.DS_Store
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.editor
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": []
}
17 changes: 17 additions & 0 deletions scenes/0,7-physics-impulse/PhysicsForces/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
// Use the Decentraland Editor extension of VSCode to debug the scene
// in chrome from VSCode
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Debug Decentraland in Chrome",
"url": "${command:decentraland-sdk7.commands.getDebugURL}",
"webRoot": "${workspaceFolder}/bin",
"sourceMapPathOverrides": {
"dcl:///*": "${workspaceFolder}/*"
}
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# sdk-empty-scene-template
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"version": 1,
"components": []
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"$schema": "https://raw.githubusercontent.com/getcursor/cursor-config/main/schema/cursor.schema.json",
"context": {
"include": [
"https://github.com/decentraland/documentation/blob/main/ai-sdk-context/sdk7-complete-reference.md",
"https://github.com/decentraland/documentation/blob/main/ai-sdk-context/sdk7-examples.mdc",
"https://github.com/decentraland/documentation/tree/main/ai-sdk-context/libraries/*.ts"
],
"exclude": [
"**/__tests__/**",
"**/*.test.*",
"**/*.spec.*"
]
},
"metadata": {
"name": "dcl-cursorai-template",
"description": "A starter context setup for Cursor AI to use Decentraland SDK7 docs and curated code examples.",
"version": "1.0.0",
"tags": ["decentraland", "cursor", "sdk7", "ai-context", "examples"],
"authors": ["@drkrillo", "@decentraland"]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules/
dist/
build/
context/**/__tests__/
*.test.*
*.spec.*
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"name": "dcl-project",
"version": "1.0.0",
"description": "SDK7 Template scene",
"scripts": {
"start": "sdk-commands start",
"deploy": "sdk-commands deploy",
"build": "sdk-commands build",
"upgrade-sdk": "npm install --save-dev @dcl/sdk@latest",
"upgrade-sdk:next": "npm install --save-dev @dcl/sdk@next"
},
"devDependencies": {
"@dcl/js-runtime": "latest",
"@dcl/sdk": "latest"
},
"engines": {
"node": ">=16.0.0",
"npm": ">=6.0.0"
},
"prettier": {
"semi": false,
"singleQuote": true,
"printWidth": 120,
"trailingComma": "none"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"ecs7": true,
"runtimeVersion": "7",
"display": {
"title": "Empty Scene Template",
"description": "Empty Scene Template",
"favicon": "favicon_asset"
},
"owner": "",
"contact": {
"name": "SDK",
"email": ""
},
"main": "bin/index.js",
"tags": [],
"scene": {
"parcels": [
"0,0"
],
"base": "0,0"
},
"spawnPoints": [
{
"name": "spawn1",
"default": true,
"position": {
"x": [
0,
3
],
"y": [
0,
0
],
"z": [
0,
3
]
},
"cameraTarget": {
"x": 8,
"y": 1,
"z": 8
}
}
],
"requiredPermissions": [
"ALLOW_TO_TRIGGER_AVATAR_EMOTE",
"ALLOW_TO_MOVE_PLAYER_INSIDE_SCENE"
],
"featureToggles": {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import {} from '@dcl/sdk/math'
import { engine } from '@dcl/sdk/ecs'
import { setupUi } from './ui'


export function main() {
// uncomment the line below to initialize UI from ui.tsx
//setupUi()

// your scene code here
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import ReactEcs, { ReactEcsRenderer, UiEntity } from "@dcl/sdk/react-ecs"


export function setupUi() {
ReactEcsRenderer.setUiRenderer(uiMenu, { virtualWidth: 1920, virtualHeight: 1080 })
}

// draw your UI here
export const uiMenu = () => (
<UiEntity>
</UiEntity>
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"compilerOptions": {
"allowJs": true,
"strict": true,
"baseUrl": ".",
"paths": {
"@dcl/asset-packs/*": ["node_modules/@dcl/inspector/node_modules/@dcl/asset-packs/*"]
}
},
"include": [
"src/**/*.ts",
"src/**/*.tsx",
"assets/**/*.ts",
"assets/**/*.tsx"
],
"extends": "@dcl/sdk/types/tsconfig.ecs7.json"
}
88 changes: 88 additions & 0 deletions scenes/0,7-physics-impulse/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# Physics Impulse Test Scene

Прототипная сцена для тестирования `Physics.applyImpulseToPlayer` и `Physics.applyForceToPlayer`
в разных игровых механиках (кубы, маятники, карусель, настраиваемые зоны).

## Что сейчас в сцене

- Сравнение Force vs Impulse в туннелях.
- Impulse Cube и Repulsion Cube.
- Pendulum Bridge с ударными маятниками.
- Chain Carousel с:
- вертикальными колебаниями (можно поставить на паузу),
- настраиваемым максимальным углом наклона сидений,
- настраиваемой скоростью вращения.
- Grapple Anchors playground:
- подвесные точки зацепа,
- pointer interaction для активации,
- отрицательный `applyKnockbackToPlayer` для притягивания к якорю.

## Архитектурная заметка (ADR-lite): Reusable Impulse Face Behavior

### Контекст

Сейчас face-триггеры для сидений карусели реализованы рабочим прототипом:

- вынесены немного наружу от граней, чтобы снизить пропуски `onTriggerEnter`;
- имеют общий кулдаун;
- агрегируют несколько попаданий за кадр в одно итоговое направление;
- применяют один импульс фиксированной величины (как от одиночного удара гранью).

Этот подход уже решает проблему многократных срабатываний и нестабильных касаний, но логика пока
привязана к текущему сценарию.

### Проблема

Нужно переиспользуемое поведение для будущих объектов:

- сегодня это «пульсирующий куб»;
- завтра это «кресло карусели»;
- потом это может быть любой другой объект.

### Решение (цель)

Вынести текущую логику в поведенческий модуль, который можно навесить на любую сущность:

`attachImpulseFacesBehavior(entity, config)`

где `config` описывает:

- `boxSize`
- `getMagnitude()`
- `cooldownSec`
- `thickness`
- `outset`
- `visuals` (базовые/кулдаун цвета)
- опционально `groupId` (если нужно объединять несколько сущностей в общий агрегатор/кулдаун)

### Ожидаемое поведение модуля

- Создаёт face-триггеры вокруг target-сущности.
- Собирает все срабатывания за кадр в агрегатор.
- Применяет один импульс в конце кадра:
- направление = сумма направлений триггеров;
- величина = как у одного «обычного» удара (без суммирования силы).
- Запускает кулдаун на группу/сущность.

### Почему это не полноценный ADR прямо сейчас

Сцена находится в фазе активного прототипирования, параметры и UX часто меняются.
Поэтому здесь используется формат **ADR-lite** внутри `README`:

- есть явный контекст, решение и последствия;
- но без формальной фиксации статуса/версий как в строгом ADR-процессе.

Когда поведение стабилизируется и начнёт использоваться в нескольких сценах/проектах, стоит
вынести это в отдельный формальный ADR.

### Последствия и плюсы

- Переиспользуемость: одно поведение для разных сущностей.
- Локальность состояния: кулдаун и агрегатор живут рядом с объектом/группой.
- Простота расширения: можно добавлять пресеты, разные режимы реакции, разные политики группировки.

### TODO (следующий шаг)

1. Вынести текущий код из `src/faceTriggers.ts` в явный reusable behavior API.
2. Подключить карусель через этот API без изменения внешнего поведения.
3. Добавить минимальный debug-режим (визуализация направления итогового импульса).
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"version": 1,
"components": [
{
"name": "core::GltfContainer",
"data": {
"0": {
"json": {
"src": "{assetPath}/CityTile.glb"
}
}
}
}
]
}
Loading
Loading