|
@@ -1,4 +1,4 @@
|
|
-import { IDisposable } from 'scene';
|
|
|
|
|
|
+import { IDisposable } from '../scene';
|
|
import { IActionEvent } from './actionEvent';
|
|
import { IActionEvent } from './actionEvent';
|
|
import { IAction } from './action';
|
|
import { IAction } from './action';
|
|
import { Constants } from "../Engines/constants";
|
|
import { Constants } from "../Engines/constants";
|
|
@@ -9,106 +9,6 @@ import { Constants } from "../Engines/constants";
|
|
* @see http://doc.babylonjs.com/how_to/how_to_use_actions
|
|
* @see http://doc.babylonjs.com/how_to/how_to_use_actions
|
|
*/
|
|
*/
|
|
export abstract class AbstractActionManager implements IDisposable {
|
|
export abstract class AbstractActionManager implements IDisposable {
|
|
- /**
|
|
|
|
- * Nothing
|
|
|
|
- * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
|
|
|
|
- */
|
|
|
|
- public static readonly NothingTrigger = Constants.ACTION_NothingTrigger;
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * On pick
|
|
|
|
- * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
|
|
|
|
- */
|
|
|
|
- public static readonly OnPickTrigger = Constants.ACTION_OnPickTrigger;
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * On left pick
|
|
|
|
- * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
|
|
|
|
- */
|
|
|
|
- public static readonly OnLeftPickTrigger = Constants.ACTION_OnLeftPickTrigger;
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * On right pick
|
|
|
|
- * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
|
|
|
|
- */
|
|
|
|
- public static readonly OnRightPickTrigger = Constants.ACTION_OnRightPickTrigger;
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * On center pick
|
|
|
|
- * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
|
|
|
|
- */
|
|
|
|
- public static readonly OnCenterPickTrigger = Constants.ACTION_OnCenterPickTrigger;
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * On pick down
|
|
|
|
- * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
|
|
|
|
- */
|
|
|
|
- public static readonly OnPickDownTrigger = Constants.ACTION_OnPickDownTrigger;
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * On double pick
|
|
|
|
- * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
|
|
|
|
- */
|
|
|
|
- public static readonly OnDoublePickTrigger = Constants.ACTION_OnDoublePickTrigger;
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * On pick up
|
|
|
|
- * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
|
|
|
|
- */
|
|
|
|
- public static readonly OnPickUpTrigger = Constants.ACTION_OnPickUpTrigger;
|
|
|
|
- /**
|
|
|
|
- * On pick out.
|
|
|
|
- * This trigger will only be raised if you also declared a OnPickDown
|
|
|
|
- * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
|
|
|
|
- */
|
|
|
|
- public static readonly OnPickOutTrigger = Constants.ACTION_OnPickOutTrigger;
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * On long press
|
|
|
|
- * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
|
|
|
|
- */
|
|
|
|
- public static readonly OnLongPressTrigger = Constants.ACTION_OnLongPressTrigger;
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * On pointer over
|
|
|
|
- * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
|
|
|
|
- */
|
|
|
|
- public static readonly OnPointerOverTrigger = Constants.ACTION_OnPointerOverTrigger;
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * On pointer out
|
|
|
|
- * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
|
|
|
|
- */
|
|
|
|
- public static readonly OnPointerOutTrigger = Constants.ACTION_OnPointerOutTrigger;
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * On every frame
|
|
|
|
- * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
|
|
|
|
- */
|
|
|
|
- public static readonly OnEveryFrameTrigger = Constants.ACTION_OnEveryFrameTrigger;
|
|
|
|
- /**
|
|
|
|
- * On intersection enter
|
|
|
|
- * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
|
|
|
|
- */
|
|
|
|
- public static readonly OnIntersectionEnterTrigger = Constants.ACTION_OnIntersectionEnterTrigger;
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * On intersection exit
|
|
|
|
- * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
|
|
|
|
- */
|
|
|
|
- public static readonly OnIntersectionExitTrigger = Constants.ACTION_OnIntersectionExitTrigger;
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * On key down
|
|
|
|
- * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
|
|
|
|
- */
|
|
|
|
- public static readonly OnKeyDownTrigger = Constants.ACTION_OnKeyDownTrigger;
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * On key up
|
|
|
|
- * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
|
|
|
|
- */
|
|
|
|
- public static readonly OnKeyUpTrigger = 15;
|
|
|
|
|
|
|
|
/** Gets the list of active triggers */
|
|
/** Gets the list of active triggers */
|
|
public static Triggers: { [key: string]: number } = {};
|
|
public static Triggers: { [key: string]: number } = {};
|
|
@@ -191,7 +91,7 @@ export abstract class AbstractActionManager implements IDisposable {
|
|
for (var t in AbstractActionManager.Triggers) {
|
|
for (var t in AbstractActionManager.Triggers) {
|
|
if (AbstractActionManager.Triggers.hasOwnProperty(t)) {
|
|
if (AbstractActionManager.Triggers.hasOwnProperty(t)) {
|
|
let t_int = parseInt(t);
|
|
let t_int = parseInt(t);
|
|
- if (t_int >= AbstractActionManager.OnPickTrigger && t_int <= AbstractActionManager.OnPickUpTrigger) {
|
|
|
|
|
|
+ if (t_int >= Constants.ACTION_OnPickTrigger && t_int <= Constants.ACTION_OnPickUpTrigger) {
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
}
|
|
}
|