gel.forge: Add 'Name' and 'is_Tangible' parameters to polygon and rectangle sprite constructors in package body.

This commit is contained in:
Rod Kay
2024-02-03 21:18:24 +11:00
parent a0316025cf
commit 2fdc670868

View File

@@ -181,15 +181,17 @@ is
function new_polygon_Sprite (in_World : in gel.World.view; function new_polygon_Sprite (in_World : in gel.World.view;
Site : in math.Vector_3 := math.Origin_3D; Name : in String;
Mass : in math.Real := 1.0; Site : in math.Vector_3 := math.Origin_3D;
Friction : in math.Real := 0.5; Mass : in math.Real := 1.0;
Bounce : in math.Real := 0.5; Friction : in math.Real := 0.5;
Vertices : in Geometry_2d.Sites; Bounce : in math.Real := 0.5;
Color : in openGL.Color := opengl.Palette.White; is_Tangible : in Boolean := True;
Texture : in openGL.asset_Name := openGL.null_Asset; Vertices : in Geometry_2d.Sites;
user_Data : in any_user_Data_view := null) return gel.Sprite.view Color : in openGL.Color := opengl.Palette.White;
Texture : in openGL.asset_Name := openGL.null_Asset;
user_Data : in any_user_Data_view := null) return gel.Sprite.view
is is
use type Geometry_2d.Sites, use type Geometry_2d.Sites,
openGL.asset_Name; openGL.asset_Name;
@@ -206,10 +208,10 @@ is
:= physics.Model.Forge.new_physics_Model (shape_Info => (physics.Model.Polygon, := physics.Model.Forge.new_physics_Model (shape_Info => (physics.Model.Polygon,
vertex_Count => Vertices'Length, vertex_Count => Vertices'Length,
Vertices => Vertices & Padding), Vertices => Vertices & Padding),
-- Site => Vector_3 (Site & 0.0),
Mass => Mass, Mass => Mass,
Friction => Friction, Friction => Friction,
Restitution => Bounce); Restitution => Bounce,
is_Tangible => is_Tangible);
begin begin
if Texture = openGL.null_Asset if Texture = openGL.null_Asset
then then
@@ -222,7 +224,7 @@ is
texture_Count => 1)).all'Access; texture_Count => 1)).all'Access;
end if; end if;
return gel.Sprite.Forge.new_Sprite ("polygon_Sprite", return gel.Sprite.Forge.new_Sprite (Name,
sprite.World_view (in_World), sprite.World_view (in_World),
Site, Site,
the_graphics_Model, the_graphics_Model,
@@ -235,16 +237,18 @@ is
function new_rectangle_Sprite (in_World : in gel.World.view; function new_rectangle_Sprite (in_World : in gel.World.view;
Site : in math.Vector_3 := math.Origin_3D; Name : in String;
Mass : in math.Real := 1.0; Site : in math.Vector_3 := math.Origin_3D;
Friction : in math.Real := 0.5; Mass : in math.Real := 1.0;
Bounce : in math.Real := 0.5; Friction : in math.Real := 0.5;
Bounce : in math.Real := 0.5;
is_Tangible : in Boolean := True;
Width, Width,
Height : in math.Real; Height : in math.Real;
Color : in openGL.Color := opengl.Palette.White; Color : in openGL.Color := opengl.Palette.White;
Texture : in openGL.asset_Name := openGL.null_Asset; Texture : in openGL.asset_Name := openGL.null_Asset;
user_Data : in any_user_Data_view := null) return gel.Sprite.view user_Data : in any_user_Data_view := null) return gel.Sprite.view
is is
use Math; use Math;
@@ -256,7 +260,7 @@ is
[ half_Width, half_Height], [ half_Width, half_Height],
[-half_Width, half_Height]]; [-half_Width, half_Height]];
begin begin
return new_polygon_Sprite (in_World, Site, Mass, Friction, Bounce, the_Vertices, Color, Texture, user_Data); return new_polygon_Sprite (in_World, Name, Site, Mass, Friction, Bounce, is_Tangible, the_Vertices, Color, Texture, user_Data);
end new_rectangle_Sprite; end new_rectangle_Sprite;
@@ -266,15 +270,15 @@ is
-- --
function new_ball_Sprite (in_World : in gel.World.view; function new_ball_Sprite (in_World : in gel.World.view;
Site : in math.Vector_3 := math.Origin_3D; Site : in math.Vector_3 := math.Origin_3D;
Mass : in math.Real := 1.0; Mass : in math.Real := 1.0;
Radius : in math.Real := 0.5; Radius : in math.Real := 0.5;
lat_Count : in Positive := openGL.Model.sphere.default_latitude_Count; lat_Count : in Positive := openGL.Model.sphere.default_latitude_Count;
long_Count : in Positive := openGL.Model.sphere.default_longitude_Count; long_Count : in Positive := openGL.Model.sphere.default_longitude_Count;
is_Lit : in Boolean := True; is_Lit : in Boolean := True;
Color : in openGL.lucid_Color := opengl.no_lucid_Color; Color : in openGL.lucid_Color := opengl.no_lucid_Color;
Texture : in openGL.asset_Name := openGL.null_Asset; Texture : in openGL.asset_Name := openGL.null_Asset;
user_Data : in any_user_Data_view := null) return gel.Sprite.view user_Data : in any_user_Data_view := null) return gel.Sprite.view
is is
use type openGL.lucid_Color; use type openGL.lucid_Color;