added CharacterView
This commit is contained in:
parent
d23300afc3
commit
745ffe4f31
|
|
@ -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>
|
||||
});
|
||||
|
||||
|
|
@ -38,5 +38,6 @@ export const WorldView = observer(function () {
|
|||
<ambientLight intensity={0.5} />
|
||||
<directionalLight position={[5, 5, 5]} intensity={1} />
|
||||
{world.currentScene.objects.map((obj) => <ObjectView key={obj.id} object={obj} />)}
|
||||
<CharacterView />
|
||||
</>)
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue