lace_gel_0.1.0_2c333035/source/dolly/gel-dolly.ads

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
with
     gel.Camera,
     ada.Containers.Vectors;

package gel.Dolly
--
--  Models a camera dolly.
--
is
   type Item is abstract tagged private;
   type View is access all Item'Class;


   ---------
   --- Forge
   --

   procedure define  (Self : in out Item)   is abstract;
   procedure destroy (Self : in out Item)   is abstract;

   procedure free    (Self : in out View);


   --------------
   --- Attributes
   --

   type Direction is (Left, Right, Up, Down, Forward, Backward);

   procedure add_Camera           (Self : in out Item'Class;   the_Camera : in Camera.view);

   procedure is_moving            (Self : in out Item'Class;   Direction : dolly.Direction;   Now : in Boolean := True);
   procedure is_spinning          (Self : in out Item'Class;   Direction : dolly.Direction;   Now : in Boolean := True);
   procedure is_orbiting          (Self : in out Item'Class;   Direction : dolly.Direction;   Now : in Boolean := True);

   function  Speed                (Self : in     Item)       return math.Real;
   procedure Speed_is             (Self : in out Item;   Now   : in math.Real);
   procedure speed_Multiplier_is  (Self : in out Item;   Now   : in math.Real);

   procedure allow_linear_Motion  (Self : in out Item;   Allow : in Boolean) is null;
   procedure allow_orbital_Motion (Self : in out Item;   Allow : in Boolean) is null;


   --------------
   --- Operations
   --

   procedure freshen (Self : in out Item) is abstract;



private

   use type gel.Camera.view;
   package camera_Vectors is new ada.Containers.Vectors (Positive, gel.Camera.view);
   subtype camera_Vector  is     camera_Vectors.Vector;

   type Direction_Flags is array (Direction) of Boolean;


   type Item is abstract tagged
      record
         Cameras    : camera_Vector;

         Motion     : Direction_Flags := (others => False);
         Spin       : Direction_Flags := (others => False);
         Orbit      : Direction_Flags := (others => False);

         Speed      : math.Real       := 1.0;
         Multiplier : math.Real       := 1.0;     -- Applied to speed.
      end record;


end gel.Dolly;