Cosmetics.
This commit is contained in:
@@ -197,7 +197,7 @@ begin
|
|||||||
is
|
is
|
||||||
pragma Unreferenced (Self);
|
pragma Unreferenced (Self);
|
||||||
the_Event : gel.Keyboard.key_press_Event renames gel.Keyboard.key_press_Event (to_Event);
|
the_Event : gel.Keyboard.key_press_Event renames gel.Keyboard.key_press_Event (to_Event);
|
||||||
the_Key : constant gel.keyboard.Key := the_Event.modified_Key.Key;
|
the_Key : constant gel.keyboard.Key := the_Event.modified_Key.Key;
|
||||||
begin
|
begin
|
||||||
case the_Key
|
case the_Key
|
||||||
is
|
is
|
||||||
@@ -220,7 +220,7 @@ begin
|
|||||||
is
|
is
|
||||||
pragma Unreferenced (Self);
|
pragma Unreferenced (Self);
|
||||||
the_Event : gel.Keyboard.key_release_Event renames gel.Keyboard.key_release_Event (to_Event);
|
the_Event : gel.Keyboard.key_release_Event renames gel.Keyboard.key_release_Event (to_Event);
|
||||||
the_Key : constant gel.keyboard.Key := the_Event.modified_Key.Key;
|
the_Key : constant gel.keyboard.Key := the_Event.modified_Key.Key;
|
||||||
begin
|
begin
|
||||||
case the_Key
|
case the_Key
|
||||||
is
|
is
|
||||||
@@ -247,16 +247,17 @@ begin
|
|||||||
the_key_release_Response : aliased key_release_Response;
|
the_key_release_Response : aliased key_release_Response;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
-------------------
|
||||||
--- Setup the game.
|
--- Setup the game.
|
||||||
--
|
--
|
||||||
|
|
||||||
Box.pack_Start (window_gl_Area);
|
Box.pack_Start (window_gl_Area);
|
||||||
|
|
||||||
|
|
||||||
-- Show the window and present it.
|
-- Show the window.
|
||||||
--
|
--
|
||||||
top_Window.Show_All;
|
top_Window.show_All;
|
||||||
top_Window.Present;
|
-- top_Window.present;
|
||||||
|
|
||||||
the_Applet.Camera. Site_is ([0.0, 0.0, 20.0]);
|
the_Applet.Camera. Site_is ([0.0, 0.0, 20.0]);
|
||||||
the_Applet.World.Gravity_is ([0.0, 0.0, 0.0]);
|
the_Applet.World.Gravity_is ([0.0, 0.0, 0.0]);
|
||||||
|
|||||||
@@ -108,10 +108,13 @@ is
|
|||||||
end new_client_Applet;
|
end new_client_Applet;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-----------
|
-----------
|
||||||
--- Sprites
|
--- Sprites
|
||||||
--
|
--
|
||||||
|
|
||||||
|
-----
|
||||||
-- 2D
|
-- 2D
|
||||||
--
|
--
|
||||||
|
|
||||||
@@ -161,12 +164,13 @@ is
|
|||||||
|
|
||||||
|
|
||||||
function new_polygon_Sprite (in_World : in gel.World.view;
|
function new_polygon_Sprite (in_World : in gel.World.view;
|
||||||
Site : in math.Vector_2 := math.Origin_2D;
|
Site : in math.Vector_2 := math.Origin_2D;
|
||||||
Mass : in math.Real := 1.0;
|
Mass : in math.Real := 1.0;
|
||||||
Friction : in math.Real := 0.5;
|
Friction : in math.Real := 0.5;
|
||||||
Bounce : in math.Real := 0.5;
|
Bounce : in math.Real := 0.5;
|
||||||
Vertices : in Geometry_2d.Sites;
|
Vertices : in Geometry_2d.Sites;
|
||||||
Color : in openGL.Color := opengl.Palette.White;
|
Color : in openGL.Color := opengl.Palette.White;
|
||||||
|
Texture : in openGL.asset_Name := openGL.null_Asset;
|
||||||
user_Data : in any_user_Data_view := null) return gel.Sprite.view
|
user_Data : in any_user_Data_view := null) return gel.Sprite.view
|
||||||
is
|
is
|
||||||
use Math;
|
use Math;
|
||||||
@@ -208,6 +212,7 @@ is
|
|||||||
Width,
|
Width,
|
||||||
Height : in math.Real;
|
Height : in math.Real;
|
||||||
Color : in openGL.Color := opengl.Palette.White;
|
Color : in openGL.Color := opengl.Palette.White;
|
||||||
|
Texture : in openGL.asset_Name := openGL.null_Asset;
|
||||||
user_Data : in any_user_Data_view := null) return gel.Sprite.view
|
user_Data : in any_user_Data_view := null) return gel.Sprite.view
|
||||||
is
|
is
|
||||||
use Math;
|
use Math;
|
||||||
@@ -220,11 +225,12 @@ is
|
|||||||
[ half_Width, half_Height],
|
[ half_Width, half_Height],
|
||||||
[-half_Width, half_Height]];
|
[-half_Width, half_Height]];
|
||||||
begin
|
begin
|
||||||
return new_polygon_Sprite (in_World, Site, Mass, Friction, Bounce, the_Vertices, Color, user_Data);
|
return new_polygon_Sprite (in_World, Site, Mass, Friction, Bounce, the_Vertices, Color, Texture, user_Data);
|
||||||
end new_rectangle_Sprite;
|
end new_rectangle_Sprite;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
-----
|
||||||
-- 3D
|
-- 3D
|
||||||
--
|
--
|
||||||
|
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ is
|
|||||||
Bounce : in math.Real := 0.5;
|
Bounce : in math.Real := 0.5;
|
||||||
Vertices : in Geometry_2d.Sites;
|
Vertices : in Geometry_2d.Sites;
|
||||||
Color : in openGL.Color := opengl.Palette.White;
|
Color : in openGL.Color := opengl.Palette.White;
|
||||||
|
Texture : in openGL.asset_Name := openGL.null_Asset;
|
||||||
user_Data : in any_user_Data_view := null) return gel.Sprite.view;
|
user_Data : in any_user_Data_view := null) return gel.Sprite.view;
|
||||||
|
|
||||||
function new_rectangle_Sprite (in_World : in gel.World.view;
|
function new_rectangle_Sprite (in_World : in gel.World.view;
|
||||||
@@ -80,6 +81,7 @@ is
|
|||||||
Width,
|
Width,
|
||||||
Height : in math.Real;
|
Height : in math.Real;
|
||||||
Color : in openGL.Color := opengl.Palette.White;
|
Color : in openGL.Color := opengl.Palette.White;
|
||||||
|
Texture : in openGL.asset_Name := openGL.null_Asset;
|
||||||
user_Data : in any_user_Data_view := null) return gel.Sprite.view;
|
user_Data : in any_user_Data_view := null) return gel.Sprite.view;
|
||||||
-- 3D
|
-- 3D
|
||||||
--
|
--
|
||||||
|
|||||||
@@ -365,6 +365,9 @@ is
|
|||||||
end loop;
|
end loop;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
of_World.register (the_Mirror => Self,
|
||||||
|
Mirror_as_observer => Self);
|
||||||
end is_a_Mirror;
|
end is_a_Mirror;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ is
|
|||||||
|
|
||||||
procedure log (Message : in String)
|
procedure log (Message : in String)
|
||||||
renames ada.text_IO.put_Line;
|
renames ada.text_IO.put_Line;
|
||||||
pragma Unreferenced (log);
|
-- pragma Unreferenced (log);
|
||||||
|
|
||||||
|
|
||||||
---------
|
---------
|
||||||
@@ -80,7 +80,7 @@ is
|
|||||||
|
|
||||||
Self : constant gel.World.server.view
|
Self : constant gel.World.server.view
|
||||||
:= new gel.World.server.item' (to_Subject_and_Observer (name => Name & " world" & Id'Image)
|
:= new gel.World.server.item' (to_Subject_and_Observer (name => Name & " world" & Id'Image)
|
||||||
with others => <>);
|
with others => <>);
|
||||||
begin
|
begin
|
||||||
Self.define (Name, Id, space_Kind, Renderer);
|
Self.define (Name, Id, space_Kind, Renderer);
|
||||||
return Self;
|
return Self;
|
||||||
@@ -127,6 +127,7 @@ is
|
|||||||
|
|
||||||
return the_Sprite;
|
return the_Sprite;
|
||||||
end to_Sprite;
|
end to_Sprite;
|
||||||
|
|
||||||
pragma Unreferenced (to_Sprite);
|
pragma Unreferenced (to_Sprite);
|
||||||
|
|
||||||
|
|
||||||
@@ -186,6 +187,8 @@ is
|
|||||||
while has_Element (Cursor)
|
while has_Element (Cursor)
|
||||||
loop
|
loop
|
||||||
the_Sprite := Sprite.view (Element (Cursor));
|
the_Sprite := Sprite.view (Element (Cursor));
|
||||||
|
-- the_Sprite.apply_Force ([0.0, 1.0, 0.0]);
|
||||||
|
-- the_Sprite.apply_Torque_impulse ([0.0, 1.0, 0.0]);
|
||||||
|
|
||||||
updates_Count := updates_Count + 1;
|
updates_Count := updates_Count + 1;
|
||||||
the_motion_Updates (updates_Count) := (Id => the_Sprite.Id,
|
the_motion_Updates (updates_Count) := (Id => the_Sprite.Id,
|
||||||
@@ -194,6 +197,7 @@ is
|
|||||||
-- Spin => the_Sprite.Spin);
|
-- Spin => the_Sprite.Spin);
|
||||||
|
|
||||||
-- log (Image (Quaternion' (refined (the_motion_Updates (updates_Count).Spin))));
|
-- log (Image (Quaternion' (refined (the_motion_Updates (updates_Count).Spin))));
|
||||||
|
ada.Text_IO.put (refined (the_motion_Updates (updates_Count).Site)'Image);
|
||||||
|
|
||||||
next (Cursor);
|
next (Cursor);
|
||||||
end loop;
|
end loop;
|
||||||
|
|||||||
Reference in New Issue
Block a user