Changes between Version 4 and Version 5 of Atlas_Manual_Cinematics_Tab


Ignore:
Timestamp:
Jul 18, 2017, 12:45:19 PM (7 years ago)
Author:
Vladislav Belov
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Atlas_Manual_Cinematics_Tab

    v4 v5  
    88''The contents of the Cinematics Tab''
    99
    10 == ==
     10== Terms ==
     11Currently all paths contain position and target nodes. **Position nodes** - nodes used for the camera position. **Target nodes** - nodes used for the camera focus position. In other words the camera looks from positions to targets. **Delta time** - time between nodes which the camera spends to move from the one node to the other node.
    1112
    1213== Common settings ==
     
    4041
    4142To delete a node, select it and press a `Delete` button on the keyboard. If you need to edit delta times, you could edit nodes in a map XML file (atlas editing for delta times will be added later).
     43
     44== Triggers and on fly paths ==
     45
     46Currently there is no way to run a cinema path without a trigger script, but this possibility will be added later.
     47
     48=== Run cinema path ===
     49
     50An example trigger script to run an existing cinema path in 5 seconds:
     51
     52{{{
     53#!javascript
     54Trigger.prototype.StartCutscene = function(data)
     55{
     56        var cmpCinemaManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_CinemaManager);
     57        // We should work only with valid components
     58        if (!cmpCinemaManager)
     59                return;
     60        // Add a cinema path with "test" name to the queue
     61        cmpCinemaManager.AddCinemaPathToQueue("MyPath");
     62        // Start playing the queue
     63        cmpCinemaManager.Play();
     64};
     65
     66var cmpTrigger = Engine.QueryInterface(SYSTEM_ENTITY, IID_Trigger);
     67cmpTrigger.DoAfterDelay(5000, "StartCutscene", {}); // Delay is set in milliseconds
     68}}}
     69
     70=== Add cinema path in triggers ===
     71
     72{{{
     73#!javascript
     74Trigger.prototype.StartCutscene = function(data)
     75{
     76        var cmpCinemaManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_CinemaManager);
     77        // We should work only with valid components
     78        if (!cmpCinemaManager)
     79                return;
     80
     81        let pointA = new Vector3D(1, 1, 1);
     82        let pointB = new Vector3D(100, 100, 100);
     83        let path = {
     84                "name": "MyPath",
     85                "orientation": "target",
     86                "positionNodes": [
     87                        {"deltaTime": 0, "position": pointA},
     88                        {"deltaTime": 10, "position": pointB}
     89                ],
     90                "targetNodes": [
     91                        {"deltaTime": 0, "position": Vector3D.add(pointA, new Vector3D(10, 10, 0))},
     92                        {"deltaTime": 10, "position": Vector3D.add(pointB, new Vector3D(10, 10, 0))}
     93                ]
     94        };
     95
     96        // Add the newly created path
     97        cmpCinemaManager.AddPath(path);
     98        cmpCinemaManager.AddCinemaPathToQueue(path.name);
     99
     100        // Start playing the queue
     101        cmpCinemaManager.Play();
     102};
     103
     104var cmpTrigger = Engine.QueryInterface(SYSTEM_ENTITY, IID_Trigger);
     105cmpTrigger.DoAfterDelay(5000, "StartCutscene", {}); // Delay is set in milliseconds
     106}}}