added CharacterView
This commit is contained in:
@@ -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 />
|
||||
</>)
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user