reformatted tool arrangement. Added diffusetexture to label. Added exportable to object parents.
This commit is contained in:
parent
e0d85a6a3d
commit
4c300dc73b
@ -181,6 +181,7 @@ export class DiagramObject {
|
|||||||
}
|
}
|
||||||
if (!this._baseTransform) {
|
if (!this._baseTransform) {
|
||||||
this._baseTransform = new TransformNode("base-" + this._mesh.id, this._scene);
|
this._baseTransform = new TransformNode("base-" + this._mesh.id, this._scene);
|
||||||
|
this._baseTransform.metadata = {exportable: true};
|
||||||
}
|
}
|
||||||
if (this._from && this._to) {
|
if (this._from && this._to) {
|
||||||
if (!this._meshRemovedObserver) {
|
if (!this._meshRemovedObserver) {
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import {AbstractMesh, Color3, DynamicTexture, Material, MeshBuilder, StandardMaterial} from "@babylonjs/core";
|
import {AbstractMesh, DynamicTexture, Material, MeshBuilder, StandardMaterial} from "@babylonjs/core";
|
||||||
import {DefaultScene} from "../../defaultScene";
|
import {DefaultScene} from "../../defaultScene";
|
||||||
|
|
||||||
function calculateDynamicTextureDimensions(text: string, font: string): {
|
function calculateDynamicTextureDimensions(text: string, font: string): {
|
||||||
@ -20,27 +20,31 @@ function calculateDynamicTextureDimensions(text: string, font: string): {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function createDynamicTexture(text: string, font: string, DTWidth: number, DTHeight: number): DynamicTexture {
|
function createDynamicTexture(text: string, font: string, DTWidth: number, DTHeight: number): DynamicTexture {
|
||||||
const dynamicTexture = new DynamicTexture("DynamicTexture", {
|
const dynamicTexture = new DynamicTexture("text-text", {
|
||||||
width: DTWidth,
|
width: DTWidth,
|
||||||
height: DTHeight
|
height: DTHeight
|
||||||
}, DefaultScene.Scene, false);
|
}, DefaultScene.Scene, false);
|
||||||
dynamicTexture.drawText(text, null, null, font, "#ffffff", "#000000", true);
|
dynamicTexture.drawText(text, null, null, font, "#ffffff", "#000000", true);
|
||||||
|
dynamicTexture.metadata = {exportable: true};
|
||||||
return dynamicTexture;
|
return dynamicTexture;
|
||||||
}
|
}
|
||||||
|
|
||||||
function createMaterial(dynamicTexture: DynamicTexture): Material {
|
function createMaterial(dynamicTexture: DynamicTexture): Material {
|
||||||
const mat = new StandardMaterial("mat", DefaultScene.Scene);
|
const mat = new StandardMaterial("text-mat", DefaultScene.Scene);
|
||||||
mat.diffuseColor = Color3.Black();
|
//mat.diffuseColor = Color3.Black();
|
||||||
mat.disableLighting = true;
|
mat.disableLighting = false;
|
||||||
mat.backFaceCulling = false;
|
mat.backFaceCulling = false;
|
||||||
mat.emissiveTexture = dynamicTexture;
|
mat.emissiveTexture = dynamicTexture;
|
||||||
mat.freeze();
|
mat.diffuseTexture = dynamicTexture;
|
||||||
|
mat.metadata = {exportable: true};
|
||||||
|
//mat.freeze();
|
||||||
return mat;
|
return mat;
|
||||||
}
|
}
|
||||||
|
|
||||||
function createPlane(text: string, material: Material, planeWidth: number, height: number): AbstractMesh {
|
function createPlane(text: string, material: Material, planeWidth: number, height: number): AbstractMesh {
|
||||||
const plane = MeshBuilder.CreatePlane("text" + text, {width: planeWidth, height: height}, DefaultScene.Scene);
|
const plane = MeshBuilder.CreatePlane("text" + text, {width: planeWidth, height: height}, DefaultScene.Scene);
|
||||||
plane.material = material;
|
plane.material = material;
|
||||||
|
plane.metadata = {exportable: true};
|
||||||
return plane;
|
return plane;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -51,8 +51,7 @@ export async function buildColor(color: Color3, scene: Scene, parent: TransformN
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const GRID_SIZE = 6;
|
||||||
const GRID_SIZE = 5;
|
|
||||||
|
|
||||||
function calculatePosition(i: number) {
|
function calculatePosition(i: number) {
|
||||||
return (i / GRID_SIZE) - .5 - (1 / GRID_SIZE / 2);
|
return (i / GRID_SIZE) - .5 - (1 / GRID_SIZE / 2);
|
||||||
|
|||||||
@ -47,7 +47,7 @@ export class CustomEnvironment {
|
|||||||
.then(() => {
|
.then(() => {
|
||||||
const ground = this.createGround();
|
const ground = this.createGround();
|
||||||
new PhysicsAggregate(ground, PhysicsShapeType.BOX, {mass: 0}, this.scene);
|
new PhysicsAggregate(ground, PhysicsShapeType.BOX, {mass: 0}, this.scene);
|
||||||
createPoints(20, 20);
|
//createPoints(20, 20);
|
||||||
this.createBackgroundAudio();
|
this.createBackgroundAudio();
|
||||||
this._groundMeshObservable.notifyObservers(ground);
|
this._groundMeshObservable.notifyObservers(ground);
|
||||||
this.createWalls();
|
this.createWalls();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user