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