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

@@ -182,10 +182,12 @@ is
function new_polygon_Sprite (in_World : in gel.World.view; function new_polygon_Sprite (in_World : in gel.World.view;
Name : in String;
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;
Friction : in math.Real := 0.5; Friction : in math.Real := 0.5;
Bounce : in math.Real := 0.5; Bounce : in math.Real := 0.5;
is_Tangible : in Boolean := True;
Vertices : in Geometry_2d.Sites; Vertices : in Geometry_2d.Sites;
Color : in openGL.Color := opengl.Palette.White; Color : in openGL.Color := opengl.Palette.White;
Texture : in openGL.asset_Name := openGL.null_Asset; Texture : in openGL.asset_Name := openGL.null_Asset;
@@ -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,
@@ -236,10 +238,12 @@ is
function new_rectangle_Sprite (in_World : in gel.World.view; function new_rectangle_Sprite (in_World : in gel.World.view;
Name : in String;
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;
Friction : in math.Real := 0.5; Friction : in math.Real := 0.5;
Bounce : 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;
@@ -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;