Commit 33778310 authored by Chunchi Che's avatar Chunchi Che

add Cemetery component

parent adf8a0f9
import * as BABYLON from "@babylonjs/core";
import * as CONFIG from "../../config/ui";
export default (scene: BABYLON.Scene) => {
// 墓地
const Cemetery = () => {
const shape = CONFIG.CemeterySlotShape();
const cemetery = BABYLON.MeshBuilder.CreateBox("cemetery", shape);
// 位置
cemetery.position = new BABYLON.Vector3(
const position = new BABYLON.Vector3(
3.2,
shape.depth / 2 + CONFIG.Floating,
-2.0
);
// 旋转
cemetery.rotation = CONFIG.CemeterySlotRotation();
// 材质
const cemeteryMaterial = new BABYLON.StandardMaterial(
"cemeteryMaterial",
scene
const rotation = CONFIG.CemeterySlotRotation();
return (
<box
name="cemetery"
width={shape.width}
height={shape.height}
depth={shape.depth}
position={position}
rotation={rotation}
>
<standardMaterial
name="cemetery-mat"
diffuseColor={CONFIG.CemeteryColor()}
/>
</box>
);
cemeteryMaterial.diffuseColor = CONFIG.CemeteryColor();
cemetery.material = cemeteryMaterial;
};
export default Cemetery;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment