start to dig into common objects
parent
b543c586e4
commit
8a932fc9e0
|
@ -279,19 +279,18 @@ GameLib.D3.Material.prototype.createInstance = function(update) {
|
||||||
if (update) {
|
if (update) {
|
||||||
|
|
||||||
for (var property in instance) {
|
for (var property in instance) {
|
||||||
|
|
||||||
if (property == 'size') {
|
|
||||||
instance[property] = this.pointSize;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (property == 'sizeAttenuation') {
|
|
||||||
instance[property] = this.pointSizeAttenuation;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (
|
if (
|
||||||
this.hasOwnProperty(property) &&
|
instance.hasOwnProperty(property) &&
|
||||||
instance.hasOwnProperty(property)
|
this.hasOwnProperty(property)
|
||||||
) {
|
) {
|
||||||
|
if (property == 'size') {
|
||||||
|
instance[property] = this.pointSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (property == 'sizeAttenuation') {
|
||||||
|
instance[property] = this.pointSizeAttenuation;
|
||||||
|
}
|
||||||
|
|
||||||
if (instance[property] instanceof THREE.Color) {
|
if (instance[property] instanceof THREE.Color) {
|
||||||
instance[property].copy(this[property])
|
instance[property].copy(this[property])
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -1,16 +1,16 @@
|
||||||
/**
|
/**
|
||||||
* Runtime vector3 for updating instance objects
|
* Runtime apiVector3 for updating instance objects
|
||||||
* @param graphics GameLib.D3.Graphics
|
* @param graphics GameLib.D3.Graphics
|
||||||
* @param parentObject GameLib.D3.*
|
* @param parentObject GameLib.D3.*
|
||||||
* @param vector3 GameLib.D3.API.Vector3
|
* @param apiVector3 GameLib.D3.API.Vector3
|
||||||
* @param grain Number
|
* @param grain Number
|
||||||
* @constructor
|
* @constructor
|
||||||
*/
|
*/
|
||||||
GameLib.D3.Vector3 = function RuntimeVector3(graphics, parentObject, vector3, grain) {
|
GameLib.D3.Vector3 = function RuntimeVector3(graphics, parentObject, apiVector3, grain) {
|
||||||
|
|
||||||
for (var property in vector3) {
|
for (var property in apiVector3) {
|
||||||
if (vector3.hasOwnProperty(property)) {
|
if (apiVector3.hasOwnProperty(property)) {
|
||||||
this[property] = vector3[property];
|
this[property] = apiVector3[property];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ GameLib.D3.Vector3.prototype.createInstance = function(update) {
|
||||||
instance.y = this.y;
|
instance.y = this.y;
|
||||||
instance.z = this.z;
|
instance.z = this.z;
|
||||||
} else {
|
} else {
|
||||||
instance = new this.graphics.instance.Vector3(this.x, this.y, this.z);
|
instance = new THREE.Vector3(this.x, this.y, this.z);
|
||||||
}
|
}
|
||||||
|
|
||||||
return instance;
|
return instance;
|
||||||
|
|
Loading…
Reference in New Issue