gel.demos: Update code to use new openGL updates.

This commit is contained in:
Rod Kay
2025-09-14 10:11:21 +10:00
parent d357ce109b
commit 5afee0e2e4
41 changed files with 677 additions and 347 deletions

View File

@@ -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 =>

View File

@@ -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,

View File

@@ -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;

View File

@@ -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]);

View File

@@ -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,

View File

@@ -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);

View File

@@ -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;

View File

@@ -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);

View File

@@ -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;

View File

@@ -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,

View File

@@ -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,