fix position offset for renderer
parent
4f48b3cc36
commit
2560a5c795
|
@ -33,7 +33,7 @@ GameLib.Event.COMPONENT_CLONED = 0xf;
|
||||||
GameLib.Event.TEXTURE_ANIMATED_CHANGE = 0x10;
|
GameLib.Event.TEXTURE_ANIMATED_CHANGE = 0x10;
|
||||||
GameLib.Event.ANIMATE_TEXTURE_INSTANCE = 0x11;
|
GameLib.Event.ANIMATE_TEXTURE_INSTANCE = 0x11;
|
||||||
GameLib.Event.REMOVE_PARTICLE_ENGINE = 0x12;
|
GameLib.Event.REMOVE_PARTICLE_ENGINE = 0x12;
|
||||||
//GameLib.Event.TEXTURE_INSTANCE_CREATED = 0x13;
|
GameLib.Event.PAUSE = 0x13;
|
||||||
GameLib.Event.TEXTURE_INSTANCE_UPDATED = 0x14;
|
GameLib.Event.TEXTURE_INSTANCE_UPDATED = 0x14;
|
||||||
//GameLib.Event.MATERIAL_INSTANCE_CREATED = 0x15;
|
//GameLib.Event.MATERIAL_INSTANCE_CREATED = 0x15;
|
||||||
GameLib.Event.MATERIAL_INSTANCE_UPDATED = 0x16;
|
GameLib.Event.MATERIAL_INSTANCE_UPDATED = 0x16;
|
||||||
|
@ -140,7 +140,7 @@ GameLib.Event.GetEventName = function(number) {
|
||||||
case 0x10 : return 'texture_animated_change';
|
case 0x10 : return 'texture_animated_change';
|
||||||
case 0x11 : return 'animate_texture_instance';
|
case 0x11 : return 'animate_texture_instance';
|
||||||
case 0x12 : return 'remove_particle_engine';
|
case 0x12 : return 'remove_particle_engine';
|
||||||
case 0x13 : return 'unused';//'texture_instance_created';
|
case 0x13 : return 'pause';
|
||||||
case 0x14 : return 'texture_instance_updated';
|
case 0x14 : return 'texture_instance_updated';
|
||||||
case 0x15 : return 'unused';//'material_instance_created';
|
case 0x15 : return 'unused';//'material_instance_created';
|
||||||
case 0x16 : return 'material_instance_updated';
|
case 0x16 : return 'material_instance_updated';
|
||||||
|
|
|
@ -203,20 +203,32 @@ GameLib.D3.Particle.prototype.cloneInstance = function() {
|
||||||
clone.position.add(this.positionOffset.instance);
|
clone.position.add(this.positionOffset.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
var add = 1;
|
var addX = 1;
|
||||||
|
var addY = 1;
|
||||||
|
var addZ = 1;
|
||||||
|
|
||||||
if (this.positionOffsetType === GameLib.D3.Particle.POSITION_OFFSET_TYPE_RANDOM) {
|
if (this.positionOffsetType === GameLib.D3.Particle.POSITION_OFFSET_TYPE_RANDOM) {
|
||||||
|
|
||||||
add = GameLib.Utils.GetRandomIntInclusive(1,2);
|
addX = GameLib.Utils.GetRandomIntInclusive(1,2);
|
||||||
|
addY = GameLib.Utils.GetRandomIntInclusive(1,2);
|
||||||
|
addZ = GameLib.Utils.GetRandomIntInclusive(1,2);
|
||||||
|
|
||||||
if (add === 1) {
|
if (addX === 1) {
|
||||||
clone.position.x += Math.random() * this.positionOffset.x;
|
clone.position.x += Math.random() * this.positionOffset.x;
|
||||||
clone.position.y += Math.random() * this.positionOffset.y;
|
|
||||||
clone.position.z += Math.random() * this.positionOffset.z;
|
|
||||||
} else {
|
} else {
|
||||||
clone.position.x -= Math.random() * this.positionOffset.x;
|
clone.position.x -= Math.random() * this.positionOffset.x;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (addY === 1) {
|
||||||
clone.position.y -= Math.random() * this.positionOffset.y;
|
clone.position.y -= Math.random() * this.positionOffset.y;
|
||||||
|
} else {
|
||||||
|
clone.position.y += Math.random() * this.positionOffset.y;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (addZ === 1) {
|
||||||
clone.position.z -= Math.random() * this.positionOffset.z;
|
clone.position.z -= Math.random() * this.positionOffset.z;
|
||||||
|
} else {
|
||||||
|
clone.position.z += Math.random() * this.positionOffset.z;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -763,6 +763,10 @@ GameLib.System.Input.prototype.onKeyDown = function(event) {
|
||||||
)
|
)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (event.code === 'KeyP') {
|
||||||
|
GameLib.Event.Emit(GameLib.Event.PAUSE);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
GameLib.System.Input.prototype.onKeyUp = function(event) {
|
GameLib.System.Input.prototype.onKeyUp = function(event) {
|
||||||
|
|
Loading…
Reference in New Issue