Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function getHighlightMesh(rendering) {
var m = rendering._highlightMesh
if (!m) {
var mesh = Mesh.CreatePlane("highlight", 1.0, rendering._scene)
var hlm = rendering.makeStandardMaterial('highlightMat')
hlm.backFaceCulling = false
hlm.emissiveColor = new Color3(1, 1, 1)
hlm.alpha = 0.2
mesh.material = hlm
m = rendering._highlightMesh = mesh
// outline
var s = 0.5
var lines = Mesh.CreateLines("hightlightLines", [
new Vector3(s, s, 0),
new Vector3(s, -s, 0),
new Vector3(-s, -s, 0),
new Vector3(-s, s, 0),
new Vector3(s, s, 0)
], rendering._scene)
lines.color = new Color3(1, 1, 1)
lines.parent = mesh
rendering.addMeshToScene(m)
applyPropertyWhenDefined(prop.vectorProperties._EmissionColor, (value) => {
material.emissiveColor = new Color3(value[0], value[1], value[2]);
});
applyPropertyWhenDefined(prop.floatProperties._OutlineWidth, (value) => material.outlineWidth = value);
applyPropertyWhenDefined(prop.vectorProperties._OutlineColor, (value) => {
material.outlineColor = new Color3(value[0], value[1], value[2]);
});
applyPropertyWhenDefined(prop.floatProperties._OutlineLightingMix, (value) => material.outlineLightingMix = value);
function arrToColor(a) { return new Color3(a[0], a[1], a[2]) }
scene.clearColor = arrToColor(opts.clearColor)
applyPropertyWhenDefined(prop.vectorProperties._ShadeColor, (value) => {
material.shadeColor = new Color3(value[0], value[1], value[2]);
});
applyPropertyWhenDefined(prop.floatProperties._BumpScale, (value) => material.bumpScale = value);
.add('Drag and Drop', () => (
applyPropertyWhenDefined(prop.vectorProperties._RimColor, (value) => {
material.rimColor = new Color3(value[0], value[1], value[2]);
});
applyPropertyWhenDefined(prop.floatProperties._RimLightingMix, (value) => material.rimLightingMix = value);
.add('Drag and Drop', () => (
))