Vousk-prod. Posted June 16, 2014 Share Posted June 16, 2014 Hi everyone, The question is in the title Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 16, 2014 Share Posted June 16, 2014 you can just call actionManager.processTrigger(trigger) Quote Link to comment Share on other sites More sharing options...
Wingnut Posted June 21, 2014 Share Posted June 21, 2014 Interesting question, Vousk-prod! If I may, I want to add a couple more questions for the experts... The actionManager acts sort of like a patch panel. It is used to 'wire' or 'attach' a trigger... to an action. Or in the case of using CombineAction... you can wire a trigger, to MANY actions. Question #1: For processTrigger(trigger), does the user need to create a fake trigger object... to use as the arg/parameter? If so, can you tell us how that is done? Thanks. Question #2: Would it be possible to do... processAction(actionNumber). Actions don't have names, but maybe all actions ARE... or some COULD BE... kept in an array. Here's an example:var actionsArray = [];actionsArray.push(new BABYLON.SetValueAction(BABYLON.ActionManager.NoneTrigger, mesh.material, "wireframe", false));actionsArray.push(new BABYLON.InterpolateValueAction(BABYLON.ActionManager.NoneTrigger, light, "diffuse", BABYLON.Color3.Black(), 1000));actionsArray.push(new BABYLON.InterpolateValueAction(BABYLON.ActionManager.NoneTrigger, camera, "alpha", 0, 500, new BABYLON.PredicateCondition(scene.actionManager, function () { return light1.diffuse.equals(BABYLON.Color3.Red(); } )));// notice that all 3 are NoneTrigger... I think that would be a requirement.scene.actionManager.processAction(actionsArray[1]);Essentially, I was wondering if a registered action could be actuated... by calling it manually... without a trigger happening, and without creating a fake trigger. I don't know if such a thing would ever be needed or useful. I am just thinking of stupid stuff, here. I know there is no .processAction function... I went looking already. I realize that the same thing could be done with the processTrigger function... IF the user knows how to create the correct fake trigger for its parameter. I re-invite everyone to carefully read the actionManager tutorial and play around with the actionManager playground demo. There is a ton of things going-on in that demo. Notice that clicking the sphere to rotate the camera to a new location... does not work if light #1 is set .diffuse black? (toggled with a click on the red box) Ain't that cool? Conditions! At my request, Deltakosh added more info to the actionManager tutorial... to teach us more about conditions. He did it well, and it helps show just how very powerful and versatile the actionManager really is. It is an amazing device. I would hate to meet one in a dark alley, because it would be a mighty machine... with many robotic arms, levers, knobs, pistons, actuators, wheels, and smoke stacks. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 21, 2014 Share Posted June 21, 2014 Hey 1.You can call it like this for instance: pickResult.pickedMesh.actionManager.processTrigger(BABYLON.ActionManager.OnPickTrigger, ActionEvent.CreateNew(pickResult.pickedMesh)); 2. AN individual ACtion can be called like this: action.execute() Wingnut 1 Quote Link to comment Share on other sites More sharing options...
Vousk-prod. Posted June 21, 2014 Author Share Posted June 21, 2014 Wow, action.execute() is a very valuable thing !!But for the 1st point I absolutly do not get for what purpose this could be used Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.