added CharacterView

This commit is contained in:
azykov@mail.ru 2026-06-01 23:13:59 +03:00
parent d23300afc3
commit 745ffe4f31
No known key found for this signature in database
2 changed files with 13 additions and 0 deletions

View File

@ -0,0 +1,12 @@
import { observer } from "mobx-react-lite";
import { state } from "../state";
export const CharacterView = observer(function () {
const character = state.world.currentScene.character;
return <mesh position={character.position} rotation={character.look}>
<boxGeometry args={[0.8, 0.8, 0.8]} />
<meshStandardMaterial color="yellow" />
</mesh>
});

View File

@ -38,5 +38,6 @@ export const WorldView = observer(function () {
<ambientLight intensity={0.5} /> <ambientLight intensity={0.5} />
<directionalLight position={[5, 5, 5]} intensity={1} /> <directionalLight position={[5, 5, 5]} intensity={1} />
{world.currentScene.objects.map((obj) => <ObjectView key={obj.id} object={obj} />)} {world.currentScene.objects.map((obj) => <ObjectView key={obj.id} object={obj} />)}
<CharacterView />
</>) </>)
}); });