physics.box2d_physics.object: Cosmetics.
This commit is contained in:
@@ -1,7 +1,5 @@
|
|||||||
with
|
with
|
||||||
box2d_c.Binding,
|
box2d_c.Binding,
|
||||||
box2d_c.Pointers,
|
|
||||||
|
|
||||||
box2d_physics.Shape,
|
box2d_physics.Shape,
|
||||||
|
|
||||||
c_math_c.Vector_2,
|
c_math_c.Vector_2,
|
||||||
@@ -15,6 +13,7 @@ with
|
|||||||
ada.unchecked_Deallocation,
|
ada.unchecked_Deallocation,
|
||||||
ada.Unchecked_Conversion;
|
ada.Unchecked_Conversion;
|
||||||
|
|
||||||
|
|
||||||
package body box2d_Physics.Object
|
package body box2d_Physics.Object
|
||||||
is
|
is
|
||||||
use
|
use
|
||||||
@@ -46,9 +45,8 @@ is
|
|||||||
Restitution : in Real;
|
Restitution : in Real;
|
||||||
at_Site : in Vector_3)
|
at_Site : in Vector_3)
|
||||||
is
|
is
|
||||||
Self_as_any : constant Any_limited_view := Any_limited_view (Self);
|
c_Site : aliased c_math_c.Vector_2.item := (c_math_c.Real (at_Site (1)),
|
||||||
c_Site : aliased c_math_c.Vector_2.item := (c_math_c.Real (at_Site (1)),
|
c_math_c.Real (at_Site (2)));
|
||||||
c_math_c.Real (at_Site (2)));
|
|
||||||
begin
|
begin
|
||||||
Self.C := b2d_new_Object (c_Site'unchecked_Access,
|
Self.C := b2d_new_Object (c_Site'unchecked_Access,
|
||||||
c_math_c.Real (Mass),
|
c_math_c.Real (Mass),
|
||||||
@@ -56,8 +54,8 @@ is
|
|||||||
c_math_c.Real (Restitution),
|
c_math_c.Real (Restitution),
|
||||||
box2d_physics.Shape.view (Shape).C);
|
box2d_physics.Shape.view (Shape).C);
|
||||||
Self.Shape := Shape;
|
Self.Shape := Shape;
|
||||||
b2d_Object_user_Data_is (box2d_c.Pointers.Object_pointer (Self.C),
|
b2d_Object_user_Data_is (Self.C,
|
||||||
to_void_ptr (Self_as_any));
|
to_void_ptr (Self));
|
||||||
Self.Site_is (at_Site);
|
Self.Site_is (at_Site);
|
||||||
Self.update_Dynamics;
|
Self.update_Dynamics;
|
||||||
end define;
|
end define;
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ with
|
|||||||
physics.Shape,
|
physics.Shape,
|
||||||
physics.Model,
|
physics.Model,
|
||||||
box2d_C;
|
box2d_C;
|
||||||
|
with box2d_c.Pointers;
|
||||||
|
|
||||||
private
|
private
|
||||||
with
|
with
|
||||||
@@ -55,7 +56,9 @@ private
|
|||||||
|
|
||||||
type Item is limited new physics.Object.item with
|
type Item is limited new physics.Object.item with
|
||||||
record
|
record
|
||||||
C : access box2d_C.Object;
|
-- C : access box2d_C.Object;
|
||||||
|
C : box2d_c.Pointers.Object_pointer;
|
||||||
|
|
||||||
Shape : physics.Shape.view;
|
Shape : physics.Shape.view;
|
||||||
Model : physics.Model.view;
|
Model : physics.Model.view;
|
||||||
user_Data : access lace.Any.limited_item'Class;
|
user_Data : access lace.Any.limited_item'Class;
|
||||||
|
|||||||
Reference in New Issue
Block a user