Added wood dice mesh variant and moved shared meshes

This commit is contained in:
Mitchell McCaffrey 2020-05-28 11:48:18 +10:00
parent 810366dd00
commit 5b269fe7d1
22 changed files with 37 additions and 10 deletions

View File

@ -1,12 +1,12 @@
import * as BABYLON from "babylonjs";
import d4Source from "./meshes/d4.glb";
import d6Source from "./meshes/d6.glb";
import d8Source from "./meshes/d8.glb";
import d10Source from "./meshes/d10.glb";
import d12Source from "./meshes/d12.glb";
import d20Source from "./meshes/d20.glb";
import d100Source from "./meshes/d100.glb";
import d4Source from "./shared/d4.glb";
import d6Source from "./shared/d6.glb";
import d8Source from "./shared/d8.glb";
import d10Source from "./shared/d10.glb";
import d12Source from "./shared/d12.glb";
import d20Source from "./shared/d20.glb";
import d100Source from "./shared/d100.glb";
import { lerp } from "../helpers/shared";

View File

@ -1,7 +1,7 @@
import * as BABYLON from "babylonjs";
import singleMeshSource from "../meshes/diceTraySingle.glb";
import doubleMeshSource from "../meshes/diceTrayDouble.glb";
import singleMeshSource from "./single.glb";
import doubleMeshSource from "./double.glb";
import singleAlbedo from "./singleAlbedo.jpg";
import singleMetalRoughness from "./singleMetalRoughness.jpg";

View File

@ -4,10 +4,33 @@ import albedo from "./albedo.jpg";
import metalRoughness from "./metalRoughness.jpg";
import normal from "./normal.jpg";
import d4Source from "./d4.glb";
import d6Source from "./d6.glb";
import d8Source from "./d8.glb";
import d10Source from "./d10.glb";
import d12Source from "./d12.glb";
import d20Source from "./d20.glb";
import d100Source from "./d100.glb";
const sourceOverrides = {
d4: d4Source,
d6: d6Source,
d8: d8Source,
d10: d10Source,
d12: d12Source,
d20: d20Source,
d100: d100Source,
};
class WalnutDice extends Dice {
static meshes;
static material;
static getDicePhysicalProperties(diceType) {
let properties = super.getDicePhysicalProperties(diceType);
return { mass: properties.mass * 1.4, friction: properties.friction };
}
static async load(scene) {
if (!this.material) {
this.material = this.loadMaterial(
@ -17,7 +40,11 @@ class WalnutDice extends Dice {
);
}
if (!this.meshes) {
this.meshes = await this.loadMeshes(this.material, scene);
this.meshes = await this.loadMeshes(
this.material,
scene,
sourceOverrides
);
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 MiB

After

Width:  |  Height:  |  Size: 2.1 MiB

BIN
src/dice/walnut/d10.glb Normal file

Binary file not shown.

BIN
src/dice/walnut/d100.glb Normal file

Binary file not shown.

BIN
src/dice/walnut/d12.glb Normal file

Binary file not shown.

BIN
src/dice/walnut/d20.glb Normal file

Binary file not shown.

BIN
src/dice/walnut/d4.glb Normal file

Binary file not shown.

BIN
src/dice/walnut/d6.glb Normal file

Binary file not shown.

BIN
src/dice/walnut/d8.glb Normal file

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 757 KiB

After

Width:  |  Height:  |  Size: 879 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 KiB

After

Width:  |  Height:  |  Size: 70 KiB