Commit a004e4da authored by Chunchi Che's avatar Chunchi Che

update smal

parent 8ab9bcd7
...@@ -155,11 +155,13 @@ const CHand = (props: { ...@@ -155,11 +155,13 @@ const CHand = (props: {
const handPositons = (player: number, hands: Hand[]) => { const handPositons = (player: number, hands: Hand[]) => {
const gap = groundShape.width / (hands.length - 1); const gap = groundShape.width / (hands.length - 1);
const x = (idx: number) =>
player == 0 ? left + gap * idx : -left - gap * idx;
const y = handShape.height / 2; const y = handShape.height / 2;
const z = const z =
player == 0 ? -(groundShape.height / 2) - 1 : groundShape.height / 2 + 1; player == 0 ? -(groundShape.height / 2) - 1 : groundShape.height / 2 + 1;
return hands.map((_, idx) => new BABYLON.Vector3(left + gap * idx, y, z)); return hands.map((_, idx) => new BABYLON.Vector3(x(idx), y, z));
}; };
export default Hands; export default Hands;
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