diff --git a/3-mid/opengl/source/lean/geometry/opengl-geometry-lit_colored_textured.ads b/3-mid/opengl/source/lean/geometry/opengl-geometry-lit_colored_textured.ads index 24f1b50..e3f24ef 100644 --- a/3-mid/opengl/source/lean/geometry/opengl-geometry-lit_colored_textured.ads +++ b/3-mid/opengl/source/lean/geometry/opengl-geometry-lit_colored_textured.ads @@ -1,7 +1,7 @@ with openGL.texture_Set; -private +-- private with openGL.Geometry.texturing; @@ -11,7 +11,11 @@ package openGL.Geometry.lit_colored_textured -- Supports 'per-vertex' site, color, texture and lighting. -- is - type Item is new openGL.Geometry.item with private; + package textured_Geometry is new texturing.Mixin; + + + -- type Item is new openGL.Geometry.item with private; + type Item is new textured_Geometry.item with private; type View is access all Item'Class; function new_Geometry (texture_is_Alpha : in Boolean) return access Geometry.lit_colored_textured.item'Class; @@ -65,9 +69,6 @@ is private - package textured_Geometry is new texturing.Mixin; - - type Item is new textured_Geometry.item with record null; diff --git a/3-mid/opengl/source/lean/geometry/opengl-geometry-texturing.ads b/3-mid/opengl/source/lean/geometry/opengl-geometry-texturing.ads index 1e4f496..e1a6e47 100644 --- a/3-mid/opengl/source/lean/geometry/opengl-geometry-texturing.ads +++ b/3-mid/opengl/source/lean/geometry/opengl-geometry-texturing.ads @@ -8,7 +8,7 @@ with openGL.Model; -private +-- private package openGL.Geometry.texturing -- -- Provides texturing support for geometries. diff --git a/3-mid/opengl/source/lean/model/opengl-model-capsule-textured.adb b/3-mid/opengl/source/lean/model/opengl-model-capsule-textured.adb index 9fbc4d8..d480ac2 100644 --- a/3-mid/opengl/source/lean/model/opengl-model-capsule-textured.adb +++ b/3-mid/opengl/source/lean/model/opengl-model-capsule-textured.adb @@ -13,6 +13,7 @@ is function new_Capsule (Radius : in Real; Height : in Real; + texture_Details : in texture_Set.Details; Image : in asset_Name := null_Asset) return View is Self : constant View := new Item; @@ -21,6 +22,8 @@ is Self.Height := Height; Self.Image := Image; + Self.texture_Details_is (texture_Details); + return Self; end new_Capsule; @@ -368,6 +371,10 @@ is cap_2_Geometry := new_Cap (is_Fore => False); end; + the_shaft_Geometry.Model_is (Self.all'unchecked_Access); + cap_1_Geometry .Model_is (Self.all'unchecked_Access); + cap_2_Geometry .Model_is (Self.all'unchecked_Access); + return (1 => the_shaft_Geometry.all'Access, 2 => cap_1_Geometry.all'Access, 3 => cap_2_Geometry.all'Access); diff --git a/3-mid/opengl/source/lean/model/opengl-model-capsule-textured.ads b/3-mid/opengl/source/lean/model/opengl-model-capsule-textured.ads index 2b09ac1..7785d04 100644 --- a/3-mid/opengl/source/lean/model/opengl-model-capsule-textured.ads +++ b/3-mid/opengl/source/lean/model/opengl-model-capsule-textured.ads @@ -1,5 +1,6 @@ with - openGL.Geometry; + openGL.Geometry, + openGL.Model.texturing; package openGL.Model.capsule.textured @@ -7,8 +8,10 @@ package openGL.Model.capsule.textured -- Models a textured capsule. -- is - type Item is new Model.capsule.item with private; - type View is access all Item'Class; + -- type Item is new Model.capsule.item with private; + package textured_Model is new texturing.Mixin (openGL.Model.capsule.item); + + type Item is new textured_Model.textured_item with private; type View is access all Item'Class; --------- @@ -17,6 +20,7 @@ is function new_Capsule (Radius : in Real; Height : in Real; + texture_Details : in texture_Set.Details; Image : in asset_Name := null_Asset) return View; -------------- @@ -31,7 +35,8 @@ is private - type Item is new Model.capsule.item with + -- type Item is new Model.capsule.item with + type Item is new textured_Model.textured_item with record Radius : Real; Height : Real; diff --git a/3-mid/opengl/source/lean/model/opengl-model-circle-lit_textured.adb b/3-mid/opengl/source/lean/model/opengl-model-circle-lit_textured.adb index 998c52d..92f4c4c 100644 --- a/3-mid/opengl/source/lean/model/opengl-model-circle-lit_textured.adb +++ b/3-mid/opengl/source/lean/model/opengl-model-circle-lit_textured.adb @@ -3,6 +3,8 @@ with openGL.Primitive.indexed, openGL.Texture.Coordinates; +with ada.Text_IO; use ada.Text_IO; + package body openGL.Model.circle.lit_textured is @@ -83,6 +85,9 @@ is for i in 1 .. Self.texture_Details.texture_Count loop + put_Line ("KKK" & Self.texture_Details'Image); + + Id := texture_Id (i); the_Geometry.Fade_is (which => Id, diff --git a/3-mid/opengl/source/lean/model/opengl-model-sphere-textured.adb b/3-mid/opengl/source/lean/model/opengl-model-sphere-textured.adb index 50c9411..f7f2845 100644 --- a/3-mid/opengl/source/lean/model/opengl-model-sphere-textured.adb +++ b/3-mid/opengl/source/lean/model/opengl-model-sphere-textured.adb @@ -15,6 +15,7 @@ is lat_Count : in Positive := 26; long_Count : in Positive := 52; Image : in asset_Name := null_Asset; + texture_Details : in texture_Set.Details; is_Skysphere : in Boolean := False) return View is Self : constant View := new Item; @@ -26,6 +27,8 @@ is Self.define (Radius); + Self.texture_Details_is (texture_Details); + return Self; end new_Sphere; @@ -196,6 +199,8 @@ is the_Geometry.add (Primitive.view (the_Primitive)); end; + the_Geometry.Model_is (Self.all'unchecked_Access); + return [1 => Geometry.view (the_Geometry)]; end to_GL_Geometries; diff --git a/3-mid/opengl/source/lean/model/opengl-model-sphere-textured.ads b/3-mid/opengl/source/lean/model/opengl-model-sphere-textured.ads index ae4fcdc..a699c80 100644 --- a/3-mid/opengl/source/lean/model/opengl-model-sphere-textured.ads +++ b/3-mid/opengl/source/lean/model/opengl-model-sphere-textured.ads @@ -1,6 +1,7 @@ with openGL.Font, - openGL.Geometry; + openGL.Geometry, + openGL.Model.texturing; package openGL.Model.sphere.textured @@ -8,7 +9,10 @@ package openGL.Model.sphere.textured -- Models a textured sphere. -- is - type Item is new Model.sphere.item with private; + package textured_Model is new texturing.Mixin (openGL.Model.sphere.item); + + type Item is new textured_Model.textured_item with private; + -- type Item is new Model.sphere.item with private; type View is access all Item'Class; @@ -20,6 +24,7 @@ is lat_Count : in Positive := 26; long_Count : in Positive := 52; Image : in asset_Name := null_Asset; + texture_Details : in texture_Set.Details; is_Skysphere : in Boolean := False) return View; -------------- @@ -33,7 +38,8 @@ is private - type Item is new Model.sphere.item with + -- type Item is new Model.sphere.item with + type Item is new textured_Model.textured_item with record Image : asset_Name := null_Asset; -- Usually a mercator projection to be mapped onto the sphere. is_Skysphere : Boolean := False; diff --git a/3-mid/opengl/source/lean/model/opengl-model-text-lit_colored.adb b/3-mid/opengl/source/lean/model/opengl-model-text-lit_colored.adb index f34ca08..28afe43 100644 --- a/3-mid/opengl/source/lean/model/opengl-model-text-lit_colored.adb +++ b/3-mid/opengl/source/lean/model/opengl-model-text-lit_colored.adb @@ -81,14 +81,14 @@ is is pragma unreferenced (Textures); - -- text_Scale : constant Vector_3 := [2.0 * 4.0 / 78.0, -- TODO: Fix scaling. - -- 2.0 * 4.0 / 95.0, - -- 1.0 / 1.0]; - - text_Scale : constant Vector_3 := [1.0 * 1.0 / 78.0, -- TODO: Fix scaling. - 1.0 * 1.0 / 95.0, + text_Scale : constant Vector_3 := [2.0 * 4.0 / 78.0, -- TODO: Fix scaling. + 2.0 * 4.0 / 95.0, 1.0 / 1.0]; + -- text_Scale : constant Vector_3 := [1.0 * 1.0 / 78.0, -- TODO: Fix scaling. + -- 1.0 * 1.0 / 95.0, + -- 1.0 / 1.0]; + begin if Self.Text.all = "" then @@ -290,6 +290,8 @@ is the_Geometry.Model_is (Self.all'unchecked_Access); the_Geometry.is_Transparent; + -- the_Geometry.texture_Details_is (openGL.texture_Set.to_Details ([1 => to_Asset ("assets/textures/Face1.bmp")])); + return [1 => Geometry.view (the_Geometry)]; end; end to_GL_Geometries; diff --git a/3-mid/opengl/source/lean/shader/opengl-shader.adb b/3-mid/opengl/source/lean/shader/opengl-shader.adb index f291663..19ff640 100644 --- a/3-mid/opengl/source/lean/shader/opengl-shader.adb +++ b/3-mid/opengl/source/lean/shader/opengl-shader.adb @@ -137,8 +137,8 @@ is is the_Source : aliased constant C.char_array := to_C_char_array (shader_Filename); begin - put_Line ("SHADER NAME: " & shader_Filename); - put_Line (interfaces.C.to_Ada (the_Source)); + -- put_Line ("SHADER NAME: " & shader_Filename); + -- put_Line (interfaces.C.to_Ada (the_Source)); create_Shader (Self, Kind, the_Source); end define; diff --git a/4-high/gel/applet/demo/distributed/dsa/builder b/4-high/gel/applet/demo/distributed/dsa/builder index eb0f8f7..362aa36 100755 --- a/4-high/gel/applet/demo/distributed/dsa/builder +++ b/4-high/gel/applet/demo/distributed/dsa/builder @@ -13,11 +13,20 @@ gprclean -r -P ../gel_demo.gpr -Xrestrictions=xgc -Xopengl_platform=egl -Xopengl ## Build # mkdir --parents dsa/x86_64-unknown-linux-gnu/obj -cp /usr/lib/gcc/x86_64-pc-linux-gnu/13.2.1/adalib/a-sttebu.ali \ +cp /usr/lib/gcc/x86_64-pc-linux-gnu/15.1.1/adalib/a-sttebu.ali \ dsa/x86_64-unknown-linux-gnu/obj set +e -po_gnatdist -Xrestrictions=xgc -Xopengl_platform=egl -Xopengl_profile=lean -P demo_dsa.gpr simple_dsa.cfg +po_gnatdist -Xrestrictions=xgc \ + -Xopengl_platform=egl \ + -Xopengl_profile=lean \ + -P demo_dsa.gpr \ + simple_dsa.cfg \ + -cargs \ + -I$LACE/3-mid/physics/implement/box2d/contrib/include \ + -g \ + -largs \ + -g set -e @@ -27,3 +36,8 @@ cp dsa/x86_64-unknown-linux-gnu/obj/*.o dsa/x86_64-unknown-linux-gnu/partition cp dsa/x86_64-unknown-linux-gnu/obj/*.o dsa/x86_64-unknown-linux-gnu/partitions/simple_dsa/client_partition po_gnatdist -Xrestrictions=xgc -Xopengl_platform=egl -Xopengl_profile=lean -P demo_dsa.gpr simple_dsa.cfg + + +cp bin/server_partition test/test_server +cp bin/client_partition test/test_client_1 +cp bin/client_partition test/test_client_2 diff --git a/4-high/gel/applet/demo/distributed/gel_demo_client.adb b/4-high/gel/applet/demo/distributed/gel_demo_client.adb index f198831..9a98fc6 100644 --- a/4-high/gel/applet/demo/distributed/gel_demo_client.adb +++ b/4-high/gel/applet/demo/distributed/gel_demo_client.adb @@ -67,7 +67,8 @@ is -- Close. -- - gel_demo_services.World.deregister (the_mirror => the_Applet.client_World.all'access); + gel_demo_services.World.deregister (the_Mirror => the_Applet.client_World.all'access, + Mirror_as_Observer => the_Applet.client_World.all'access); the_Applet.destroy; gel_demo_Server.item.stop; diff --git a/4-high/gel/applet/demo/full/launch_full_demo.adb b/4-high/gel/applet/demo/full/launch_full_demo.adb index 26495d4..e4513e4 100644 --- a/4-high/gel/applet/demo/full/launch_full_demo.adb +++ b/4-high/gel/applet/demo/full/launch_full_demo.adb @@ -11,6 +11,7 @@ with openGL.Model.capsule.textured, openGL.Model.any, openGL.Model.terrain, + openGL.texture_Set, openGL.IO, openGL.Light, openGL.Palette; @@ -35,11 +36,12 @@ is procedure put_Line (Message : in String) is - Text : constant gel.Sprite.view := gel.Forge.new_text_Sprite (the_Applet.gui_World, - text_line_Site, - Message, - the_Applet.Font, - White); + Text : constant gel.Sprite.view := gel.Forge.new_text_Sprite (in_World => the_Applet.gui_World, + Site => text_line_Site, + Spin => Identity_3x3, + Text => Message, + Font => the_Applet.Font, + Color => White); begin the_Applet.gui_World.add (Text); text_line_Site (2) := text_line_Site (2) - 2.0; @@ -83,13 +85,14 @@ is Scale => 10.0); the_terrain_Model : constant openGL.Model.terrain.view - := openGL.Model.terrain.new_Terrain (heights_Asset => terrain_Heights, - Row => 1, - Col => 1, - Heights => openGL.Model.terrain.height_Map_view (gl_Heights), - color_Map => terrain_Texture, - Tiling => (s => (0.0, 1.0), - t => (0.0, 1.0))); + := openGL.Model.terrain.new_Terrain (heights_Asset => terrain_Heights, + Row => 1, + Col => 1, + Heights => openGL.Model.terrain.height_Map_view (gl_Heights), + color_Map => terrain_Texture, + texture_Details => texture_Set.to_Details ([1 => terrain_Texture]), + Tiling => (s => (0.0, 1.0), + t => (0.0, 1.0))); the_terrain_physics_Model : constant physics.Model.view := physics.Model.forge.new_physics_Model (shape_Info => (Kind => physics.Model.heightfield, @@ -97,11 +100,10 @@ is height_Range => [0.0, 200.0]), Scale => [hs, 1.0, hs]); the_Terrain : constant gel.Sprite.view - := gel.Sprite.forge.new_Sprite ("demo.Terrain", - the_Applet.gui_World.all'Access, - Origin_3D, - the_terrain_Model, - the_terrain_physics_Model); + := gel.Sprite.forge.new_Sprite (Name => "demo.Terrain", + World => the_Applet.gui_World.all'Access, + graphics_Model => the_terrain_Model, + physics_Model => the_terrain_physics_Model); begin -- Setup the applet. -- @@ -163,11 +165,10 @@ begin Mass => 1.0); the_Box : constant gel.Sprite.view - := gel.Sprite.forge.new_Sprite ("demo.Box", - the_Applet.gui_World.all'Access, - Origin_3D, - the_box_Model.all'Access, - the_box_physics_Model); + := gel.Sprite.forge.new_Sprite (Name => "demo.Box", + World => the_Applet.gui_World.all'Access, + graphics_Model => the_box_Model.all'Access, + physics_Model => the_box_physics_Model); -- Ball -- @@ -177,36 +178,37 @@ begin Mass => 1.0); the_ball_Model : constant openGL.Model.sphere.textured.view - := openGL.Model.sphere.textured.new_Sphere (Radius => 0.5, - Image => openGL.to_Asset ("assets/gel/texture/earth_map.bmp")); + := openGL.Model.sphere.textured.new_Sphere (Radius => 0.5, + Image => openGL.to_Asset ("assets/gel/texture/earth_map.bmp"), + texture_Details => texture_Set.to_Details ([1 => openGL.to_Asset ("assets/gel/Face1.bmp")])); the_Ball : constant gel.Sprite.view - := gel.Sprite.forge.new_Sprite ("demo.Ball", - the_Applet.gui_World.all'Access, - Origin_3D, - the_ball_Model, - the_ball_physics_Model); + := gel.Sprite.forge.new_Sprite (Name => "demo.Ball", + World => the_Applet.gui_World.all'Access, + graphics_Model => the_ball_Model, + physics_Model => the_ball_physics_Model); -- Cone -- the_cone_Model : constant openGL.Model.any.view := openGL.Model.any.new_Model (Model => openGL.to_Asset ("assets/gel/model/unit_cone.obj"), Texture => openGL.to_Asset ("assets/gel/Face1.bmp"), + texture_Details => texture_Set.to_Details ([1 => openGL.to_Asset ("assets/gel/Face1.bmp")]), Texture_is_lucid => False); the_cone_physics_Model : constant physics.Model.view := physics.Model.forge.new_physics_Model (shape_Info => (Kind => physics.Model.cone), Mass => 1.0); the_Cone : constant gel.Sprite.view - := gel.Sprite.forge.new_Sprite ("demo.Cone", - the_Applet.gui_World.all'Access, - Origin_3D, - the_cone_Model.all'Access, - the_cone_physics_Model); + := gel.Sprite.forge.new_Sprite (Name => "demo.Cone", + World => the_Applet.gui_World.all'Access, + graphics_Model => the_cone_Model.all'Access, + physics_Model => the_cone_physics_Model); -- Capsule -- the_capsule_Model : constant openGL.Model.capsule.textured.view := openGL.Model.capsule.textured.new_Capsule (Radius => 0.5, Height => 1.0, + texture_Details => texture_Set.to_Details ([1 => openGL.to_Asset ("assets/gel/Face1.bmp")]), Image => openGL.to_Asset ("assets/gel/Face1.bmp")); the_capsule_physics_Model : constant physics.Model.view @@ -216,33 +218,32 @@ begin Height => 1.0), Mass => 1.0); the_Capsule : constant gel.Sprite.view - := gel.Sprite.forge.new_Sprite ("demo.Capsule", - the_Applet.gui_World.all'Access, - Origin_3D, - the_capsule_Model.all'Access, - the_capsule_physics_Model); + := gel.Sprite.forge.new_Sprite (Name => "demo.Capsule", + World => the_Applet.gui_World.all'Access, + graphics_Model => the_capsule_Model.all'Access, + physics_Model => the_capsule_physics_Model); -- multi_Sphere -- - the_multi_Sphere_Model : constant openGL.Model.capsule.textured.view - := openGL.Model.capsule.textured.new_Capsule (Radius => 0.5, - Height => 0.0, - Image => openGL.to_Asset ("assets/gel/golf_green-16x16.tga")); - - the_multi_Sphere_physics_Model : constant physics.Model.view - := physics.Model.forge.new_physics_Model (shape_Info => (Kind => physics.Model.multi_Sphere, - Sites => new physics.Vector_3_array' ([-0.5, 0.0, 0.0], - [ 0.5, 0.0, 0.0]), - Radii => new gel.math.Vector' (1 => 0.5, - 2 => 0.5)), - Mass => 1.0); - - the_multi_Sphere : constant gel.Sprite.view - := gel.Sprite.forge.new_Sprite ("demo.multi_Sphere", - the_Applet.gui_World.all'Access, - Origin_3D, - the_multi_Sphere_Model.all'Access, - the_multi_Sphere_physics_Model); + -- the_multi_Sphere_Model : constant openGL.Model.capsule.textured.view + -- := openGL.Model.capsule.textured.new_Capsule (Radius => 0.5, + -- Height => 0.0, + -- texture_Details => texture_Set.to_Details ([1 => openGL.to_Asset ("assets/gel/golf_green-16x16.tga")]), + -- Image => openGL.to_Asset ("assets/gel/golf_green-16x16.tga")); + -- + -- the_multi_Sphere_physics_Model : constant physics.Model.view + -- := physics.Model.forge.new_physics_Model (shape_Info => (Kind => physics.Model.multi_Sphere, + -- Sites => new physics.Vector_3_array' ([-0.5, 0.0, 0.0], + -- [ 0.5, 0.0, 0.0]), + -- Radii => new gel.math.Vector' (1 => 0.5, + -- 2 => 0.5)), + -- Mass => 1.0); + -- + -- the_multi_Sphere : constant gel.Sprite.view + -- := gel.Sprite.forge.new_Sprite (Name => "demo.multi_Sphere", + -- World => the_Applet.gui_World.all'Access, + -- graphics_Model => the_multi_Sphere_Model.all'Access, + -- physics_Model => the_multi_Sphere_physics_Model); -- Hull -- @@ -264,24 +265,23 @@ begin [ s, s, -s], [-s, s, -s]))); the_Hull : constant gel.Sprite.view - := gel.Sprite.forge.new_Sprite ("demo.Hull", - the_Applet.gui_World.all'Access, - Origin_3D, - the_hull_Model.all'Access, - the_hull_physics_Model); + := gel.Sprite.forge.new_Sprite (Name => "demo.Hull", + World => the_Applet.gui_World.all'Access, + graphics_Model => the_hull_Model.all'Access, + physics_Model => the_hull_physics_Model); begin the_Applet.gui_World.add (the_Ball); the_Applet.gui_World.add (the_Box); the_Applet.gui_World.add (the_Cone); the_Applet.gui_World.add (the_Capsule); - the_Applet.gui_World.add (the_multi_Sphere); + -- the_Applet.gui_World.add (the_multi_Sphere); the_Applet.gui_World.add (the_Hull); the_Ball .Site_is ([ x, y, 0.0]); the_Box .Site_is ([ 0.0, y, -2.5]); the_Cone .Site_is ([ 0.0, y, 0.0]); the_Capsule .Site_is ([ 0.0 + X, y, 0.0 + x]); - the_multi_Sphere.Site_is ([-4.0, y, 4.4]); + -- the_multi_Sphere.Site_is ([-4.0, y, 4.4]); the_Hull .Site_is ([ 4.0, y, 4.4]); x := x + 2.0; diff --git a/4-high/gel/applet/demo/game/pong-gtk/launch_pong.adb b/4-high/gel/applet/demo/game/pong-gtk/launch_pong.adb index 18fef26..d785381 100644 --- a/4-high/gel/applet/demo/game/pong-gtk/launch_pong.adb +++ b/4-high/gel/applet/demo/game/pong-gtk/launch_pong.adb @@ -102,13 +102,14 @@ begin --- Ball -- the_Ball : constant gel.Sprite.view - := gel.Forge.new_circle_Sprite (in_World => the_Applet.World, - Site => [0.0, 0.0], - Mass => 1.0, + := gel.Forge.new_circle_Sprite (Name => "Ball", + in_World => the_Applet.World, + Site => [0.0, 0.0, 0.0], + Mass => 0.2, Bounce => 1.0, Friction => 0.0, Radius => 0.5, - Color => Grey, + Color => (Grey, openGL.Opaque), Texture => openGL.to_Asset ("assets/opengl/texture/Face1.bmp")); court_Width : constant := 30.0; @@ -140,8 +141,9 @@ begin the_Player : Player renames the_Players (Id); score_Site : constant Vector_2 := Site + [0.0, court_Height / 2.0 + 0.8]; begin - the_Player.Paddle := gel.Forge.new_rectangle_Sprite (the_Applet.World, - Site => Site, + the_Player.Paddle := gel.Forge.new_rectangle_Sprite (in_World => the_Applet.World, + Name => "Paddle" & Id'Image, + Site => Vector_3 (Site & 0.0), Mass => 0.0, Bounce => 1.0, Friction => 0.0, @@ -149,17 +151,22 @@ begin Height => 3.0, Color => Red); - the_Player.score_Text := gel.Forge.new_text_Sprite (the_Applet.World, - Origin_3D, - " 0", - the_Applet.Font, - Green); + the_Player.score_Text := gel.Forge.new_text_Sprite (in_World => the_Applet.World, + Site => Origin_3D, + Text => " 0", + Font => the_Applet.Font, + Color => Green, + Size => ([1.0, 1.0, 1.0])); the_Player.score_Model := openGL.Model.text.view (the_Player.score_Text.graphics_Model); + -- the_Player.score_Model. + the_Applet.World.add (the_Player.Paddle); the_Applet.World.add (the_Player.score_Text); the_Player.score_Text.Site_is (Vector_3 (score_Site & 0.0)); + the_Player.score_Text.Scale_is ([50.0, 50.0, 50.0]); + -- the_Player.score_Text.graphics_Model. end add_Player; @@ -170,8 +177,9 @@ begin Height : in Real) is the_Wall : constant gel.Sprite.view - := gel.Forge.new_rectangle_Sprite (the_Applet.World, - Site => Site, + := gel.Forge.new_rectangle_Sprite (in_World => the_Applet.World, + Name => "Wall", + Site => Vector_3 (Site & 0.0), Mass => 0.0, Bounce => 1.0, Friction => 0.0, @@ -269,7 +277,7 @@ begin declare Light : openGL.Light.item := the_Applet.Renderer.new_Light; begin - Light.Site_is ([0.0, -1000.0, 0.0]); + Light.Site_is ([0.0, 0.0, 1.0]); the_Applet.Renderer.set (Light); end; @@ -387,6 +395,8 @@ begin if the_Player.moving_Down then the_Player.Paddle.Site_is (the_Player.Paddle.Site - paddle_Speed); end if; end; end loop; + + delay 1.0 / 60.0; end loop; free (the_Applet); diff --git a/4-high/gel/applet/demo/game/pong-sdl/launch_pong.adb b/4-high/gel/applet/demo/game/pong-sdl/launch_pong.adb index 070bf67..ce89523 100644 --- a/4-high/gel/applet/demo/game/pong-sdl/launch_pong.adb +++ b/4-high/gel/applet/demo/game/pong-sdl/launch_pong.adb @@ -50,12 +50,13 @@ is -- the_Ball : constant gel.Sprite.view := gel.Forge.new_circle_Sprite (in_World => the_Applet.World, + Name => "Ball", Site => [0.0, 0.0, 0.0], - Mass => 1.0, + Mass => 0.2, Bounce => 1.0, Friction => 0.0, Radius => 0.5, - Color => Grey, + Color => (Grey, openGL.Opaque), Texture => openGL.to_Asset ("assets/opengl/texture/Face1.bmp")); --- Players -- @@ -84,7 +85,8 @@ is stadium_Height / 2.0 + 0.8, 0.0]; begin - the_Player.Paddle := gel.Forge.new_rectangle_Sprite (the_Applet.World, + the_Player.Paddle := gel.Forge.new_rectangle_Sprite (in_World => the_Applet.World, + Name => "Paddle" & Id'Image, Site => Site, Mass => 0.0, Bounce => 1.0, @@ -93,11 +95,14 @@ is Height => 3.0, Color => Red); - the_Player.score_Text := gel.Forge.new_text_Sprite (the_Applet.World, - Origin_3D, - " 0", - the_Applet.Font, - Green); + the_Player.score_Text := gel.Forge.new_text_Sprite (in_World => the_Applet.World, + Site => Origin_3D, + Text => " 0", + Font => the_Applet.Font, + Color => Green, + Size => ([1.0, 1.0, 1.0])); + + the_Player.score_Model := openGL.Model.text.view (the_Player.score_Text.graphics_Model); the_Applet.World.add (the_Player.Paddle); @@ -114,14 +119,15 @@ is Height : in Real) is the_Wall : constant gel.Sprite.view - := gel.Forge.new_rectangle_Sprite (the_Applet.World, - Site => Site, - Mass => 0.0, - Bounce => 1.0, - Friction => 0.0, - Width => Width, - Height => Height, - Color => Blue); + := gel.Forge.new_rectangle_Sprite (in_World => the_Applet.World, + Name => "Wall", + Site => Site, + Mass => 0.0, + Bounce => 1.0, + Friction => 0.0, + Width => Width, + Height => Height, + Color => Blue); begin the_Applet.World.add (the_Wall); end add_Wall; @@ -196,7 +202,7 @@ begin declare Light : openGL.Light.item := the_Applet.Renderer.new_Light; begin - Light.Site_is ([0.0, -1000.0, 0.0]); + Light.Site_is ([0.0, 0.0, 1.0]); the_Applet.Renderer.set (Light); end; @@ -280,6 +286,7 @@ begin if relaunch_Ball then the_Ball.Site_is ([0.0, 0.0, 0.0]); + declare the_Force : Vector_3 := [gel.Math.Random.random_Real (50.0, 200.0), gel.Math.Random.random_Real ( 5.0, 20.0), @@ -291,7 +298,8 @@ begin end if; the_Ball.apply_Force (the_Force); - end; + end; + relaunch_Ball := False; end if; diff --git a/4-high/gel/applet/demo/models/opengl_model/launch_opengl_model.adb b/4-high/gel/applet/demo/models/opengl_model/launch_opengl_model.adb index bd0803a..718b7f4 100644 --- a/4-high/gel/applet/demo/models/opengl_model/launch_opengl_model.adb +++ b/4-high/gel/applet/demo/models/opengl_model/launch_opengl_model.adb @@ -1,3 +1,4 @@ +with openGL.texture_Set; with gel.Applet.gui_World, gel.Window.setup, @@ -8,6 +9,7 @@ with openGL.Model.any, openGL.Light, + openGL.texture_Set, ada.Calendar, ada.Text_IO, @@ -33,7 +35,8 @@ is the_human_graphics_Model : constant openGL.Model.any.view := openGL.Model.any.new_Model (Model => openGL.to_Asset ("./assets/opengl/model/human.obj"), - Texture => openGL.null_Asset, + Texture => openGL.to_Asset ("./assets/opengl/texture/wooden-crate.jpg"), + texture_Details => openGL.texture_Set.to_Details ([1 => openGL.to_Asset ("./assets/opengl/texture/wooden-crate.jpg")]), Texture_is_lucid => False); the_human_physics_Model : constant physics.Model.view @@ -52,6 +55,7 @@ is the_cobra_graphics_Model : aliased constant openGL.Model.any.view := openGL.Model.any.new_Model (Model => openGL.to_Asset ("./assets/oolite_cobra3.obj"), Texture => openGL.to_Asset ("./assets/oolite_cobra3_diffuse.png"), + texture_Details => openGL.texture_Set.to_Details ([1 => openGL.to_Asset ("./assets/oolite_cobra3_diffuse.png")]), Texture_is_lucid => False); the_cobra_physics_Model : constant physics.Model.view @@ -82,7 +86,7 @@ begin the_Human.Site_is ([0.0, 5.0, 0.0]); -- -- the_Applet.gui_World.add (the_Cobra); -- Add cobra. - -- the_Cobra.Site_is ((0.0, 5.0, 0.0)); -- + the_Cobra.Site_is ((0.0, 5.0, 0.0)); -- the_Applet.gui_Camera.Site_is ([0.0, 1.5, 2.6]); -- Position the camera. -- the_Applet.gui_Camera.Site_is ((0.0, 100.0, 0.0)); -- Position the camera. @@ -95,7 +99,7 @@ begin declare Light : openGL.Light.item := the_Applet.Renderer.new_Light; begin - Light.Site_is ([0.0, 1000.0, 1000.0]); + Light.Site_is ([0.0, 15.0, 15.0]); the_Applet.Renderer.set (Light); end; diff --git a/4-high/gel/applet/demo/mouse/mouse_selection/launch_mouse_selection.adb b/4-high/gel/applet/demo/mouse/mouse_selection/launch_mouse_selection.adb index 0474c11..04c5c77 100644 --- a/4-high/gel/applet/demo/mouse/mouse_selection/launch_mouse_selection.adb +++ b/4-high/gel/applet/demo/mouse/mouse_selection/launch_mouse_selection.adb @@ -1,4 +1,6 @@ with + openGL.Palette, + gel.Window.setup, gel.Applet.gui_world, gel.World, @@ -40,8 +42,10 @@ begin declare use ada.Calendar; - the_Ball : constant gel.Sprite.view := gel.Forge.new_ball_Sprite (the_Applet.World (1), - Mass => 1.0); + the_Ball : constant gel.Sprite.view := gel.Forge.new_ball_Sprite (in_World => the_Applet.World (1), + Mass => 1.0, + is_Lit => False, + Color => (openGL.Palette.Green, openGL.Opaque)); type retreat_Sprite is new lace.Response.item with diff --git a/4-high/gel/applet/demo/mouse/mouse_selection_2d/launch_mouse_selection_2d.adb b/4-high/gel/applet/demo/mouse/mouse_selection_2d/launch_mouse_selection_2d.adb index c1e9b63..db1c712 100644 --- a/4-high/gel/applet/demo/mouse/mouse_selection_2d/launch_mouse_selection_2d.adb +++ b/4-high/gel/applet/demo/mouse/mouse_selection_2d/launch_mouse_selection_2d.adb @@ -1,4 +1,6 @@ with + openGL.Palette, + gel.Window.setup, gel.Applet.gui_world, gel.World, @@ -40,8 +42,11 @@ begin declare use ada.Calendar; - the_Ball : constant gel.Sprite.view := gel.Forge.new_circle_Sprite (the_Applet.World (1), - Mass => 1.0); + the_Ball : constant gel.Sprite.view := gel.Forge.new_circle_Sprite (in_World => the_Applet.World (1), + Name => "Ball", + Mass => 1.0, + Color => (openGL.Palette.Green, openGL.Opaque), + Fill => False); type retreat_Sprite is new lace.Response.item with diff --git a/4-high/gel/applet/demo/skinning/rig/box_rig-1_bone/launch_box_rig_1_bone_demo.adb b/4-high/gel/applet/demo/skinning/rig/box_rig-1_bone/launch_box_rig_1_bone_demo.adb index 8508ad3..88c9d5b 100644 --- a/4-high/gel/applet/demo/skinning/rig/box_rig-1_bone/launch_box_rig_1_bone_demo.adb +++ b/4-high/gel/applet/demo/skinning/rig/box_rig-1_bone/launch_box_rig_1_bone_demo.adb @@ -6,7 +6,9 @@ with gel.Forge, openGL.Model.any, - openGL.Light.directional, + openGL.texture_Set, + openGL.Light, + -- openGL.Light.directional, ada.Calendar; @@ -28,12 +30,13 @@ is --- Variables -- the_Applet : constant gel.Applet.gui_World.view := gel.Forge.new_gui_Applet ("Rig Demo", 1536, 864); - the_rig_Model : constant openGL.Model.any.view := openGL.Model.any.new_Model (-- Model => openGL.to_Asset ("./box_1_bone.dae"), + the_rig_Model : constant openGL.Model.any.view := openGL.Model.any.new_Model (Model => openGL.to_Asset ("./box_1_bone.dae"), -- Model => openGL.to_Asset ("./box_1_bone-animated.dae"), -- Model => openGL.to_Asset ("./box_2_bone.dae"), -- Model => openGL.to_Asset ("./box_3_bone.dae"), - Model => openGL.to_Asset ("./human-default-animated-01_01.dae"), + -- Model => openGL.to_Asset ("./human-default-animated-01_01.dae"), Texture => openGL.null_Asset, + texture_Details => openGL.texture_Set.to_Details ([1 => openGL.to_Asset ("assets/gel/Face1.bmp")]), Texture_is_lucid => False); the_Rig : gel.Rig.item; next_render_Time : ada.calendar.Time; @@ -50,15 +53,20 @@ begin -- Set the lights position and ambient color. -- declare - Light : openGL.Light.directional.item := the_Applet.Renderer.Light (Id => 1); + -- Light : openGL.Light.directional.item := the_Applet.Renderer.Light (Id => 1); + Light : openGL.Light.item := the_Applet.Renderer.new_Light; begin - Light.ambient_Color_is ((255.0 / 255.0, - 153.0 / 255.0, - 102.0 / 255.0, - 1.0)); - Light.Site_is ((1000.0, 000.0, 1000.0)); + -- Light.ambient_Color_is ((255.0 / 255.0, + -- 153.0 / 255.0, + -- 102.0 / 255.0, + -- 1.0)); + Light.Color_is ((255.0 / 255.0, + 153.0 / 255.0, + 102.0 / 255.0)); + Light.Site_is ([1000.0, 000.0, 1000.0]); - the_Applet.Renderer.Light_is (Id => 1, Now => Light); + -- the_Applet.Renderer.Light_is (Id => 1, Now => Light); + the_Applet.Renderer.set (the_Light => Light); end; diff --git a/4-high/gel/applet/demo/skinning/rig/box_rig/launch_rig_demo.adb b/4-high/gel/applet/demo/skinning/rig/box_rig/launch_rig_demo.adb index 69dd494..5ae66cb 100644 --- a/4-high/gel/applet/demo/skinning/rig/box_rig/launch_rig_demo.adb +++ b/4-high/gel/applet/demo/skinning/rig/box_rig/launch_rig_demo.adb @@ -9,6 +9,7 @@ with openGL.Model.any, openGL.Light, + openGL.texture_Set, ada.Calendar; @@ -46,6 +47,7 @@ is Model => openGL.to_Asset ("./box_1_bone.dae"), -- Model => openGL.to_Asset ("./box_2_bone.dae"), Texture => openGL.null_Asset, + texture_Details => openGL.texture_Set.to_Details ([1 => openGL.to_Asset ("./assets/opengl/textures/wooden-crate.jpg")]), Texture_is_lucid => False); the_Rig : aliased gel.Rig.item; diff --git a/4-high/gel/applet/demo/skinning/rig/human_rig/launch_human_rig_demo.adb b/4-high/gel/applet/demo/skinning/rig/human_rig/launch_human_rig_demo.adb index b5bd775..3fa0550 100644 --- a/4-high/gel/applet/demo/skinning/rig/human_rig/launch_human_rig_demo.adb +++ b/4-high/gel/applet/demo/skinning/rig/human_rig/launch_human_rig_demo.adb @@ -7,6 +7,7 @@ with openGL.Model.any, openGL.Light, + openGL.texture_Set, ada.command_Line, ada.Calendar, @@ -54,6 +55,7 @@ begin the_Rig : aliased gel.Rig.item; the_rig_Model : aliased constant openGL.Model.any.view := openGL.Model.any.new_Model (Model => openGL.to_Asset (model_Name), Texture => openGL.null_Asset, + texture_Details => openGL.texture_Set.to_Details ([1 => openGL.to_Asset ("assets/gel/Face1.bmp")]), Texture_is_lucid => False); next_render_Time : ada.calendar.Time := ada.calendar.Clock; diff --git a/4-high/gel/applet/demo/sprite/chains_2d/launch_chains_2d.adb b/4-high/gel/applet/demo/sprite/chains_2d/launch_chains_2d.adb index a6e56de..3df57bc 100644 --- a/4-high/gel/applet/demo/sprite/chains_2d/launch_chains_2d.adb +++ b/4-high/gel/applet/demo/sprite/chains_2d/launch_chains_2d.adb @@ -6,7 +6,8 @@ with gel.Joint, Physics, - openGL.Palette; + openGL.Palette, + openGL.Light; pragma unreferenced (gel.Window.sdl); @@ -37,6 +38,15 @@ begin the_Applet.Renderer .Background_is (Grey); the_Applet.enable_simple_Dolly (in_World => gui_World.gui_world_Id); + -- Set the lights position. + -- + declare + Light : openGL.Light.item := the_Applet.Renderer.new_Light; + begin + Light.Site_is ([0.0, 0.0, 15.0]); + the_Applet.Renderer.set (Light); + end; + the_Ground.Site_is ([0.0, -40.0, 0.0]); the_Applet.gui_World.add (the_Ground, and_Children => False); @@ -44,8 +54,13 @@ begin -- declare ball_Count : constant := 39; - the_root_Ball : constant gel.Sprite.view := new_circle_Sprite (the_Applet.gui_World, Name => "the_root_Ball", Mass => 0.0); - the_Balls : constant gel.Sprite.views := [1 .. ball_Count => new_circle_Sprite (the_Applet.gui_World, Name => "the_Balls", Mass => 1.0)]; + the_root_Ball : constant gel.Sprite.view := new_circle_Sprite (in_World => the_Applet.gui_World, + Name => "the_root_Ball", + Mass => 0.0); + the_Balls : constant gel.Sprite.views := [1 .. ball_Count => new_circle_Sprite (in_World => the_Applet.gui_World, + Name => "the_Balls", + Color => (Green, openGL.Opaque), + Mass => 1.0)]; Parent : gel.Sprite.view := the_root_Ball; new_Joint : gel.Joint .view; diff --git a/4-high/gel/applet/demo/sprite/drop_ball_on_box/launch_drop_ball_on_box.adb b/4-high/gel/applet/demo/sprite/drop_ball_on_box/launch_drop_ball_on_box.adb index 73391c2..1d3ab4f 100644 --- a/4-high/gel/applet/demo/sprite/drop_ball_on_box/launch_drop_ball_on_box.adb +++ b/4-high/gel/applet/demo/sprite/drop_ball_on_box/launch_drop_ball_on_box.adb @@ -6,6 +6,9 @@ with gel.World, gel.Camera, + openGL.Light, + openGL.Palette, + Physics, ada.Text_IO, @@ -41,7 +44,8 @@ is end gui_Camera; - the_Ball : constant gel.Sprite.view := gel.Forge.new_ball_Sprite (gui_World); + the_Ball : constant gel.Sprite.view := gel.Forge.new_ball_Sprite (in_World => gui_World, + Color => (openGL.Palette.Green, openGL.Opaque)); the_Box : constant gel.Sprite.view := gel.Forge.new_box_Sprite (gui_World, Mass => 0.0, Size => [20.0, 1.0, 20.0]); @@ -59,6 +63,15 @@ begin gui_World.add (the_Ball); -- Add ball. gui_World.add (the_Box); -- Add box. + -- Set the lights position. + -- + declare + Light : openGL.Light.item := the_Applet.Renderer.new_Light; + begin + Light.Site_is ([0.0, 15.0, 15.0]); + Light.ambient_Coefficient_is (0.5); + the_Applet.Renderer.set (Light); + end; while the_Applet.is_open loop diff --git a/4-high/gel/applet/demo/sprite/drop_box_on_box/launch_drop_box_on_box.adb b/4-high/gel/applet/demo/sprite/drop_box_on_box/launch_drop_box_on_box.adb index 39f05ac..d773313 100644 --- a/4-high/gel/applet/demo/sprite/drop_box_on_box/launch_drop_box_on_box.adb +++ b/4-high/gel/applet/demo/sprite/drop_box_on_box/launch_drop_box_on_box.adb @@ -41,11 +41,10 @@ is half_Extents => [5.0, 0.25, 5.0])); the_Ground : constant gel.Sprite.view - := gel.Sprite.forge.new_Sprite ("demo.Ground", - gel.Sprite.World_view (the_Applet.gui_World), - math.Origin_3D, - the_ground_graphics_Model, - the_ground_physics_Model); + := gel.Sprite.forge.new_Sprite (Name => "demo.Ground", + World => gel.Sprite.World_view (the_Applet.gui_World), + graphics_Model => the_ground_graphics_Model, + physics_Model => the_ground_physics_Model); the_box_physics_Model : constant physics.Model.view @@ -62,11 +61,10 @@ is Left => (Colors => [others => (Cyan, Opaque)]), Right => (Colors => [others => (Magenta, Opaque)])]); the_Box : constant gel.Sprite.view - := gel.Sprite.forge.new_Sprite ("demo.Box", - gel.Sprite.World_view (the_Applet.gui_World), - math.Origin_3D, - the_box_graphics_Model, - the_box_physics_Model); + := gel.Sprite.forge.new_Sprite (Name => "demo.Box", + World => gel.Sprite.World_view (the_Applet.gui_World), + graphics_Model => the_box_graphics_Model, + physics_Model => the_box_physics_Model); begin new_Line; put_Line ("Use arrow keys and PgUp/PgDn to move the camera."); @@ -79,7 +77,7 @@ begin the_Applet.gui_World.add (the_Ground, and_children => False); -- Add ground. the_Ground.Site_is (math.Origin_3D); - the_Applet.gui_World.add (the_Box, and_Children => False); -- Add ball. + the_Applet.gui_World.add (the_Box, and_Children => False); -- Add ball. the_Box.Site_is ([0.0, 10.0, 0.0]); while the_Applet.is_open diff --git a/4-high/gel/applet/demo/sprite/ghost_sprite/ghost_sprite.gpr b/4-high/gel/applet/demo/sprite/ghost_sprite/ghost_sprite.gpr new file mode 100644 index 0000000..f72f5b3 --- /dev/null +++ b/4-high/gel/applet/demo/sprite/ghost_sprite/ghost_sprite.gpr @@ -0,0 +1,18 @@ +with + "gel_sdl", + "lace_shared"; + + +project ghost_Sprite +is + for Object_Dir use "build"; + for Exec_Dir use "."; + for Main use ("launch_ghost_sprite.adb"); + for Languages use ("Ada"); + + package Ide renames Lace_shared.Ide; + package Builder renames Lace_shared.Builder; + package Compiler renames Lace_shared.Compiler; + package Binder renames Lace_shared.Binder; + +end ghost_Sprite; \ No newline at end of file diff --git a/4-high/gel/applet/demo/sprite/ghost_sprite/launch_ghost_sprite.adb b/4-high/gel/applet/demo/sprite/ghost_sprite/launch_ghost_sprite.adb new file mode 100644 index 0000000..1fbb52b --- /dev/null +++ b/4-high/gel/applet/demo/sprite/ghost_sprite/launch_ghost_sprite.adb @@ -0,0 +1,98 @@ +with + gel.Forge, + gel.Window.sdl, + gel.Applet.gui_world, + gel.Camera, + gel.Sprite, + physics.Model, + + openGL.Model.box.colored, + openGL.Palette, + + ada.Text_IO, + ada.Exceptions; + +pragma unreferenced (gel.window.sdl); + + +procedure launch_ghost_Sprite +-- +-- Drops a box onto a box 'terrain'. +-- +is + use openGL.Model.box, + openGL, + opengl.Palette, + ada.Text_IO; + + the_Applet : constant gel.Applet.gui_World.view + := gel.Forge.new_gui_Applet ("ghost Sprite"); + + + the_ground_graphics_Model : constant openGL.Model.box.colored.view + := openGL.Model.box.colored.new_Box (Size => [10.0, 0.5, 10.0], + Faces => [Front => (Colors => [others => (Red, Opaque)]), + Rear => (Colors => [others => (Blue, Opaque)]), + Upper => (Colors => [others => (Green, Opaque)]), + Lower => (Colors => [others => (Yellow, Opaque)]), + Left => (Colors => [others => (Cyan, Opaque)]), + Right => (Colors => [others => (Magenta, Opaque)])]); + the_ground_physics_Model : constant physics.Model.view + := physics.Model.Forge.new_physics_Model (shape_Info => (Kind => physics.Model.cube, + half_Extents => [5.0, 0.25, 5.0]), + is_Tangible => False); + + the_Ground : constant gel.Sprite.view + := gel.Sprite.forge.new_Sprite (Name => "demo.Ground", + World => gel.Sprite.World_view (the_Applet.gui_World), + graphics_Model => the_ground_graphics_Model, + physics_Model => the_ground_physics_Model); + + + the_box_physics_Model : constant physics.Model.view + := physics.Model.forge.new_physics_Model (shape_Info => (Kind => physics.Model.cube, + half_Extents => [1.0, 0.5, 1.0]), + Mass => 1.0); + + the_box_graphics_Model : constant openGL.Model.box.colored.view + := openGL.Model.box.colored.new_Box (Size => [1.0, 1.0, 1.0], + Faces => [Front => (Colors => [others => (Red, Opaque)]), + Rear => (Colors => [others => (Blue, Opaque)]), + Upper => (Colors => [others => (dark_Green, Opaque)]), + Lower => (Colors => [others => (Yellow, Opaque)]), + Left => (Colors => [others => (Cyan, Opaque)]), + Right => (Colors => [others => (Magenta, Opaque)])]); + the_Box : constant gel.Sprite.view + := gel.Sprite.forge.new_Sprite (Name => "demo.Box", + World => gel.Sprite.World_view (the_Applet.gui_World), + graphics_Model => the_box_graphics_Model, + physics_Model => the_box_physics_Model); +begin + new_Line; + put_Line ("Use arrow keys and PgUp/PgDn to move the camera."); + new_Line; + + the_Applet.gui_Camera.Site_is ([0.0, 5.0, 15.0]); -- Position the camera. + the_Applet.enable_simple_Dolly (1); -- Enable user camera control via keyboards. + the_Applet.enable_Mouse (detect_Motion => False); -- Enable the mouse. + + the_Applet.gui_World.add (the_Ground, and_children => False); -- Add ground. + the_Ground.Site_is (math.Origin_3D); + + the_Applet.gui_World.add (the_Box, and_Children => False); -- Add ball. + the_Box.Site_is ([0.0, 10.0, 0.0]); + + while the_Applet.is_open + loop + the_Applet.freshen; -- Handle any new events and update the screen. + end loop; + + the_Applet.destroy; + +exception + when E : others => + new_Line; + put_Line ("Unhandled exception in main thread ..."); + put_Line (ada.Exceptions.exception_Information (E)); + new_Line; +end launch_ghost_Sprite; diff --git a/4-high/gel/applet/demo/sprite/hinged_box/launch_hinged_box.adb b/4-high/gel/applet/demo/sprite/hinged_box/launch_hinged_box.adb index d6d5a70..7d47dbb 100644 --- a/4-high/gel/applet/demo/sprite/hinged_box/launch_hinged_box.adb +++ b/4-high/gel/applet/demo/sprite/hinged_box/launch_hinged_box.adb @@ -62,31 +62,28 @@ begin half_Extents => box_Size / 2.0), Mass => 1.0); the_Box_1 : constant gel.Sprite.view - := gel.Sprite.forge.new_Sprite ("demo.Box.static.1", - the_Applet.gui_World.all'Access, - math.Origin_3d, - the_box_Model.all'Access, - the_static_box_physics_Model, - owns_Graphics => False, - owns_Physics => True); + := gel.Sprite.forge.new_Sprite (Name => "demo.Box.static.1", + World => the_Applet.gui_World.all'Access, + graphics_Model => the_box_Model.all'Access, + physics_Model => the_static_box_physics_Model, + owns_Graphics => False, + owns_Physics => True); the_Box_2 : constant gel.Sprite.view - := gel.Sprite.forge.new_Sprite ("demo.Box.dynamic.2", - the_Applet.gui_World.all'Access, - math.Origin_3d, - the_box_Model.all'Access, - the_dynamic_box_physics_Model, - owns_Graphics => False, - owns_Physics => False); + := gel.Sprite.forge.new_Sprite (Name => "demo.Box.dynamic.2", + World => the_Applet.gui_World.all'Access, + graphics_Model => the_box_Model.all'Access, + physics_Model => the_dynamic_box_physics_Model, + owns_Graphics => False, + owns_Physics => False); the_Box_3 : constant gel.Sprite.view - := gel.Sprite.forge.new_Sprite ("demo.Box.dynamic.3", - the_Applet.gui_World.all'Access, - math.Origin_3d, - the_box_Model.all'Access, - the_dynamic_box_physics_Model, - owns_Graphics => True, - owns_Physics => True); + := gel.Sprite.forge.new_Sprite (Name => "demo.Box.dynamic.3", + World => the_Applet.gui_World.all'Access, + graphics_Model => the_box_Model.all'Access, + physics_Model => the_dynamic_box_physics_Model, + owns_Graphics => True, + owns_Physics => True); the_Joint_1 : constant gel.hinge_Joint.view := new gel.hinge_Joint.item; the_Joint_2 : constant gel.hinge_Joint.view := new gel.hinge_Joint.item; @@ -101,7 +98,6 @@ begin the_Box_1.Site_is ([ 0.0, 0.0, 0.0]); the_Box_2.Site_is ([ -1.0, 2.0, 0.0]); the_Box_3.Site_is ([ 10.0, 10.0, 0.0]); - -- the_Box_3.Site_is (( 10.0, 10.0, 0.0)); declare use math.Algebra.linear.d3; diff --git a/4-high/gel/applet/demo/sprite/mixed_joints_2d/launch_mixed_joints_2d.adb b/4-high/gel/applet/demo/sprite/mixed_joints_2d/launch_mixed_joints_2d.adb index 5a73f3c..d322003 100644 --- a/4-high/gel/applet/demo/sprite/mixed_joints_2d/launch_mixed_joints_2d.adb +++ b/4-high/gel/applet/demo/sprite/mixed_joints_2d/launch_mixed_joints_2d.adb @@ -47,26 +47,49 @@ begin -- Hinge -- declare - the_hinge_Box_1 : constant gel.Sprite.view := new_circle_Sprite (the_Applet.gui_World, Name => "the_hinge_Box_1", mass => 0.0); - the_hinge_Box_2 : constant gel.Sprite.view := new_circle_Sprite (the_Applet.gui_World, Name => "the_hinge_Box_2", mass => 1.0); + the_hinge_Box_1 : constant gel.Sprite.view := new_circle_Sprite (in_World => the_Applet.gui_World, + Name => "the_hinge_Box_1", + Mass => 0.0, + Color => (openGL.Palette.Green, openGL.Opaque), + Fill => False); + + the_hinge_Box_2 : constant gel.Sprite.view := new_circle_Sprite (in_World => the_Applet.gui_World, + Name => "the_hinge_Box_2", + Mass => 1.0, + Color => (openGL.Palette.Green, openGL.Opaque), + Fill => False); + new_Joint : gel. Joint .view; - Frame_A : constant math.Matrix_4x4 := math.Identity_4x4; - Frame_B : constant math.Matrix_4x4 := math.Identity_4x4; + -- Frame_A : constant math.Matrix_4x4 := math.Identity_4x4; + -- Frame_B : constant math.Matrix_4x4 := math.Identity_4x4; begin the_hinge_Box_1.Site_is ([ 0.0, 0.0, 0.0]); the_hinge_Box_2.Site_is ([-10.0, 0.0, 0.0]); + the_Applet.gui_World.add (the_hinge_Box_1); + the_Applet.gui_World.add (the_hinge_Box_2); + + -- the_hinge_Box_1.attach_via_Hinge (the_Child => the_hinge_Box_2, + -- Frame_in_parent => Frame_A, + -- Frame_in_child => Frame_B, + -- Limits => (0.0, to_Radians (355.0)), + -- collide_Connected => False, + -- new_joint => new_Joint); + + + the_hinge_Box_1.attach_via_Hinge + (the_Child => the_hinge_Box_2, + pivot_Axis => [0.0, 0.0, 1.0], -- Unused. + pivot_Anchor => [-0.0, 0.0, 0.0], + low_Limit => to_Radians (-355.0), + high_Limit => to_Radians ( 355.0), + new_joint => new_Joint); - the_hinge_Box_1.attach_via_Hinge (the_Child => the_hinge_Box_2, - Frame_in_parent => Frame_A, - Frame_in_child => Frame_B, - Limits => (0.0, to_Radians (355.0)), - collide_Connected => False, - new_joint => new_Joint); -- the_hinge_Joint := gel.hinge_Joint .view (new_Joint); - the_Applet.gui_World.add (the_hinge_Box_1, and_children => True); + -- the_Applet.gui_World.add (the_hinge_Box_1, and_children => True); + the_Applet.gui_World.add (new_Joint); end; -- -- DoF6 diff --git a/4-high/gel/applet/demo/sprite/mixed_shapes/launch_mixed_shapes.adb b/4-high/gel/applet/demo/sprite/mixed_shapes/launch_mixed_shapes.adb index 1ae9174..db187de 100644 --- a/4-high/gel/applet/demo/sprite/mixed_shapes/launch_mixed_shapes.adb +++ b/4-high/gel/applet/demo/sprite/mixed_shapes/launch_mixed_shapes.adb @@ -10,8 +10,10 @@ with openGL.Model.box.colored, openGL.Model.sphere.lit_colored_textured, openGL.Model.capsule.lit_colored_textured, + openGL.Model.capsule.textured, openGL.Model.any, openGL.Model.terrain, + openGL.texture_Set, openGL.IO, openGL.Light, openGL.Palette; @@ -90,13 +92,14 @@ is Scale => 2.0); the_heightfield_Model : constant openGL.Model.terrain.view - := openGL.Model.terrain.new_Terrain (heights_Asset => terrain_Heights, - Row => 1, - Col => 1, - Heights => openGL.Model.terrain.height_Map_view (gl_Heights), - color_Map => terrain_Texture, - Tiling => (s => (0.0, 1.0), - t => (0.0, 1.0))); + := openGL.Model.terrain.new_Terrain (heights_Asset => terrain_Heights, + Row => 1, + Col => 1, + Heights => openGL.Model.terrain.height_Map_view (gl_Heights), + color_Map => terrain_Texture, + texture_Details => texture_Set.to_Details ([1 => terrain_Texture]), + Tiling => (s => (0.0, 1.0), + t => (0.0, 1.0))); the_heightfield_physics_Model : constant physics.Model.view := physics.Model.forge.new_physics_Model (shape_Info => (Kind => physics.Model.heightfield, @@ -104,11 +107,10 @@ is height_Range => [0.0, 200.0]), Scale => [hs, 1.0, hs]); the_Heightfield : constant gel.Sprite.view - := gel.Sprite.forge.new_Sprite ("demo.Hull", - the_Applet.gui_World.all'Access, - Origin_3D, - the_Heightfield_Model, - the_Heightfield_physics_Model); + := gel.Sprite.forge.new_Sprite (Name => "demo.Heightfield", + World => the_Applet.gui_World.all'Access, + graphics_Model => the_Heightfield_Model, + physics_Model => the_Heightfield_physics_Model); begin -- Applet. -- @@ -153,11 +155,10 @@ begin Mass => 1.0); the_Box : constant gel.Sprite.view - := gel.Sprite.forge.new_Sprite ("demo.Box", - the_Applet.gui_World.all'Access, - Origin_3D, - the_box_Model.all'Access, - the_box_physics_Model); + := gel.Sprite.forge.new_Sprite (Name => "demo.Box", + World => the_Applet.gui_World.all'Access, + graphics_Model => the_box_Model.all'Access, + physics_Model => the_box_physics_Model); -- Ball -- @@ -167,36 +168,37 @@ begin Mass => 1.0); the_ball_Model : constant openGL.Model.sphere.lit_colored_textured.view - := openGL.Model.sphere.lit_colored_textured.new_Sphere (Radius => 1.0, - Image => openGL.to_Asset ("assets/gel/golf_green-16x16.tga")); + := openGL.Model.sphere.lit_colored_textured.new_Sphere (Radius => 1.0, + Image => openGL.to_Asset ("assets/gel/golf_green-16x16.tga"), + texture_Details => texture_Set.to_Details ([1 => openGL.to_Asset ("assets/gel/Face1.bmp")])); the_Ball : constant gel.Sprite.view - := gel.Sprite.forge.new_Sprite ("demo.Ball", - the_Applet.gui_World.all'Access, - Origin_3D, - the_ball_Model, - the_ball_physics_Model); + := gel.Sprite.forge.new_Sprite (Name => "demo.Ball", + World => the_Applet.gui_World.all'Access, + graphics_Model => the_ball_Model, + physics_Model => the_ball_physics_Model); -- Cone -- the_cone_Model : constant openGL.Model.any.view := openGL.Model.any.new_Model (Model => openGL.to_Asset ("assets/gel/model/unit_cone.obj"), - Texture => openGL.null_Asset, + Texture => openGL.to_Asset ("assets/gel/Face1.bmp"), + texture_Details => texture_Set.to_Details ([1 => openGL.to_Asset ("assets/gel/Face1.bmp")]), Texture_is_lucid => False); the_cone_physics_Model : constant physics.Model.view := physics.Model.forge.new_physics_Model (shape_Info => (Kind => physics.Model.cone), Mass => 1.0); the_Cone : constant gel.Sprite.view - := gel.Sprite.forge.new_Sprite ("demo.Cone", - the_Applet.gui_World.all'Access, - Origin_3D, - the_cone_Model.all'Access, - the_cone_physics_Model); + := gel.Sprite.forge.new_Sprite (Name => "demo.Cone", + World => the_Applet.gui_World.all'Access, + graphics_Model => the_cone_Model.all'Access, + physics_Model => the_cone_physics_Model); -- Cylinder -- the_cylinder_Model : constant openGL.Model.any.view := openGL.Model.any.new_Model (Model => openGL.to_Asset ("assets/gel/model/unit_cylinder.obj"), - Texture => openGL.null_Asset, + Texture => openGL.to_Asset ("assets/gel/Face1.bmp"), + texture_Details => texture_Set.to_Details ([1 => openGL.to_Asset ("assets/gel/Face1.bmp")]), Texture_is_lucid => False); the_cylinder_physics_Model : constant physics.Model.view @@ -205,17 +207,18 @@ begin Mass => 1.0); the_Cylinder : constant gel.Sprite.view - := gel.Sprite.forge.new_Sprite ("demo.Cylinder", - the_Applet.gui_World.all'Access, - Origin_3D, - the_cylinder_Model.all'Access, - the_cylinder_physics_Model); + := gel.Sprite.forge.new_Sprite (Name => "demo.Cylinder", + World => the_Applet.gui_World.all'Access, + graphics_Model => the_cylinder_Model.all'Access, + physics_Model => the_cylinder_physics_Model); -- Capsule -- - the_capsule_Model : constant openGL.Model.capsule.lit_colored_textured.view - := openGL.Model.capsule.lit_colored_textured.new_Capsule (Radius => 0.5, - Height => 0.0, - Color => (palette.Green, Opaque)); + the_capsule_Model : constant openGL.Model.capsule.textured.view + := openGL.Model.capsule.textured.new_Capsule (Radius => 0.5, + Height => 2.0, + texture_Details => texture_Set.to_Details ([1 => openGL.to_Asset ("assets/gel/Face1.bmp")]), + Image => openGL.to_Asset ("assets/gel/Face1.bmp")); + the_capsule_physics_Model : constant physics.Model.view := physics.Model.forge.new_physics_Model (shape_Info => (Kind => physics.Model.a_Capsule, @@ -224,34 +227,33 @@ begin Height => 1.0), Mass => 1.0); the_Capsule : constant gel.Sprite.view - := gel.Sprite.forge.new_Sprite ("demo.Capsule", - the_Applet.gui_World.all'Access, - Origin_3D, - the_capsule_Model.all'Access, - the_capsule_physics_Model); + := gel.Sprite.forge.new_Sprite (Name => "demo.Capsule", + World => the_Applet.gui_World.all'Access, + graphics_Model => the_capsule_Model.all'Access, + physics_Model => the_capsule_physics_Model); -- multi_Sphere -- - the_multi_Sphere_Model : constant openGL.Model.capsule.lit_colored_textured.view - := openGL.Model.capsule.lit_colored_textured.new_Capsule (Radius => 0.5, - Height => 0.0, - Color => (palette.Green, Opaque), - Image => openGL.to_Asset ("assets/gel/golf_green-16x16.tga")); - - the_multi_Sphere_physics_Model : constant physics.Model.view - := physics.Model.forge.new_physics_Model (shape_Info => (Kind => physics.Model.multi_Sphere, - Sites => new physics.Vector_3_array' ([-0.5, 0.0, 0.0], - [ 0.5, 0.0, 0.0]), - Radii => new gel.math.Vector' (1 => 0.5, - 2 => 0.5)), - Mass => 1.0); - - the_multi_Sphere : constant gel.Sprite.view - := gel.Sprite.forge.new_Sprite ("demo.multi_Sphere", - the_Applet.gui_World.all'Access, - Origin_3D, - the_multi_Sphere_Model.all'Access, - the_multi_Sphere_physics_Model); + -- the_multi_Sphere_Model : constant openGL.Model.capsule.lit_colored_textured.view + -- := openGL.Model.capsule.lit_colored_textured.new_Capsule (Radius => 0.5, + -- Height => 0.0, + -- Color => (palette.Green, Opaque), + -- Image => openGL.to_Asset ("assets/gel/golf_green-16x16.tga")); + -- + -- the_multi_Sphere_physics_Model : constant physics.Model.view + -- := physics.Model.forge.new_physics_Model (shape_Info => (Kind => physics.Model.multi_Sphere, + -- Sites => new physics.Vector_3_array' ([-0.5, 0.0, 0.0], + -- [ 0.5, 0.0, 0.0]), + -- Radii => new gel.math.Vector' (1 => 0.5, + -- 2 => 0.5)), + -- Mass => 1.0); + -- + -- the_multi_Sphere : constant gel.Sprite.view + -- := gel.Sprite.forge.new_Sprite ("demo.multi_Sphere", + -- the_Applet.gui_World.all'Access, + -- Origin_3D, + -- the_multi_Sphere_Model.all'Access, + -- the_multi_Sphere_physics_Model); -- Hull -- @@ -277,18 +279,17 @@ begin [-s, s, -s])), Mass => 1.0); the_Hull : constant gel.Sprite.view - := gel.Sprite.forge.new_Sprite ("demo.Hull", - the_Applet.gui_World.all'Access, - Origin_3D, - the_hull_Model.all'Access, - the_hull_physics_Model); + := gel.Sprite.forge.new_Sprite (Name => "demo.Hull", + World => the_Applet.gui_World.all'Access, + graphics_Model => the_hull_Model.all'Access, + physics_Model => the_hull_physics_Model); begin the_Applet.gui_World.add (the_Ball); the_Applet.gui_World.add (the_Box); the_Applet.gui_World.add (the_Cone); the_Applet.gui_World.add (the_Cylinder); the_Applet.gui_World.add (the_Capsule); - the_Applet.gui_World.add (the_multi_Sphere); + -- the_Applet.gui_World.add (the_multi_Sphere); the_Applet.gui_World.add (the_Hull); the_Ball .Site_is ([ x, y, 0.0]); @@ -297,7 +298,7 @@ begin the_Capsule .Site_is ([ 0.0 + X, y, 0.0 + x]); the_Cylinder .Site_is ([ 0.0, y, 4.4]); the_Hull .Site_is ([ 4.0, y, 4.4]); - the_multi_Sphere.Site_is ([-4.0, y, 4.4]); + -- the_multi_Sphere.Site_is ([-4.0, y, 4.4]); x := x + 2.0; y := y + 2.0; diff --git a/4-high/gel/applet/demo/sprite/text/launch_text_sprite_demo.adb b/4-high/gel/applet/demo/sprite/text/launch_text_sprite_demo.adb index a817942..0d370fd 100644 --- a/4-high/gel/applet/demo/sprite/text/launch_text_sprite_demo.adb +++ b/4-high/gel/applet/demo/sprite/text/launch_text_sprite_demo.adb @@ -20,22 +20,20 @@ is use gel.Math, openGL.Palette; - the_Applet : constant gel.Applet.gui_World.view := gel.forge.new_gui_Applet ("text sprite Demo", + the_Applet : constant gel.Applet.gui_World.view := gel.Forge.new_gui_Applet ("text sprite Demo", space_Kind => physics.Bullet); - the_Text_1 : constant gel.Sprite.view := gel.forge.new_text_Sprite (the_Applet.gui_World, - Origin_3D, - "Howdy", - the_Applet.Font, - Green); + the_Text_1 : constant gel.Sprite.view := gel.Forge.new_text_Sprite (in_World => the_Applet.gui_World, + Text => "Howdy", + Font => the_Applet.Font, + Color => dark_Green); - the_Text_2 : constant gel.Sprite.view := gel.forge.new_text_Sprite (the_Applet.gui_World, - Origin_3D, - "Doody", - the_Applet.Font, - Green); - text_1_Model : constant openGL.Model.text.lit_colored.view - := openGL.Model.text.lit_colored.view (the_Text_1.graphics_Model); + the_Text_2 : constant gel.Sprite.view := gel.Forge.new_text_Sprite (in_World => the_Applet.gui_World, + Text => "Doody", + Font => the_Applet.Font, + Color => dark_Green); + text_2_Model : constant openGL.Model.text.lit_colored.view + := openGL.Model.text.lit_colored.view (the_Text_2.graphics_Model); begin the_Applet.gui_Camera.Site_is ([0.0, 0.0, 50.0]); -- Position the camera. the_Applet.enable_simple_Dolly (1); -- Enable user camera control via keyboards. @@ -43,15 +41,15 @@ begin the_Applet.gui_World.add (the_Text_1); the_Applet.gui_World.add (the_Text_2); - the_Text_2.Site_is ([0.0, 10.0, 0.0]); + the_Text_2.Site_is ([0.0, -10.0, 0.0]); while the_Applet.is_open loop - if text_1_Model.Text = "Yay" + if text_2_Model.Text = "Yay" then - text_1_Model.Text_is ("Howdy"); + text_2_Model.Text_is ("Doody"); else - text_1_Model.Text_is ("Yay"); + text_2_Model.Text_is ("Yay"); end if; the_Applet.gui_World.evolve; diff --git a/4-high/gel/library/gel.gpr b/4-high/gel/library/gel.gpr index 1d0dc7e..b198925 100644 --- a/4-high/gel/library/gel.gpr +++ b/4-high/gel/library/gel.gpr @@ -22,6 +22,7 @@ is "../source/concrete", "../source/dolly", "../source/forge", + "../source/human", "../source/joint", "../source/applet", "../source/applet/distributed", diff --git a/4-high/gel/source/applet/gel-applet.adb b/4-high/gel/source/applet/gel-applet.adb index 0911d98..d91d024 100644 --- a/4-high/gel/source/applet/gel-applet.adb +++ b/4-high/gel/source/applet/gel-applet.adb @@ -865,16 +865,19 @@ is the_Collision : ray_Collision := the_world_Info.World.cast_Ray (From => the_Camera.Site, To => Site_world_space); begin - declare - click_Event : constant gel.Events.sprite_click_up_Event := (Sprite => the_Collision.near_Sprite.Id, - mouse_Button => the_Event.Button, - world_Site => Site_world_space); - begin - if the_Collision.near_Sprite /= null - then - the_Collision.near_Sprite.emit (click_Event); - end if; - end; + if the_Collision.near_Sprite /= null + then + declare + click_Event : constant gel.Events.sprite_click_up_Event := (Sprite => the_Collision.near_Sprite.Id, + mouse_Button => the_Event.Button, + world_Site => Site_world_space); + begin + if the_Collision.near_Sprite /= null + then + the_Collision.near_Sprite.emit (click_Event); + end if; + end; + end if; end; when physics.Box2D => diff --git a/4-high/gel/source/forge/gel-forge.adb b/4-high/gel/source/forge/gel-forge.adb index 7f332ce..8328c43 100644 --- a/4-high/gel/source/forge/gel-forge.adb +++ b/4-high/gel/source/forge/gel-forge.adb @@ -23,6 +23,7 @@ with openGL.Model.line .colored, openGL.Model.segment_line, + openGL.Palette, openGL.texture_Set, physics.Model, @@ -129,6 +130,7 @@ is function new_circle_Sprite (in_World : in gel.World.view; Name : in String; Site : in math.Vector_3 := math.Origin_3D; + Spin : in math.Matrix_3x3 := math.Identity_3x3; Mass : in math.Real := 1.0; Friction : in math.Real := 0.5; Bounce : in math.Real := 0.5; @@ -178,6 +180,7 @@ is return gel.Sprite.Forge.new_Sprite (Name, sprite.World_view (in_World), Site, + Spin, the_graphics_Model, the_physics_Model, owns_graphics => True, @@ -191,6 +194,7 @@ is function new_polygon_Sprite (in_World : in gel.World.view; Name : in String; Site : in math.Vector_3 := math.Origin_3D; + Spin : in math.Matrix_3x3 := math.Identity_3x3; Mass : in math.Real := 1.0; Friction : in math.Real := 0.5; Bounce : in math.Real := 0.5; @@ -232,6 +236,7 @@ is return gel.Sprite.Forge.new_Sprite (Name, sprite.World_view (in_World), Site, + Spin, the_graphics_Model, the_physics_Model, owns_graphics => True, @@ -245,6 +250,7 @@ is function new_rectangle_Sprite (in_World : in gel.World.view; Name : in String; Site : in math.Vector_3 := math.Origin_3D; + Spin : in math.Matrix_3x3 := math.Identity_3x3; Mass : in math.Real := 1.0; Friction : in math.Real := 0.5; Bounce : in math.Real := 0.5; @@ -269,6 +275,7 @@ is return new_polygon_Sprite (in_World, Name, Site, + Spin, Mass, Friction, Bounce, @@ -288,6 +295,7 @@ is function new_ball_Sprite (in_World : in gel.World.view; Site : in math.Vector_3 := math.Origin_3D; + Spin : in math.Matrix_3x3 := math.Identity_3x3; Mass : in math.Real := 1.0; Radius : in math.Real := 0.5; lat_Count : in Positive := openGL.Model.sphere.default_latitude_Count; @@ -297,7 +305,8 @@ is Texture : in openGL.asset_Name := openGL.null_Asset; user_Data : in any_user_Data_view := null) return gel.Sprite.view is - use type openGL.lucid_Color; + use type openGL.lucid_Color, + openGL.asset_Name; the_graphics_Model : openGL.Model.sphere.view; @@ -307,11 +316,19 @@ is begin if is_Lit -- TODO: Remaining combinations. then - the_graphics_Model := openGL.Model.sphere.lit_colored_textured.new_Sphere (Radius, - lat_Count => lat_Count, - long_Count => long_Count, - texture_Details => openGL.texture_Set.to_Details ([1 => Texture]), - Image => Texture).all'Access; + if Texture /= openGL.null_Asset + then + the_graphics_Model := openGL.Model.sphere.lit_colored_textured.new_Sphere (Radius, + lat_Count => lat_Count, + long_Count => long_Count, + texture_Details => openGL.texture_Set.to_Details ([1 => Texture]), + Image => Texture).all'Access; + else + the_graphics_Model := openGL.Model.sphere.lit_colored.new_Sphere (Radius, + lat_Count => lat_Count, + long_Count => long_Count, + Color => Color).all'Access; + end if; else if Color /= openGL.no_lucid_Color then @@ -323,6 +340,7 @@ is the_graphics_Model := openGL.Model.sphere.textured.new_Sphere (Radius, lat_Count => lat_Count, long_Count => long_Count, + texture_Details => openGL.texture_Set.to_Details ([1 => Texture]), Image => Texture).all'Access; end if; end if; @@ -330,6 +348,7 @@ is return gel.Sprite.Forge.new_Sprite ("ball_Sprite", sprite.World_view (in_World), Site, + Spin, the_graphics_Model, the_physics_Model, owns_Graphics => True, @@ -342,6 +361,7 @@ is function new_skysphere_Sprite (in_World : in gel.World.view; Site : in math.Vector_3 := math.Origin_3D; + Spin : in math.Matrix_3x3 := math.Identity_3x3; Radius : in math.Real := 1_000_000.0; Texture : in openGL.asset_Name; user_Data : in any_user_Data_view := null) return gel.Sprite.view @@ -354,11 +374,13 @@ is begin the_graphics_Model := openGL.Model.sphere.textured.new_Sphere (Radius, lat_Count => 180, + texture_Details => openGL.texture_Set.to_Details ([1 => Texture]), Image => Texture, is_Skysphere => True).all'Access; return gel.Sprite.Forge.new_Sprite ("skysphere_Sprite", sprite.World_view (in_World), Site, + Spin, the_graphics_Model, the_physics_Model, owns_Graphics => True, @@ -371,6 +393,7 @@ is function new_box_Sprite (in_World : in gel.World.view; Site : in math.Vector_3 := math.Origin_3D; + Spin : in math.Matrix_3x3 := math.Identity_3x3; Mass : in math.Real := 1.0; Size : in math.Vector_3 := [1.0, 1.0, 1.0]; Colors : in box_Colors := [others => opengl.Palette.random_Color]; @@ -397,6 +420,7 @@ is := gel.Sprite.Forge.new_Sprite ("demo.Box", sprite.World_view (in_World), Site, + Spin, the_box_Model.all'Access, the_box_physics_Model, owns_Graphics => True, @@ -411,6 +435,7 @@ is function new_box_Sprite (in_World : in gel.World.view; Site : in math.Vector_3 := math.Origin_3D; + Spin : in math.Matrix_3x3 := math.Identity_3x3; Mass : in math.Real := 1.0; Size : in math.Vector_3 := [1.0, 1.0, 1.0]; Texture : in openGL.asset_Name; @@ -436,6 +461,7 @@ is := gel.Sprite.forge.new_Sprite ("demo.Box", sprite.World_view (in_World), Site, + Spin, the_box_Model.all'Access, the_box_physics_Model, owns_graphics => True, @@ -450,6 +476,7 @@ is function new_billboard_Sprite (in_World : in gel.World.view; Site : in math.Vector_3 := math.Origin_3D; + Spin : in math.Matrix_3x3 := math.Identity_3x3; Mass : in math.Real := 1.0; Size : in math.Vector_3 := [1.0, 1.0, 1.0]; Texture : in openGL.asset_Name := openGL.null_Asset; @@ -473,6 +500,7 @@ is := gel.Sprite.forge.new_Sprite ("Billboard", sprite.World_view (in_World), Site, + Spin, the_billboard_Model.all'Access, the_billboard_physics_Model, owns_Graphics => True, @@ -487,6 +515,7 @@ is function new_billboard_Sprite (in_World : in gel.World.view; Site : in math.Vector_3 := math.Origin_3D; + Spin : in math.Matrix_3x3 := math.Identity_3x3; Color : in openGL.lucid_Color; Mass : in math.Real := 1.0; Size : in math.Vector_3 := [1.0, 1.0, 1.0]; @@ -509,6 +538,7 @@ is := gel.Sprite.forge.new_Sprite ("Billboard", sprite.World_view (in_World), Site, + Spin, the_billboard_Model.all'Access, the_billboard_physics_Model, owns_Graphics => True, @@ -523,6 +553,7 @@ is function new_arrow_Sprite (in_World : in gel.World.view; Site : in math.Vector_3 := math.Origin_3D; + Spin : in math.Matrix_3x3 := math.Identity_3x3; Mass : in math.Real := 0.0; Size : in math.Vector_3 := [1.0, 1.0, 1.0]; Texture : in openGL.asset_Name := openGL.null_Asset; @@ -545,6 +576,7 @@ is := gel.Sprite.forge.new_Sprite ("Arrow", sprite.World_view (in_World), Site, + Spin, the_graphics_Model.all'Access, the_physics_Model, owns_Graphics => True, @@ -559,6 +591,7 @@ is function new_line_Sprite (in_World : in gel.World.view; Site : in math.Vector_3 := math.Origin_3D; + Spin : in math.Matrix_3x3 := math.Identity_3x3; Mass : in math.Real := 0.0; Size : in math.Vector_3 := [1.0, 1.0, 1.0]; Texture : in openGL.asset_Name := openGL.null_Asset; @@ -580,6 +613,7 @@ is := gel.Sprite.forge.new_Sprite ("Line", sprite.World_view (in_World), Site, + Spin, the_graphics_Model.all'Access, the_physics_Model, owns_Graphics => True, @@ -594,6 +628,7 @@ is function new_segment_line_Sprite (in_World : in gel.World.view; Site : in math.Vector_3 := math.Origin_3D; + Spin : in math.Matrix_3x3 := math.Identity_3x3; Mass : in math.Real := 0.0; Size : in math.Vector_3 := [1.0, 1.0, 1.0]; Texture : in openGL.asset_Name := openGL.null_Asset; @@ -615,6 +650,7 @@ is := gel.Sprite.forge.new_Sprite ("Line", sprite.World_view (in_World), Site, + Spin, the_graphics_Model.all'Access, the_physics_Model, owns_Graphics => True, @@ -632,6 +668,7 @@ is function new_text_Sprite (in_World : in gel.World.view; Site : in math.Vector_3 := math.Origin_3D; + Spin : in math.Matrix_3x3 := math.Identity_3x3; Text : in String; Font : in openGL.Font.font_Id; Color : in openGL.Color := opengl.Palette.Black; @@ -642,12 +679,22 @@ is use Math; use type Physics.space_Kind; - the_graphics_Model : constant openGL.Model.text.lit_colored.view - := openGL.Model.text.lit_colored.new_Text (Text => Text, + the_Texture : constant openGL.asset_Name := openGL.to_Asset ("assets/opengl/texture/Face1.bmp"); + + -- the_graphics_Model : constant openGL.Model.text.lit_colored.view + -- := openGL.Model.text.lit_colored.new_Text (Text => Text, + -- Font => Font, + -- Color => (Color, openGL.Opaque), + -- texture_Details => openGL.texture_Set.to_Details ([1 => openGL.null_Asset]), + -- Centered => Centered); + + the_graphics_Model : constant openGL.Model.Text.lit_colored.view + := openGL.Model.Text.lit_colored.new_Text (Text => Text, Font => Font, Color => (Color, openGL.Opaque), - texture_Details => openGL.texture_Set.to_Details ([1 => openGL.null_Asset]), - Centered => Centered); + texture_Details => openGL.texture_Set.to_Details ([1 => the_Texture]), + Centered => True); + the_physics_Model : physics.Model.view; begin if in_World.space_Kind = Physics.Box2d @@ -673,6 +720,7 @@ is return gel.Sprite.Forge.new_Sprite ("text_Sprite", sprite.World_view (in_World), Site, + Spin, the_graphics_Model, the_physics_Model, owns_Graphics => True, diff --git a/4-high/gel/source/forge/gel-forge.ads b/4-high/gel/source/forge/gel-forge.ads index c998385..3119a2f 100644 --- a/4-high/gel/source/forge/gel-forge.ads +++ b/4-high/gel/source/forge/gel-forge.ads @@ -57,6 +57,7 @@ is function new_circle_Sprite (in_World : in gel.World.view; Name : in String; Site : in math.Vector_3 := math.Origin_3D; + Spin : in math.Matrix_3x3 := math.Identity_3x3; Mass : in math.Real := 1.0; Friction : in math.Real := 0.5; Bounce : in math.Real := 0.5; @@ -71,6 +72,7 @@ is function new_polygon_Sprite (in_World : in gel.World.view; Name : in String; Site : in math.Vector_3 := math.Origin_3D; + Spin : in math.Matrix_3x3 := math.Identity_3x3; Mass : in math.Real := 1.0; Friction : in math.Real := 0.5; Bounce : in math.Real := 0.5; @@ -84,6 +86,7 @@ is function new_rectangle_Sprite (in_World : in gel.World.view; Name : in String; Site : in math.Vector_3 := math.Origin_3D; + Spin : in math.Matrix_3x3 := math.Identity_3x3; Mass : in math.Real := 1.0; Friction : in math.Real := 0.5; Bounce : in math.Real := 0.5; @@ -102,6 +105,7 @@ is function new_ball_Sprite (in_World : in gel.World.view; Site : in math.Vector_3 := math.Origin_3D; + Spin : in math.Matrix_3x3 := math.Identity_3x3; Mass : in math.Real := 1.0; Radius : in math.Real := 0.5; lat_Count : in Positive := openGL.Model.sphere.default_latitude_Count; @@ -113,6 +117,7 @@ is function new_skysphere_Sprite (in_World : in gel.World.view; Site : in math.Vector_3 := math.Origin_3D; + Spin : in math.Matrix_3x3 := math.Identity_3x3; Radius : in math.Real := 1_000_000.0; Texture : in openGL.asset_Name; user_Data : in any_user_Data_view := null) return gel.Sprite.view; @@ -122,6 +127,7 @@ is function new_box_Sprite (in_World : in gel.World.view; Site : in math.Vector_3 := math.Origin_3D; + Spin : in math.Matrix_3x3 := math.Identity_3x3; Mass : in math.Real := 1.0; Size : in math.Vector_3 := [1.0, 1.0, 1.0]; Colors : in box_Colors := [others => opengl.Palette.random_Color]; @@ -130,6 +136,7 @@ is function new_box_Sprite (in_World : in gel.World.view; Site : in math.Vector_3 := math.Origin_3D; + Spin : in math.Matrix_3x3 := math.Identity_3x3; Mass : in math.Real := 1.0; Size : in math.Vector_3 := [1.0, 1.0, 1.0]; Texture : in openGL.asset_Name; @@ -137,6 +144,7 @@ is function new_billboard_Sprite (in_World : in gel.World.view; Site : in math.Vector_3 := math.Origin_3D; + Spin : in math.Matrix_3x3 := math.Identity_3x3; Mass : in math.Real := 1.0; Size : in math.Vector_3 := [1.0, 1.0, 1.0]; Texture : in openGL.asset_Name := openGL.null_Asset; @@ -144,6 +152,7 @@ is function new_billboard_Sprite (in_World : in gel.World.view; Site : in math.Vector_3 := math.Origin_3D; + Spin : in math.Matrix_3x3 := math.Identity_3x3; Color : in openGL.lucid_Color; Mass : in math.Real := 1.0; Size : in math.Vector_3 := [1.0, 1.0, 1.0]; @@ -152,6 +161,7 @@ is function new_arrow_Sprite (in_World : in gel.World.view; Site : in math.Vector_3 := math.Origin_3D; + Spin : in math.Matrix_3x3 := math.Identity_3x3; Mass : in math.Real := 0.0; Size : in math.Vector_3 := [1.0, 1.0, 1.0]; Texture : in openGL.asset_Name := openGL.null_Asset; @@ -161,6 +171,7 @@ is function new_line_Sprite (in_World : in gel.World.view; Site : in math.Vector_3 := math.Origin_3D; + Spin : in math.Matrix_3x3 := math.Identity_3x3; Mass : in math.Real := 0.0; Size : in math.Vector_3 := [1.0, 1.0, 1.0]; Texture : in openGL.asset_Name := openGL.null_Asset; @@ -170,6 +181,7 @@ is function new_segment_line_Sprite (in_World : in gel.World.view; Site : in math.Vector_3 := math.Origin_3D; + Spin : in math.Matrix_3x3 := math.Identity_3x3; Mass : in math.Real := 0.0; Size : in math.Vector_3 := [1.0, 1.0, 1.0]; Texture : in openGL.asset_Name := openGL.null_Asset; @@ -181,6 +193,7 @@ is function new_text_Sprite (in_World : in gel.World.view; Site : in math.Vector_3 := math.Origin_3D; + Spin : in math.Matrix_3x3 := math.Identity_3x3; Text : in String; Font : in openGL.Font.font_Id; Color : in openGL.Color := opengl.Palette.Black; diff --git a/4-high/gel/source/gel-rig.adb b/4-high/gel/source/gel-rig.adb index b7debe5..6572008 100644 --- a/4-high/gel/source/gel-rig.adb +++ b/4-high/gel/source/gel-rig.adb @@ -408,12 +408,11 @@ is half_Extents => Size / 2.0), Mass => 1.0); begin - new_Sprite := gel.Sprite.Forge.new_Sprite ("Skin Sprite", - gel.sprite.World_view (in_World), - math.Origin_3D, - Model, - physics_Model, - is_Kinematic => is_Kinematic); + new_Sprite := gel.Sprite.Forge.new_Sprite (Name => "Skin Sprite", + World => gel.sprite.World_view (in_World), + graphics_Model => Model, + physics_Model => physics_Model, + is_Kinematic => is_Kinematic); end; new_Sprite.Site_is ([0.0, 0.0, 0.0]); diff --git a/4-high/gel/source/gel-sprite.adb b/4-high/gel/source/gel-sprite.adb index 37857c8..8c6ba4e 100644 --- a/4-high/gel/source/gel-sprite.adb +++ b/4-high/gel/source/gel-sprite.adb @@ -82,7 +82,8 @@ is - procedure rebuild_Solid (Self : in out Item; at_Site : Vector_3) + procedure rebuild_Solid (Self : in out Item; at_Site : Vector_3; + and_Spin : in Matrix_3x3) is use Physics.Object; begin @@ -97,12 +98,14 @@ is Self.physics_Model.Restitution, at_Site, Self.is_Kinematic)); + Self.Solid.Spin_is (and_Spin); end rebuild_Solid; procedure define (Self : access Item; World : in World_view; at_Site : in Vector_3; + and_Spin : in Matrix_3x3; graphics_Model : access openGL. Model.item'Class; physics_Model : access physics.Model.item'Class; owns_Graphics : in Boolean; @@ -130,7 +133,7 @@ is if Self.physics_Model /= null then Self.rebuild_Shape; - Self.rebuild_Solid (at_Site); + Self.rebuild_Solid (at_Site, and_Spin); end if; end define; @@ -225,7 +228,8 @@ is function to_Sprite (Name : in String; World : in World_view; - at_Site : in Vector_3; + at_Site : in Vector_3 := [0.0, 0.0, 0.0]; + and_Spin : in Matrix_3x3 := Identity_3x3; graphics_Model : access openGL. Model.item'Class; physics_Model : access physics.Model.item'Class; owns_Graphics : in Boolean; @@ -237,7 +241,7 @@ is return Self : Item := (lace.Subject_and_deferred_Observer.forge.to_Subject_and_Observer (Name) with others => <>) do - Self.define (World, at_Site, graphics_Model, physics_Model, owns_Graphics, owns_Physics, is_Kinematic, user_Data); + Self.define (World, at_Site, and_Spin, graphics_Model, physics_Model, owns_Graphics, owns_Physics, is_Kinematic, user_Data); end return; end to_Sprite; @@ -245,7 +249,8 @@ is function new_Sprite (Name : in String; World : in World_view; - at_Site : in Vector_3; + at_Site : in Vector_3 := [0.0, 0.0, 0.0]; + and_Spin : in Matrix_3x3 := Identity_3x3; graphics_Model : access openGL. Model.item'Class; physics_Model : access physics.Model.item'Class; owns_Graphics : in Boolean := True; @@ -256,6 +261,7 @@ is Self : constant View := new Item' (to_Sprite (Name, World, at_Site, + and_Spin, graphics_Model, physics_Model, owns_Graphics, diff --git a/4-high/gel/source/gel-sprite.ads b/4-high/gel/source/gel-sprite.ads index f7d06ca..b777d62 100644 --- a/4-high/gel/source/gel-sprite.ads +++ b/4-high/gel/source/gel-sprite.ads @@ -64,6 +64,7 @@ is procedure define (Self : access Item; World : in World_view; at_Site : in Vector_3; + and_Spin : in Matrix_3x3; graphics_Model : access openGL. Model.item'Class; physics_Model : access physics.Model.item'Class; owns_Graphics : in Boolean; @@ -80,7 +81,8 @@ is is function to_Sprite (Name : in String; World : in World_view; - at_Site : in Vector_3; + at_Site : in Vector_3 := [0.0, 0.0, 0.0]; + and_Spin : in Matrix_3x3 := Identity_3x3; graphics_Model : access openGL. Model.item'Class; physics_Model : access physics.Model.item'Class; owns_Graphics : in Boolean; @@ -90,7 +92,8 @@ is function new_Sprite (Name : in String; World : in World_view; - at_Site : in Vector_3; + at_Site : in Vector_3 := [0.0, 0.0, 0.0]; + and_Spin : in Matrix_3x3 := Identity_3x3; graphics_Model : access openGL. Model.item'Class; physics_Model : access physics.Model.item'Class; owns_Graphics : in Boolean := True; @@ -324,7 +327,8 @@ is --- Physics -- procedure rebuild_Shape (Self : in out Item); - procedure rebuild_Solid (Self : in out Item; at_Site : in Vector_3); + procedure rebuild_Solid (Self : in out Item; at_Site : in Vector_3; + and_Spin : in Matrix_3x3); diff --git a/4-high/gel/source/human/gel-human.adb b/4-high/gel/source/human/gel-human.adb index 9411bd5..cd53eb3 100644 --- a/4-high/gel/source/human/gel-human.adb +++ b/4-high/gel/source/human/gel-human.adb @@ -2,6 +2,7 @@ with openGL.Model.any, -- gel.Model.box.colored, openGL.Model.box.lit_colored_textured, + openGL.texture_Set, -- gel.cone_twist_Joint, gel.Conversions, @@ -13,7 +14,7 @@ with opengl.Palette, opengl.Geometry.lit_textured_skinned, - opengl.Program .lit_textured_skinned, + opengl.Program .lit.textured_skinned, float_math.Algebra.linear.d3, ada.Strings.unbounded; @@ -157,7 +158,7 @@ is is begin for Each in Self.bone_Transforms'Range loop - openGL.Program.lit_textured_skinned.view (Self.Program) + openGL.Program.lit.textured_skinned.view (Self.Program) .bone_Transform_is (which => controller_joint_Id'Pos (Each) + 1, now => Self.bone_Transforms (Each)); end loop; @@ -478,18 +479,18 @@ is Model => openGL.to_Asset ("assets/gel/collada/mh-human-dae.dae"), -- model => gel.to_Asset ("assets/gel/collada/alfieri.dae"), Texture => openGL.null_Asset, -- gel.to_Asset ("assets/collada/gel-human-texture.tga"), + texture_Details => openGL.texture_Set.to_Details ([1 => openGL.to_Asset ("./assets/gel/Face1.bmp")]), Texture_is_lucid => False); begin - Self.bone_Sprites (the_Bone) := gel.Sprite.forge.new_Sprite (sprite_Name, - gel.sprite.World_view (World), - Origin_3D, - the_human_graphics_Model, + Self.bone_Sprites (the_Bone) := gel.Sprite.forge.new_Sprite (Name => sprite_Name, + World => gel.sprite.World_view (World), + graphics_Model => the_human_graphics_Model, -- the_graphics_Model, -- Model, - the_physics_Model, - owns_graphics => True, - owns_physics => True, - is_kinematic => is_Kinematic); + physics_Model => the_physics_Model, + owns_graphics => True, + owns_physics => True, + is_kinematic => is_Kinematic); -- Self.bone_Sprites (the_Bone).is_Visible (True); -- Self.bone_Sprites (the_Bone).is_Visible (True); end; @@ -512,14 +513,13 @@ is texture_Name => openGL.null_Asset))); begin -- raise program_Error with "TBD"; - Self.bone_Sprites (the_Bone) := gel.Sprite.forge.new_Sprite (sprite_Name, - gel.sprite.World_view (World), - Origin_3D, - the_graphics_Model, - the_physics_Model, - owns_graphics => True, - owns_physics => True, - is_kinematic => is_Kinematic); + Self.bone_Sprites (the_Bone) := gel.Sprite.forge.new_Sprite (Name => sprite_Name, + World => gel.sprite.World_view (World), + graphics_Model => the_graphics_Model, + physics_Model => the_physics_Model, + owns_graphics => True, + owns_physics => True, + is_kinematic => is_Kinematic); -- Self.bone_Sprites (the_Bone).is_Visible (False); -- Self.bone_Sprites (the_Bone).is_Visible (True); end; diff --git a/4-high/gel/source/human/gel-human_v1.adb b/4-high/gel/source/human/gel-human_v1.adb index 5c6a8b7..16bcb3e 100644 --- a/4-high/gel/source/human/gel-human_v1.adb +++ b/4-high/gel/source/human/gel-human_v1.adb @@ -1,6 +1,7 @@ with openGL.Model.any, openGL.Model.box.colored, + openGL.texture_Set, -- openGL.Model.box.lit_colored_textured, -- gel.cone_twist_Joint, gel.Conversions, @@ -13,7 +14,7 @@ with opengl.Palette, opengl.Geometry.lit_textured_skinned, - opengl.Program.lit_textured_skinned, + opengl.Program.lit.textured_skinned, ada.Strings.unbounded, ada.unchecked_Deallocation, @@ -142,7 +143,7 @@ is begin for Each in Self.bone_Transforms'Range loop - openGL.Program.lit_textured_skinned.view (Self.Program) + openGL.Program.lit.textured_skinned.view (Self.Program) .bone_Transform_is (which => controller_joint_Id'Pos (Each) + 1, now => Self.bone_Transforms (Each)); end loop; @@ -577,14 +578,13 @@ is left => (colors => (others => (Cyan, Opaque))), right => (colors => (others => (Magenta, Opaque))))); begin - Self.bone_Sprites (the_Bone) := gel.Sprite.forge.new_Sprite (sprite_Name, - gel.sprite.World_view (World), - Origin_3D, - the_graphics_Model, - the_physics_Model, - owns_graphics => True, - owns_physics => True, - is_kinematic => is_Kinematic); + Self.bone_Sprites (the_Bone) := gel.Sprite.forge.new_Sprite (Name => sprite_Name, + World => gel.sprite.World_view (World), + graphics_Model => the_graphics_Model, + physics_Model => the_physics_Model, + owns_graphics => True, + owns_physics => True, + is_kinematic => is_Kinematic); if the_display_Mode = Skin then Self.bone_Sprites (the_Bone).is_Visible (False); @@ -703,8 +703,9 @@ is -- declare the_human_graphics_Model : aliased openGL.Model.any.view - := openGL.Model.any.new_Model (Model => to_Asset (model_Name.all), - Texture => openGL.null_Asset, -- gel.to_Asset ("assets/collada/gel-human-texture.tga"), + := openGL.Model.any.new_Model (Model => to_Asset (model_Name.all), + Texture => openGL.null_Asset, -- gel.to_Asset ("assets/collada/gel-human-texture.tga"), + texture_Details => openGL.texture_Set.to_Details ([1 => openGL.to_Asset ("./assets/opengl/texture/wooden-crate.jpg")]), Texture_is_lucid => False); the_physics_Model : constant standard.physics.Model.view @@ -713,14 +714,13 @@ is Mass => 1.0, is_Tangible => False); begin - Self.skin_Sprite := gel.Sprite.forge.new_Sprite ("human.skin_Sprite", - gel.sprite.World_view (World), - Origin_3D, - the_human_graphics_Model, - the_physics_Model, - owns_graphics => True, - owns_physics => True, - is_kinematic => is_Kinematic); + Self.skin_Sprite := gel.Sprite.forge.new_Sprite (Name => "human.skin_Sprite", + World => gel.sprite.World_view (World), + graphics_Model => the_human_graphics_Model, + physics_Model =>the_physics_Model, + owns_graphics => True, + owns_physics => True, + is_kinematic => is_Kinematic); if the_display_Mode = Bones then Self.skin_Sprite.is_Visible (False); diff --git a/4-high/gel/source/world/gel-world-client.adb b/4-high/gel/source/world/gel-world-client.adb index cb44172..59218e3 100644 --- a/4-high/gel/source/world/gel-world-client.adb +++ b/4-high/gel/source/world/gel-world-client.adb @@ -1,3 +1,4 @@ +with any_math.any_Algebra.any_linear.any_d3; with gel.Events, @@ -112,6 +113,7 @@ is the_Sprite := gel.Sprite.forge.new_Sprite (+the_Pair.sprite_Name, sprite.World_view (the_World), get_Translation (the_Pair.Transform), + get_Rotation (the_Pair.Transform), the_graphics_Model, the_physics_Model, owns_Graphics => False, @@ -565,6 +567,8 @@ is Self. physics_Models, gel.World.view (Self)); -- log ("*** gel.world.client.is_a_Mirror.add sprite ~ " & the_Sprite.Name'Image); + + -- the_Sprite.Spin_is (z_Rotation_from (to_Radians (90.0))); Self.add (the_Sprite); end loop; end; diff --git a/4-high/gel/source/world/gel-world-server.adb b/4-high/gel/source/world/gel-world-server.adb index dccfb21..195cf6d 100644 --- a/4-high/gel/source/world/gel-world-server.adb +++ b/4-high/gel/source/world/gel-world-server.adb @@ -110,6 +110,7 @@ is the_Sprite := gel.Sprite.forge.new_Sprite ("2Sprite" & the_Pair.sprite_Id'Image, sprite.World_view (the_World), get_Translation (the_Pair.Transform), + get_Rotation (the_Pair.Transform), the_graphics_Model, the_physics_Model, owns_Graphics => False, diff --git a/4-high/gel/source/world/gel-world.adb b/4-high/gel/source/world/gel-world.adb index 94ab408..a21e26a 100644 --- a/4-high/gel/source/world/gel-world.adb +++ b/4-high/gel/source/world/gel-world.adb @@ -1,3 +1,4 @@ +with any_math.any_Algebra.any_linear.any_d3; with gel.Events, @@ -105,6 +106,7 @@ is the_Sprite := gel.Sprite.forge.new_Sprite ("Sprite" & the_Pair.sprite_Id'Image, sprite.World_view (the_World), get_Translation (the_Pair.Transform), + get_Rotation (the_Pair.Transform), the_graphics_Model, the_physics_Model, owns_Graphics => False,