Added more dice

This commit is contained in:
Mitchell McCaffrey 2020-05-13 16:15:32 +10:00
parent c9f77313a2
commit e48e5481e1
25 changed files with 138 additions and 3 deletions

View File

@ -1,7 +1,7 @@
import React from "react";
import { Flex, IconButton } from "theme-ui";
import SunsetDice from "../../../dice/sunset/SunsetDice";
import SunsetDice from "../../../dice/galaxy/GalaxyDice";
import D20Icon from "../../../icons/D20Icon";
import D12Icon from "../../../icons/D12Icon";

View File

@ -161,8 +161,8 @@ function DiceTray({ isOpen }) {
return (
<Box
sx={{
width: "275px",
height: "550px",
width: "300px",
height: "600px",
borderRadius: "4px",
display: isOpen ? "block" : "none",
position: "relative",

View File

@ -0,0 +1,27 @@
import Dice from "../Dice";
import albedo from "./albedo.jpg";
import metalRoughness from "./metalRoughness.jpg";
import normal from "./normal.jpg";
class GalaxyDice extends Dice {
static meshes;
static material;
static async createInstance(diceType, scene) {
if (!this.material) {
this.material = this.loadMaterial(
"galaxy_pbr",
{ albedo, metalRoughness, normal },
scene
);
}
if (!this.meshes) {
this.meshes = await this.loadMeshes(this.material, scene);
}
return Dice.createInstance(this.meshes[diceType], scene);
}
}
export default GalaxyDice;

BIN
src/dice/galaxy/albedo.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 MiB

BIN
src/dice/galaxy/normal.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 285 KiB

27
src/dice/iron/IronDice.js Normal file
View File

@ -0,0 +1,27 @@
import Dice from "../Dice";
import albedo from "./albedo.jpg";
import metalRoughness from "./metalRoughness.jpg";
import normal from "./normal.jpg";
class IronDice extends Dice {
static meshes;
static material;
static async createInstance(diceType, scene) {
if (!this.material) {
this.material = this.loadMaterial(
"iron_pbr",
{ albedo, metalRoughness, normal },
scene
);
}
if (!this.meshes) {
this.meshes = await this.loadMeshes(this.material, scene);
}
return Dice.createInstance(this.meshes[diceType], scene);
}
}
export default IronDice;

BIN
src/dice/iron/albedo.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

BIN
src/dice/iron/metalRoughness.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

BIN
src/dice/iron/normal.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 309 KiB

View File

@ -0,0 +1,27 @@
import Dice from "../Dice";
import albedo from "./albedo.jpg";
import metalRoughness from "./metalRoughness.jpg";
import normal from "./normal.jpg";
class NebulaDice extends Dice {
static meshes;
static material;
static async createInstance(diceType, scene) {
if (!this.material) {
this.material = this.loadMaterial(
"nebula_pbr",
{ albedo, metalRoughness, normal },
scene
);
}
if (!this.meshes) {
this.meshes = await this.loadMeshes(this.material, scene);
}
return Dice.createInstance(this.meshes[diceType], scene);
}
}
export default NebulaDice;

BIN
src/dice/nebula/albedo.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

BIN
src/dice/nebula/normal.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 580 KiB

View File

@ -0,0 +1,27 @@
import Dice from "../Dice";
import albedo from "./albedo.jpg";
import metalRoughness from "./metalRoughness.jpg";
import normal from "./normal.jpg";
class SunriseDice extends Dice {
static meshes;
static material;
static async createInstance(diceType, scene) {
if (!this.material) {
this.material = this.loadMaterial(
"sunrise_pbr",
{ albedo, metalRoughness, normal },
scene
);
}
if (!this.meshes) {
this.meshes = await this.loadMeshes(this.material, scene);
}
return Dice.createInstance(this.meshes[diceType], scene);
}
}
export default SunriseDice;

BIN
src/dice/sunrise/albedo.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 939 KiB

BIN
src/dice/sunrise/normal.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 283 KiB

BIN
src/dice/sunset/albedo.jpg Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 486 KiB

After

Width:  |  Height:  |  Size: 1.3 MiB

BIN
src/dice/sunset/metalRoughness.jpg Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 361 KiB

After

Width:  |  Height:  |  Size: 916 KiB

BIN
src/dice/sunset/normal.jpg Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 132 KiB

After

Width:  |  Height:  |  Size: 283 KiB

View File

@ -0,0 +1,27 @@
import Dice from "../Dice";
import albedo from "./albedo.jpg";
import metalRoughness from "./metalRoughness.jpg";
import normal from "./normal.jpg";
class WalnutDice extends Dice {
static meshes;
static material;
static async createInstance(diceType, scene) {
if (!this.material) {
this.material = this.loadMaterial(
"walnut_pbr",
{ albedo, metalRoughness, normal },
scene
);
}
if (!this.meshes) {
this.meshes = await this.loadMeshes(this.material, scene);
}
return Dice.createInstance(this.meshes[diceType], scene);
}
}
export default WalnutDice;

BIN
src/dice/walnut/albedo.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 757 KiB

BIN
src/dice/walnut/normal.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB