animation update
parent
de5e80b80a
commit
9654125674
|
@ -97,11 +97,10 @@ GameLib.D3.Animation.prototype.createInstance = function() {
|
||||||
/**
|
/**
|
||||||
* Updates the instance with the current state
|
* Updates the instance with the current state
|
||||||
*/
|
*/
|
||||||
GameLib.D3.Animation.prototype.updateInstance = function() {
|
GameLib.D3.Animation.prototype.updateInstance = function(property, item) {
|
||||||
|
|
||||||
|
if (property === 'rotationFn') {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
if (this.rotationFn) {
|
|
||||||
this.instance.rotation = new Function('data', this.rotationFn).bind(this);
|
this.instance.rotation = new Function('data', this.rotationFn).bind(this);
|
||||||
this.publish(
|
this.publish(
|
||||||
GameLib.Event.ANIMATION_COMPILE_SUCCESS,
|
GameLib.Event.ANIMATION_COMPILE_SUCCESS,
|
||||||
|
@ -110,30 +109,6 @@ GameLib.D3.Animation.prototype.updateInstance = function() {
|
||||||
type : GameLib.D3.Animation.ANIMATION_FUNCTION_TYPE_ROTATION
|
type : GameLib.D3.Animation.ANIMATION_FUNCTION_TYPE_ROTATION
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
|
||||||
|
|
||||||
if (this.translationFn) {
|
|
||||||
this.instance.translation = new Function('data', this.translationFn).bind(this);
|
|
||||||
this.publish(
|
|
||||||
GameLib.Event.ANIMATION_COMPILE_SUCCESS,
|
|
||||||
{
|
|
||||||
component : this,
|
|
||||||
type : GameLib.D3.Animation.ANIMATION_FUNCTION_TYPE_TRANSLATION
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.scaleFn) {
|
|
||||||
this.instance.scale = new Function('data', this.scaleFn).bind(this);
|
|
||||||
this.publish(
|
|
||||||
GameLib.Event.ANIMATION_COMPILE_SUCCESS,
|
|
||||||
{
|
|
||||||
component : this,
|
|
||||||
type : GameLib.D3.Animation.ANIMATION_FUNCTION_TYPE_SCALE
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
this.publish(
|
this.publish(
|
||||||
|
@ -143,6 +118,60 @@ GameLib.D3.Animation.prototype.updateInstance = function() {
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (property === 'translationFn') {
|
||||||
|
try {
|
||||||
|
this.instance.translation = new Function('data', this.translationFn).bind(this);
|
||||||
|
this.publish(
|
||||||
|
GameLib.Event.ANIMATION_COMPILE_SUCCESS,
|
||||||
|
{
|
||||||
|
component : this,
|
||||||
|
type : GameLib.D3.Animation.ANIMATION_FUNCTION_TYPE_TRANSLATION
|
||||||
|
}
|
||||||
|
);
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error);
|
||||||
|
this.publish(
|
||||||
|
GameLib.Event.ANIMATION_COMPILE_FAILED,
|
||||||
|
{
|
||||||
|
component : this
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (property === 'scaleFn') {
|
||||||
|
try {
|
||||||
|
this.instance.scale = new Function('data', this.scaleFn).bind(this);
|
||||||
|
this.publish(
|
||||||
|
GameLib.Event.ANIMATION_COMPILE_SUCCESS,
|
||||||
|
{
|
||||||
|
component : this,
|
||||||
|
type : GameLib.D3.Animation.ANIMATION_FUNCTION_TYPE_SCALE
|
||||||
|
}
|
||||||
|
)
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error);
|
||||||
|
this.publish(
|
||||||
|
GameLib.Event.ANIMATION_COMPILE_FAILED,
|
||||||
|
{
|
||||||
|
component : this
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (property === 'meshes') {
|
||||||
|
GameLib.Event.Emit(
|
||||||
|
GameLib.Event.ANIMATION_MESH_ADDED,
|
||||||
|
{
|
||||||
|
animation : this,
|
||||||
|
mesh : item
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -411,7 +411,7 @@ GameLib.System.GUI.prototype.buildQuaternionControl = function(folder, component
|
||||||
|
|
||||||
GameLib.System.GUI.prototype.buildVectorControl = function(folder, componentTemplate, property) {
|
GameLib.System.GUI.prototype.buildVectorControl = function(folder, componentTemplate, property) {
|
||||||
|
|
||||||
var step = 0.01;
|
var step = 0.00001;
|
||||||
|
|
||||||
var object = componentTemplate.template;
|
var object = componentTemplate.template;
|
||||||
|
|
||||||
|
@ -616,7 +616,7 @@ GameLib.System.GUI.prototype.buildArrayManagerControl = function(
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
component.updateInstance(property);
|
component.updateInstance(property, activeSelection.component);
|
||||||
|
|
||||||
// addArrayItem(activeSelection.component, component[property].length - 1);
|
// addArrayItem(activeSelection.component, component[property].length - 1);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue