- constructor(public source: AbstractMesh, public pointerX: number, public pointerY: number, public meshUnderPointer: AbstractMesh, public sourceEvent?: any) {
-
- }
-
- public static CreateNew(source: AbstractMesh): ActionEvent {
- var scene = source.getScene();
- return new ActionEvent(source, scene.pointerX, scene.pointerY, scene.meshUnderPointer);
- }
-
- public static CreateNewFromScene(scene: Scene, evt:Event): ActionEvent {
- return new ActionEvent(null, scene.pointerX, scene.pointerY, scene.meshUnderPointer, evt);
- }
- }
-
- export class ActionManager {
- // Statics
- private static _NothingTrigger = 0;
- private static _OnPickTrigger = 1;
- private static _OnLeftPickTrigger = 2;
- private static _OnRightPickTrigger = 3;
- private static _OnCenterPickTrigger = 4;
- private static _OnPointerOverTrigger = 5;
- private static _OnPointerOutTrigger = 6;
- private static _OnEveryFrameTrigger = 7;
- private static _OnIntersectionEnterTrigger = 8;
- private static _OnIntersectionExitTrigger = 9;
- private static _OnKeyDownTrigger = 10;
- private static _OnKeyUpTrigger = 11;
-
- public static get NothingTrigger(): number {
- return ActionManager._NothingTrigger;
- }
-
- public static get OnPickTrigger(): number {
- return ActionManager._OnPickTrigger;
- }
-
- public static get OnLeftPickTrigger(): number {
- return ActionManager._OnLeftPickTrigger;
- }
-
- public static get OnRightPickTrigger(): number {
- return ActionManager._OnRightPickTrigger;
- }
-
- public static get OnCenterPickTrigger(): number {
- return ActionManager._OnCenterPickTrigger;
- }
-
- public static get OnPointerOverTrigger(): number {
- return ActionManager._OnPointerOverTrigger;
- }
-
- public static get OnPointerOutTrigger(): number {
- return ActionManager._OnPointerOutTrigger;
- }
-
- public static get OnEveryFrameTrigger(): number {
- return ActionManager._OnEveryFrameTrigger;
- }
-
- public static get OnIntersectionEnterTrigger(): number {
- export class InterpolateValueAction extends Action {
- private _target: any;
- private _property: string;
-
- constructor(triggerOptions: any, target: any, public propertyPath: string, public value: any, public duration: number = 1000, condition?: Condition, public stopOtherAnimations?: boolean) {
- constructor(scene: Scene, public target, public fromFrame: number = 0, public toFrame: number = 100, public loopAnimation: boolean = false, public speedRatio: number = 1.0, public onAnimationEnd?, animations?: any) {
- if (animations) {
- this.appendAnimations(target, animations);
- }
-
- this._scene = scene;
- scene._activeAnimatables.push(this);
- }
-
- // Methods
- public appendAnimations(target: any, animations: Animation[]): void {
- for (var index = 0; index < animations.length; index++) {
- var animation = animations[index];
-
- animation._target = target;
- this._animations.push(animation);
- }
- }
-
- public getAnimationByTargetProperty(property: string) {
- var animations = this._animations;
-
- for (var index = 0; index < animations.length; index++) {
- if (animations[index].targetProperty === property) {
- return animations[index];
- }
- }
-
- return null;
- }
-
- public pause(): void {
- if (this._paused) {
- return;
- }
- this._paused = true;
- }
-
- public restart(): void {
- this._paused = false;
- }
-
- public stop(): void {
- var index = this._scene._activeAnimatables.indexOf(this);
- Effect.prototype.setFloat3 = function (uniformName, x, y, z) {
- if (this._valueCache[uniformName] && this._valueCache[uniformName][0] == x && this._valueCache[uniformName][1] == y && this._valueCache[uniformName][2] == z)
- return this;
-
- this._cacheFloat3(uniformName, x, y, z);
- this._engine.setFloat3(this.getUniform(uniformName), x, y, z);
-
- return this;
- };
-
- Effect.prototype.setFloat4 = function (uniformName, x, y, z, w) {
- if (this._valueCache[uniformName] && this._valueCache[uniformName][0] == x && this._valueCache[uniformName][1] == y && this._valueCache[uniformName][2] == z && this._valueCache[uniformName][3] == w)
- return this;
-
- this._cacheFloat4(uniformName, x, y, z, w);
- this._engine.setFloat4(this.getUniform(uniformName), x, y, z, w);
-
- return this;
- };
-
- Effect.prototype.setColor3 = function (uniformName, color3) {
- if (this._valueCache[uniformName] && this._valueCache[uniformName][0] == x && this._valueCache[uniformName][1] == y && this._valueCache[uniformName][2] == z)
- return this;
-
- this._cacheFloat3(uniformName, x, y, z);
- this._engine.setFloat3(this.getUniform(uniformName), x, y, z);
- if (this._valueCache[uniformName] && this._valueCache[uniformName][0] == x && this._valueCache[uniformName][1] == y && this._valueCache[uniformName][2] == z && this._valueCache[uniformName][3] == w)
- return this;
-
- this._cacheFloat4(uniformName, x, y, z, w);
- this._engine.setFloat4(this.getUniform(uniformName), x, y, z, w);
-
- return this;
- }
-
- public setColor3(uniformName: string, color3: Color3): Effect {