Apply gel hinge joint limits when appropriate.

This commit is contained in:
Rod Kay
2025-08-04 14:34:12 +10:00
parent 59d478511e
commit 61d6e359ae
7 changed files with 77 additions and 60 deletions

View File

@@ -765,7 +765,9 @@ is
end new_hinge_Joint;
function new_hinge_Joint (Object_A : in physics.Object.view;
function new_hinge_Joint (in_Space : in box2d_c.Pointers.Space_Pointer;
Object_A : in physics.Object.view;
Frame_A : in Matrix_4x4) return physics.Joint.hinge.view
is
use type box2d_physics.Object.view;
@@ -775,7 +777,8 @@ is
c_Object_A : constant box2d_C.Pointers.Object_Pointer := box2d_physics.Object.view (Object_A).C;
c_Frame_A : aliased c_math_c.Matrix_4x4.item := +Frame_A;
begin
Self.C := b2d_new_space_hinge_Joint (c_Object_A,
Self.C := b2d_new_space_hinge_Joint (in_Space,
c_Object_A,
c_Frame_A'unchecked_Access);
return Self;
end new_hinge_Joint;

View File

@@ -51,7 +51,8 @@ is
low_Limit, high_Limit : in math.Real;
collide_Conected : in Boolean) return physics.Joint.hinge.view;
function new_hinge_Joint (Object_A : in physics.Object.view;
function new_hinge_Joint (in_Space : in box2d_c.Pointers.Space_Pointer;
Object_A : in physics.Object.view;
Frame_A : in Matrix_4x4) return physics.Joint.hinge.view;

View File

@@ -270,7 +270,7 @@ is
Frame_A : in Matrix_4x4) return physics.Joint.hinge.view
is
pragma unreferenced (Self);
the_Joint : constant physics.Joint.hinge.view := box2d_physics.Joint.new_hinge_Joint (Object_A, Frame_A);
the_Joint : constant physics.Joint.hinge.view := box2d_physics.Joint.new_hinge_Joint (Self.C, Object_A, Frame_A);
begin
return the_Joint;
end new_hinge_Joint;