Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var Menu = function () {
this.start = myFog.getStart();
this.end = myFog.getEnd();
this.density = myFog.getDensity();
this.mode = myFog.getMode();
var color = myFog.getColor();
this["color.r"] = color.r;
this["color.g"] = color.g;
this["color.b"] = color.b;
var self = this;
// This is actually quite inefficient because it continually updates
// the scene graph, forcing frames to continually re-render.
// Your GPU's not going to like it, but it's just for a quick and dirty demo.
var update = function () {
myFog.setStart(self.start);
myFog.setEnd(self.end);
myFog.setDensity(self.density);
myFog.setMode(self.mode);
myFog.setColor({
r:self["color.r"],
g:self["color.g"],
b:self["color.b"]
var update = function () {
material.set({
color:{
r:self["color.r"],
g:self["color.g"],
b:self["color.b"]
},
specularColor:{
r:self["specularColor.r"],
g:self["specularColor.g"],
b:self["specularColor.b"]
},
specular:self.specular,
shine:self.shine,
emit:self.emit,
alpha:self.alpha
});
requestAnimationFrame(update);
};
update();
var update = function () {
material.setColor({
r: self["color.r"],
g: self["color.g"],
b: self["color.b"]
});
material.setSpecularColor({
r: self["specularColor.r"],
g: self["specularColor.g"],
b: self["specularColor.b"]
});
material.setSpecular(self.specular);
material.setShine(self.shine);
material.setEmit(self.emit);
material.setAlpha(self.alpha);
requestAnimationFrame(update);
};
update();
var update = function () {
myLights.setLights({
"0":{
dir:{
x:self["dir.x"],
y:self["dir.y"],
z:self["dir.z"]
},
color:{
r:self["color.r"],
g:self["color.g"],
b:self["color.b"]
},
specular:self.specular,
diffuse:self.diffuse
}
});
requestAnimationFrame(update);
};
var Menu = function () {
this["pos.x"] = 10.0;
this["pos.y"] = 10.0;
this["pos.z"] = 10.0;
this["color.r"] = 1.0;
this["color.g"] = 1.0;
this["color.b"] = 1.0;
this.constantAttenuation = 0.0;
this.linearAttenuation = 0.0;
this.quadraticAttenuation = 0.0;
this.specular = true;
this.diffuse = true;
var self = this;
var update = function () {
lights.setLights({
"0":{
pos:{
x:self["pos.x"],
y:self["pos.y"],
z:self["pos.z"]
},
var Menu = function () {
this["color.r"] = 1.0;
this["color.g"] = 1.0;
this["color.b"] = 1.0;
this["specularColor.r"] = 1.0;
this["specularColor.g"] = 1.0;
this["specularColor.b"] = 1.0;
this.specular = 1.0;
this.shine = 70.0;
this.emit = 0;
this.alpha = 1.0;
var self = this;
var update = function () {
material.setColor({
r: self["color.r"],
g: self["color.g"],
b: self["color.b"]
var update = function () {
myLights.setLights({
"0":{
dir:{
x:self["dir.x"],
y:self["dir.y"],
z:self["dir.z"]
},
color:{
r:self["color.r"],
g:self["color.g"],
b:self["color.b"]
},
specular:self.specular,
diffuse:self.diffuse
}
});
requestAnimationFrame(update);
};
var update = function () {
myFog.setStart(self.start);
myFog.setEnd(self.end);
myFog.setDensity(self.density);
myFog.setMode(self.mode);
myFog.setColor({
r:self["color.r"],
g:self["color.g"],
b:self["color.b"]
});
requestAnimationFrame(update);
};
var update = function () {
myFog.setStart(self.start);
myFog.setEnd(self.end);
myFog.setDensity(self.density);
myFog.setMode(self.mode);
myFog.setColor({
r: self["color.r"],
g: self["color.g"],
b: self["color.b"]
});
requestAnimationFrame(update);
};
var update = function () {
material.set({
color:{
r:self["color.r"],
g:self["color.g"],
b:self["color.b"]
},
specularColor:{
r:self["specularColor.r"],
g:self["specularColor.g"],
b:self["specularColor.b"]
},
specular:self.specular,
shine:self.shine,
emit:self.emit,
alpha:self.alpha
});
requestAnimationFrame(update);
};
update();