Work on hinges.

This commit is contained in:
Rod Kay
2025-09-05 02:43:49 +10:00
parent 61d6e359ae
commit 7c3ba40482
22 changed files with 2106 additions and 2259 deletions

View File

@@ -17,13 +17,12 @@ echo Generating the binding.
echo
swig4ada -ada -c++ -cpperraswarn box2d_c.i
rm portable_new_line_Token.tmp
echo
echo Pretty printing.
echo
gnatpp -rnb -I/usr/local/include -I../../c_math/source/thin *.ads -cargs -gnat05
gnatpp -rnb -I/usr/local/include -I../../c_math/source/thin *.ads
indent -sob -di16 *.cxx

View File

@@ -198,7 +198,7 @@ b2d_Joint_set_local_Anchor (Joint* Self, bool is_Anchor_A,
local_Anchor->y));
else
b2_revolute_Joint->GetLocalAnchorB() = (b2Vec2 (local_Anchor->x,
local_Anchor->y));
local_Anchor->y));
}
@@ -319,10 +319,32 @@ b2d_Joint_Velocity_is (Joint* Self, int DoF,
}
bool
b2d_Joint_collide_Connected (Joint* Self)
{
b2JointDef* b2_Self = (b2JointDef*) Self;
b2Joint* b2_Joint = (b2Joint*) b2_Self->userData.pointer;
return b2_Joint->GetCollideConnected();
}
/// Hinge
//
bool
b2d_Joint_hinge_limit_Enabled (Joint* Self)
{
b2JointDef* b2_Self = (b2JointDef*) Self;
b2Joint* b2_Joint = (b2Joint*) b2_Self->userData.pointer;
b2RevoluteJoint* b2_Hinge = dynamic_cast <b2RevoluteJoint*> (b2_Joint);
return b2_Hinge->IsLimitEnabled();
}
void
b2d_Joint_hinge_Limits_are (Joint* Self, Real Low,
Real High)
@@ -343,4 +365,93 @@ b2d_Joint_hinge_Limits_are (Joint* Self, Real Low,
}
Vector_3
b2d_Joint_hinge_local_Anchor_on_A (Joint* Self)
{
b2JointDef* b2_Self = (b2JointDef*) Self;
b2Joint* b2_Joint = (b2Joint*) b2_Self->userData.pointer;
b2RevoluteJoint* b2_Hinge = dynamic_cast <b2RevoluteJoint*> (b2_Joint);
b2Vec2 Anchor = b2_Hinge->GetLocalAnchorA();
return {Anchor.x, Anchor.y, 0.0};
}
Vector_3
b2d_Joint_hinge_local_Anchor_on_B (Joint* Self)
{
b2JointDef* b2_Self = (b2JointDef*) Self;
b2Joint* b2_Joint = (b2Joint*) b2_Self->userData.pointer;
b2RevoluteJoint* b2_Hinge = dynamic_cast <b2RevoluteJoint*> (b2_Joint);
b2Vec2 Anchor = b2_Hinge->GetLocalAnchorB();
return {Anchor.x, Anchor.y, 0.0};
}
Real
b2d_Joint_hinge_reference_Angle (Joint* Self)
{
b2JointDef* b2_Self = (b2JointDef*) Self;
b2Joint* b2_Joint = (b2Joint*) b2_Self->userData.pointer;
b2RevoluteJoint* b2_Hinge = dynamic_cast <b2RevoluteJoint*> (b2_Joint);
return b2_Hinge->GetReferenceAngle();
}
Real
b2d_Joint_hinge_Angle (Joint* Self)
{
b2JointDef* b2_Self = (b2JointDef*) Self;
b2Joint* b2_Joint = (b2Joint*) b2_Self->userData.pointer;
b2RevoluteJoint* b2_Hinge = dynamic_cast <b2RevoluteJoint*> (b2_Joint);
return b2_Hinge->GetJointAngle();
}
bool
b2d_Joint_hinge_motor_Enabled (Joint* Self)
{
b2JointDef* b2_Self = (b2JointDef*) Self;
b2Joint* b2_Joint = (b2Joint*) b2_Self->userData.pointer;
b2RevoluteJoint* b2_Hinge = dynamic_cast <b2RevoluteJoint*> (b2_Joint);
return b2_Hinge->IsMotorEnabled();
}
Real
b2d_Joint_hinge_motor_Speed (Joint* Self)
{
b2JointDef* b2_Self = (b2JointDef*) Self;
b2Joint* b2_Joint = (b2Joint*) b2_Self->userData.pointer;
b2RevoluteJoint* b2_Hinge = dynamic_cast <b2RevoluteJoint*> (b2_Joint);
return b2_Hinge->GetMotorSpeed();
}
Real
b2d_Joint_hinge_max_motor_Torque (Joint* Self)
{
b2JointDef* b2_Self = (b2JointDef*) Self;
b2Joint* b2_Joint = (b2Joint*) b2_Self->userData.pointer;
b2RevoluteJoint* b2_Hinge = dynamic_cast <b2RevoluteJoint*> (b2_Joint);
return b2_Hinge->GetMaxMotorTorque();
}
} // extern "C"

View File

@@ -79,7 +79,7 @@ extern "C"
void b2d_Joint_Frame_B_is (Joint* Self, Matrix_4x4* Now);
void b2d_Joint_set_local_Anchor (Joint* Self, bool is_Anchor_A,
Vector_3* local_Anchor);
Vector_3* local_Anchor);
bool b2d_Joint_is_Limited (Joint* Self, int DoF);
@@ -91,14 +91,28 @@ extern "C"
Vector_3 b2d_Joint_reaction_Force (Joint* Self);
Real b2d_Joint_reaction_Torque (Joint* Self);
bool b2d_Joint_collide_Connected (Joint* Self);
/// Hinge
//
bool b2d_Joint_hinge_limit_Enabled (Joint* Self);
void b2d_Joint_hinge_Limits_are (Joint* Self, Real Low,
Real High);
Vector_3 b2d_Joint_hinge_local_Anchor_on_A (Joint* Self);
Vector_3 b2d_Joint_hinge_local_Anchor_on_B (Joint* Self);
Real b2d_Joint_hinge_reference_Angle (Joint* Self);
Real b2d_Joint_hinge_Angle (Joint* Self);
bool b2d_Joint_hinge_motor_Enabled (Joint* Self);
Real b2d_Joint_hinge_motor_Speed (Joint* Self);
Real b2d_Joint_hinge_max_motor_Torque (Joint* Self);
} // extern "C"

View File

@@ -2,84 +2,59 @@
--
with c_math_c.Vector_3;
with Interfaces.C;
use Interfaces.C;
with interfaces.C.Pointers;
use Interfaces.C;
with Interfaces.C.Pointers;
package box2d_c.b2d_Contact is
-- Item
--
type Item is
record
Object_A : access box2d_c.Object;
Object_B : access box2d_c.Object;
Site : aliased c_math_c.Vector_3.Item;
end record;
type Item is record
Object_A : access box2d_c.Object;
Object_B : access box2d_c.Object;
Site : aliased c_math_c.Vector_3.Item;
end record;
-- Item_Array
--
type Item_Array is array (interfaces.C.Size_t range <>) of aliased box2d_c.b2d_Contact.Item;
type Item_Array is
array (Interfaces.C.size_t range <>) of aliased box2d_c.b2d_Contact.Item;
-- Pointer
--
package C_Pointers is new interfaces.c.Pointers (Index => interfaces.c.size_t,
Element => box2d_c.b2d_Contact.Item,
element_Array => box2d_c.b2d_Contact.Item_Array,
default_Terminator => (others => <>));
package C_Pointers is new Interfaces.C.Pointers
(Index => Interfaces.C.size_t, Element => box2d_c.b2d_Contact.Item,
Element_Array => box2d_c.b2d_Contact.Item_Array,
Default_Terminator => (others => <>));
subtype Pointer is C_Pointers.Pointer;
subtype Pointer is C_Pointers.Pointer;
-- Pointer_Array
--
type Pointer_Array is array (interfaces.C.Size_t range <>) of aliased box2d_c.b2d_Contact.Pointer;
type Pointer_Array is
array
(Interfaces.C.size_t range <>) of aliased box2d_c.b2d_Contact.Pointer;
-- Pointer_Pointer
--
package C_Pointer_Pointers is new interfaces.c.Pointers (Index => interfaces.c.size_t,
Element => box2d_c.b2d_Contact.Pointer,
element_Array => box2d_c.b2d_Contact.Pointer_Array,
default_Terminator => null);
package C_Pointer_Pointers is new Interfaces.C.Pointers
(Index => Interfaces.C.size_t, Element => box2d_c.b2d_Contact.Pointer,
Element_Array => box2d_c.b2d_Contact.Pointer_Array,
Default_Terminator => null);
subtype Pointer_Pointer is C_Pointer_Pointers.Pointer;
subtype Pointer_Pointer is C_Pointer_Pointers.Pointer;
function construct return box2d_c.b2d_Contact.Item;
function construct return box2d_c.b2d_Contact.Item;
procedure destruct_0 (Self : in box2d_c.b2d_Contact.Item);
procedure destruct (Self : in box2d_c.b2d_Contact.Item);
private
pragma Import (CPP, construct, "ada_new_b2d_Contact_b2d_Contact");
pragma Import (CPP, destruct_0, "_ZN11b2d_ContactD1Ev");
pragma Import (CPP, destruct, "_ZN11b2d_ContactD1Ev");
end box2d_c.b2d_Contact;

View File

@@ -2,83 +2,64 @@
--
with c_math_c.Vector_3;
with Interfaces.C;
use Interfaces.C;
with interfaces.C.Pointers;
use Interfaces.C;
with Interfaces.C.Pointers;
package box2d_c.b2d_point_Collision is
-- Item
--
type Item is
record
near_Object : access box2d_c.Object;
Site_world : aliased c_math_c.Vector_3.Item;
end record;
type Item is record
near_Object : access box2d_c.Object;
Site_world : aliased c_math_c.Vector_3.Item;
end record;
-- Item_Array
--
type Item_Array is array (interfaces.C.Size_t range <>) of aliased box2d_c.b2d_point_Collision.Item;
type Item_Array is
array
(Interfaces.C.size_t range <>) of aliased box2d_c.b2d_point_Collision
.Item;
-- Pointer
--
package C_Pointers is new interfaces.c.Pointers (Index => interfaces.c.size_t,
Element => box2d_c.b2d_point_Collision.Item,
element_Array => box2d_c.b2d_point_Collision.Item_Array,
default_Terminator => (others => <>));
package C_Pointers is new Interfaces.C.Pointers
(Index => Interfaces.C.size_t,
Element => box2d_c.b2d_point_Collision.Item,
Element_Array => box2d_c.b2d_point_Collision.Item_Array,
Default_Terminator => (others => <>));
subtype Pointer is C_Pointers.Pointer;
subtype Pointer is C_Pointers.Pointer;
-- Pointer_Array
--
type Pointer_Array is array (interfaces.C.Size_t range <>) of aliased box2d_c.b2d_point_Collision.Pointer;
type Pointer_Array is
array
(Interfaces.C.size_t range <>) of aliased box2d_c.b2d_point_Collision
.Pointer;
-- Pointer_Pointer
--
package C_Pointer_Pointers is new interfaces.c.Pointers (Index => interfaces.c.size_t,
Element => box2d_c.b2d_point_Collision.Pointer,
element_Array => box2d_c.b2d_point_Collision.Pointer_Array,
default_Terminator => null);
package C_Pointer_Pointers is new Interfaces.C.Pointers
(Index => Interfaces.C.size_t,
Element => box2d_c.b2d_point_Collision.Pointer,
Element_Array => box2d_c.b2d_point_Collision.Pointer_Array,
Default_Terminator => null);
subtype Pointer_Pointer is C_Pointer_Pointers.Pointer;
subtype Pointer_Pointer is C_Pointer_Pointers.Pointer;
function construct return box2d_c.b2d_point_Collision.Item;
function construct return box2d_c.b2d_point_Collision.Item;
procedure destruct_0 (Self : in box2d_c.b2d_point_Collision.Item);
procedure destruct (Self : in box2d_c.b2d_point_Collision.Item);
private
pragma Import (CPP, construct, "ada_new_b2d_point_Collision_b2d_point_Collision");
pragma Import
(CPP, construct, "ada_new_b2d_point_Collision_b2d_point_Collision");
pragma Import (CPP, destruct_0, "_ZN19b2d_point_CollisionD1Ev");
pragma Import (CPP, destruct, "_ZN19b2d_point_CollisionD1Ev");
end box2d_c.b2d_point_Collision;

View File

@@ -3,85 +3,65 @@
with c_math_c;
with c_math_c.Vector_3;
with Interfaces.C;
use Interfaces.C;
with interfaces.C.Pointers;
use Interfaces.C;
with Interfaces.C.Pointers;
package box2d_c.b2d_ray_Collision is
-- Item
--
type Item is
record
near_Object : access box2d_c.Object;
hit_Fraction : aliased c_math_c.Real;
Normal_world : aliased c_math_c.Vector_3.Item;
Site_world : aliased c_math_c.Vector_3.Item;
end record;
type Item is record
near_Object : access box2d_c.Object;
hit_Fraction : aliased c_math_c.Real;
Normal_world : aliased c_math_c.Vector_3.Item;
Site_world : aliased c_math_c.Vector_3.Item;
end record;
-- Item_Array
--
type Item_Array is array (interfaces.C.Size_t range <>) of aliased box2d_c.b2d_ray_Collision.Item;
type Item_Array is
array
(Interfaces.C.size_t range <>) of aliased box2d_c.b2d_ray_Collision
.Item;
-- Pointer
--
package C_Pointers is new interfaces.c.Pointers (Index => interfaces.c.size_t,
Element => box2d_c.b2d_ray_Collision.Item,
element_Array => box2d_c.b2d_ray_Collision.Item_Array,
default_Terminator => (others => <>));
package C_Pointers is new Interfaces.C.Pointers
(Index => Interfaces.C.size_t, Element => box2d_c.b2d_ray_Collision.Item,
Element_Array => box2d_c.b2d_ray_Collision.Item_Array,
Default_Terminator => (others => <>));
subtype Pointer is C_Pointers.Pointer;
subtype Pointer is C_Pointers.Pointer;
-- Pointer_Array
--
type Pointer_Array is array (interfaces.C.Size_t range <>) of aliased box2d_c.b2d_ray_Collision.Pointer;
type Pointer_Array is
array
(Interfaces.C.size_t range <>) of aliased box2d_c.b2d_ray_Collision
.Pointer;
-- Pointer_Pointer
--
package C_Pointer_Pointers is new interfaces.c.Pointers (Index => interfaces.c.size_t,
Element => box2d_c.b2d_ray_Collision.Pointer,
element_Array => box2d_c.b2d_ray_Collision.Pointer_Array,
default_Terminator => null);
package C_Pointer_Pointers is new Interfaces.C.Pointers
(Index => Interfaces.C.size_t,
Element => box2d_c.b2d_ray_Collision.Pointer,
Element_Array => box2d_c.b2d_ray_Collision.Pointer_Array,
Default_Terminator => null);
subtype Pointer_Pointer is C_Pointer_Pointers.Pointer;
subtype Pointer_Pointer is C_Pointer_Pointers.Pointer;
function construct return box2d_c.b2d_ray_Collision.Item;
function construct return box2d_c.b2d_ray_Collision.Item;
procedure destruct_0 (Self : in box2d_c.b2d_ray_Collision.Item);
procedure destruct (Self : in box2d_c.b2d_ray_Collision.Item);
private
pragma Import (CPP, construct, "ada_new_b2d_ray_Collision_b2d_ray_Collision");
pragma Import
(CPP, construct, "ada_new_b2d_ray_Collision_b2d_ray_Collision");
pragma Import (CPP, destruct_0, "_ZN17b2d_ray_CollisionD1Ev");
pragma Import (CPP, destruct, "_ZN17b2d_ray_CollisionD1Ev");
end box2d_c.b2d_ray_Collision;

View File

@@ -11,271 +11,356 @@ with c_math_c.Matrix_4x4;
with c_math_c.Pointers;
with c_math_c.Vector_2;
with c_math_c.Vector_3;
with interfaces.c;
with Interfaces.C;
with swig;
with Interfaces.C;
use Interfaces.C;
use Interfaces.C;
package box2d_c.Binding is
function b2d_new_Circle
(Radius : in c_math_c.Real) return box2d_c.Pointers.Shape_Pointer;
function b2d_new_Polygon
(Vertices : in c_math_c.Vector_2.Pointer;
vertex_Count : in Interfaces.C.int)
return box2d_c.Pointers.Shape_Pointer;
function b2d_new_Box
(half_Extents : in c_math_c.Vector_3.Pointer)
return box2d_c.Pointers.Shape_Pointer;
function b2d_new_Capsule
(Radii : in c_math_c.Vector_2.Pointer; Height : in c_math_c.Real)
return box2d_c.Pointers.Shape_Pointer;
function b2d_new_Cone
(Radius : in c_math_c.Real; Height : in c_math_c.Real)
return box2d_c.Pointers.Shape_Pointer;
function b2d_new_Circle (Radius : in c_math_c.Real) return box2d_c.Pointers.Shape_Pointer;
function b2d_new_convex_Hull
(Points : in c_math_c.Vector_3.Pointer; point_Count : in Interfaces.C.int)
return box2d_c.Pointers.Shape_Pointer;
function b2d_new_Polygon (Vertices : in c_math_c.Vector_2.Pointer;
vertex_Count : in interfaces.c.int) return box2d_c.Pointers.Shape_Pointer;
function b2d_new_Cylinder
(half_Extents : in c_math_c.Vector_3.Pointer)
return box2d_c.Pointers.Shape_Pointer;
function b2d_new_Box (half_Extents : in c_math_c.Vector_3.Pointer) return box2d_c.Pointers.Shape_Pointer;
function b2d_new_Heightfield
(Width : in Interfaces.C.int; Depth : in Interfaces.C.int;
Heights : in c_math_c.Pointers.Real_Pointer;
min_Height : in c_math_c.Real; max_Height : in c_math_c.Real;
Scale : in c_math_c.Vector_3.Pointer)
return box2d_c.Pointers.Shape_Pointer;
function b2d_new_Capsule (Radii : in c_math_c.Vector_2.Pointer;
Height : in c_math_c.Real) return box2d_c.Pointers.Shape_Pointer;
function b2d_new_multiSphere
(Positions : in c_math_c.Vector_3.Pointer;
Radii : in c_math_c.Pointers.Real_Pointer;
sphere_Count : in Interfaces.C.int)
return box2d_c.Pointers.Shape_Pointer;
function b2d_new_Cone (Radius : in c_math_c.Real;
Height : in c_math_c.Real) return box2d_c.Pointers.Shape_Pointer;
function b2d_new_Plane
(Normal : in c_math_c.Vector_3.Pointer; Offset : in c_math_c.Real)
return box2d_c.Pointers.Shape_Pointer;
function b2d_new_convex_Hull (Points : in c_math_c.Vector_3.Pointer;
point_Count : in interfaces.c.int) return box2d_c.Pointers.Shape_Pointer;
function b2d_new_Cylinder (half_Extents : in c_math_c.Vector_3.Pointer) return box2d_c.Pointers.Shape_Pointer;
function b2d_new_Heightfield (Width : in interfaces.c.int;
Depth : in interfaces.c.int;
Heights : in c_math_c.Pointers.Real_Pointer;
min_Height : in c_math_c.Real;
max_Height : in c_math_c.Real;
Scale : in c_math_c.Vector_3.Pointer) return box2d_c.Pointers.Shape_Pointer;
function b2d_new_multiSphere (Positions : in c_math_c.Vector_3.Pointer;
Radii : in c_math_c.Pointers.Real_Pointer;
sphere_Count : in interfaces.c.int) return box2d_c.Pointers.Shape_Pointer;
function b2d_new_Plane (Normal : in c_math_c.Vector_3.Pointer;
Offset : in c_math_c.Real) return box2d_c.Pointers.Shape_Pointer;
function b2d_new_Sphere (Radius : in c_math_c.Real) return box2d_c.Pointers.Shape_Pointer;
function b2d_new_Sphere
(Radius : in c_math_c.Real) return box2d_c.Pointers.Shape_Pointer;
procedure b2d_free_Shape (Self : in box2d_c.Pointers.Shape_Pointer);
function b2d_Shape_user_Data (Self : in box2d_c.Pointers.Shape_Pointer) return swig.void_ptr;
function b2d_Shape_user_Data
(Self : in box2d_c.Pointers.Shape_Pointer) return swig.void_ptr;
procedure b2d_Shape_user_Data_is (Self : in box2d_c.Pointers.Shape_Pointer;
Now : in swig.void_ptr);
procedure b2d_Shape_user_Data_is
(Self : in box2d_c.Pointers.Shape_Pointer; Now : in swig.void_ptr);
procedure b2d_shape_Scale_is (Self : in box2d_c.Pointers.Shape_Pointer;
Now : in c_math_c.Vector_2.Item);
procedure b2d_shape_Scale_is
(Self : in box2d_c.Pointers.Shape_Pointer;
Now : in c_math_c.Vector_2.Item);
function b2d_new_Object (Site : in c_math_c.Vector_2.Pointer;
Mass : in c_math_c.Real;
Friction : in c_math_c.Real;
Restitution : in c_math_c.Real;
the_Shape : in box2d_c.Pointers.Shape_Pointer) return box2d_c.Pointers.Object_Pointer;
function b2d_new_Object
(Site : in c_math_c.Vector_2.Pointer; Mass : in c_math_c.Real;
Friction : in c_math_c.Real; Restitution : in c_math_c.Real;
the_Shape : in box2d_c.Pointers.Shape_Pointer)
return box2d_c.Pointers.Object_Pointer;
procedure b2d_free_Object (Self : in box2d_c.Pointers.Object_Pointer);
procedure b2d_Object_Scale_is (Self : in box2d_c.Pointers.Object_Pointer;
Now : in c_math_c.Vector_2.Pointer);
procedure b2d_Object_Scale_is
(Self : in box2d_c.Pointers.Object_Pointer;
Now : in c_math_c.Vector_2.Pointer);
function b2d_Object_Shape (Self : in box2d_c.Pointers.Object_Pointer) return box2d_c.Pointers.Shape_Pointer;
function b2d_Object_Shape
(Self : in box2d_c.Pointers.Object_Pointer)
return box2d_c.Pointers.Shape_Pointer;
function b2d_Object_user_Data (Self : in box2d_c.Pointers.Object_Pointer) return swig.void_ptr;
function b2d_Object_user_Data
(Self : in box2d_c.Pointers.Object_Pointer) return swig.void_ptr;
procedure b2d_Object_user_Data_is (Self : in box2d_c.Pointers.Object_Pointer;
Now : in swig.void_ptr);
procedure b2d_Object_user_Data_is
(Self : in box2d_c.Pointers.Object_Pointer; Now : in swig.void_ptr);
function b2d_Object_Mass (Self : in box2d_c.Pointers.Object_Pointer) return c_math_c.Real;
function b2d_Object_Mass
(Self : in box2d_c.Pointers.Object_Pointer) return c_math_c.Real;
procedure b2d_Object_Friction_is (Self : in box2d_c.Pointers.Object_Pointer;
Now : in c_math_c.Real);
procedure b2d_Object_Friction_is
(Self : in box2d_c.Pointers.Object_Pointer; Now : in c_math_c.Real);
procedure b2d_Object_Restitution_is (Self : in box2d_c.Pointers.Object_Pointer;
Now : in c_math_c.Real);
procedure b2d_Object_Restitution_is
(Self : in box2d_c.Pointers.Object_Pointer; Now : in c_math_c.Real);
function b2d_Object_Site (Self : in box2d_c.Pointers.Object_Pointer) return c_math_c.Vector_3.Item;
function b2d_Object_Site
(Self : in box2d_c.Pointers.Object_Pointer) return c_math_c.Vector_3.Item;
procedure b2d_Object_Site_is (Self : in box2d_c.Pointers.Object_Pointer;
Now : in c_math_c.Vector_3.Pointer);
procedure b2d_Object_Site_is
(Self : in box2d_c.Pointers.Object_Pointer;
Now : in c_math_c.Vector_3.Pointer);
function b2d_Object_Spin (Self : in box2d_c.Pointers.Object_Pointer) return c_math_c.Matrix_3x3.Item;
function b2d_Object_Spin
(Self : in box2d_c.Pointers.Object_Pointer)
return c_math_c.Matrix_3x3.Item;
procedure b2d_Object_Spin_is (Self : in box2d_c.Pointers.Object_Pointer;
Now : in c_math_c.Matrix_3x3.Pointer);
procedure b2d_Object_Spin_is
(Self : in box2d_c.Pointers.Object_Pointer;
Now : in c_math_c.Matrix_3x3.Pointer);
function b2d_Object_xy_Spin (Self : in box2d_c.Pointers.Object_Pointer) return c_math_c.Real;
function b2d_Object_xy_Spin
(Self : in box2d_c.Pointers.Object_Pointer) return c_math_c.Real;
procedure b2d_Object_xy_Spin_is (Self : in box2d_c.Pointers.Object_Pointer;
Now : in c_math_c.Real);
procedure b2d_Object_xy_Spin_is
(Self : in box2d_c.Pointers.Object_Pointer; Now : in c_math_c.Real);
function b2d_Object_Transform (Self : in box2d_c.Pointers.Object_Pointer) return c_math_c.Matrix_4x4.Item;
function b2d_Object_Transform
(Self : in box2d_c.Pointers.Object_Pointer)
return c_math_c.Matrix_4x4.Item;
procedure b2d_Object_Transform_is (Self : in box2d_c.Pointers.Object_Pointer;
Now : in c_math_c.Matrix_4x4.Pointer);
procedure b2d_Object_Transform_is
(Self : in box2d_c.Pointers.Object_Pointer;
Now : in c_math_c.Matrix_4x4.Pointer);
function b2d_Object_Speed (Self : in box2d_c.Pointers.Object_Pointer) return c_math_c.Vector_3.Item;
function b2d_Object_Speed
(Self : in box2d_c.Pointers.Object_Pointer) return c_math_c.Vector_3.Item;
procedure b2d_Object_Speed_is (Self : in box2d_c.Pointers.Object_Pointer;
Now : in c_math_c.Vector_3.Pointer);
procedure b2d_Object_Speed_is
(Self : in box2d_c.Pointers.Object_Pointer;
Now : in c_math_c.Vector_3.Pointer);
function b2d_Object_Gyre (Self : in box2d_c.Pointers.Object_Pointer) return c_math_c.Vector_3.Item;
function b2d_Object_Gyre
(Self : in box2d_c.Pointers.Object_Pointer) return c_math_c.Vector_3.Item;
procedure b2d_Object_Gyre_is (Self : in box2d_c.Pointers.Object_Pointer;
Now : in c_math_c.Vector_3.Pointer);
procedure b2d_Object_Gyre_is
(Self : in box2d_c.Pointers.Object_Pointer;
Now : in c_math_c.Vector_3.Pointer);
procedure b2d_Object_apply_Force (Self : in box2d_c.Pointers.Object_Pointer;
Force : in c_math_c.Vector_3.Pointer);
procedure b2d_Object_apply_Force
(Self : in box2d_c.Pointers.Object_Pointer;
Force : in c_math_c.Vector_3.Pointer);
procedure b2d_Object_apply_Torque (Self : in box2d_c.Pointers.Object_Pointer;
Torque : in c_math_c.Vector_3.Pointer);
procedure b2d_Object_apply_Torque
(Self : in box2d_c.Pointers.Object_Pointer;
Torque : in c_math_c.Vector_3.Pointer);
procedure b2d_Object_apply_Torque_impulse (Self : in box2d_c.Pointers.Object_Pointer;
Torque : in c_math_c.Vector_3.Pointer);
procedure b2d_Object_apply_Torque_impulse
(Self : in box2d_c.Pointers.Object_Pointer;
Torque : in c_math_c.Vector_3.Pointer);
procedure b2d_dump (Self : in box2d_c.Pointers.Object_Pointer);
function b2d_new_hinge_Joint_with_local_anchors (in_Space : in box2d_c.Pointers.Space_Pointer;
Object_A : in box2d_c.Pointers.Object_Pointer;
Object_B : in box2d_c.Pointers.Object_Pointer;
Anchor_in_A : in c_math_c.Vector_3.Pointer;
Anchor_in_B : in c_math_c.Vector_3.Pointer;
low_Limit : in interfaces.c.c_float;
high_Limit : in interfaces.c.c_float;
collide_Connected : in swig.bool) return box2d_c.Pointers.Joint_Pointer;
function b2d_new_hinge_Joint_with_local_anchors
(in_Space : in box2d_c.Pointers.Space_Pointer;
Object_A : in box2d_c.Pointers.Object_Pointer;
Object_B : in box2d_c.Pointers.Object_Pointer;
Anchor_in_A : in c_math_c.Vector_3.Pointer;
Anchor_in_B : in c_math_c.Vector_3.Pointer;
low_Limit : in Interfaces.C.C_float;
high_Limit : in Interfaces.C.C_float; collide_Connected : in swig.bool)
return box2d_c.Pointers.Joint_Pointer;
function b2d_new_hinge_Joint (in_Space : in box2d_c.Pointers.Space_Pointer;
Object_A : in box2d_c.Pointers.Object_Pointer;
Object_B : in box2d_c.Pointers.Object_Pointer;
Frame_A : in c_math_c.Matrix_4x4.Pointer;
Frame_B : in c_math_c.Matrix_4x4.Pointer;
low_Limit : in interfaces.c.c_float;
high_Limit : in interfaces.c.c_float;
collide_Connected : in swig.bool) return box2d_c.Pointers.Joint_Pointer;
function b2d_new_hinge_Joint
(in_Space : in box2d_c.Pointers.Space_Pointer;
Object_A : in box2d_c.Pointers.Object_Pointer;
Object_B : in box2d_c.Pointers.Object_Pointer;
Frame_A : in c_math_c.Matrix_4x4.Pointer;
Frame_B : in c_math_c.Matrix_4x4.Pointer;
low_Limit : in Interfaces.C.C_float;
high_Limit : in Interfaces.C.C_float; collide_Connected : in swig.bool)
return box2d_c.Pointers.Joint_Pointer;
procedure b2d_free_hinge_Joint (Self : in box2d_c.Pointers.Joint_Pointer);
function b2d_new_space_hinge_Joint (in_Space : in box2d_c.Pointers.Space_Pointer;
Object_A : in box2d_c.Pointers.Object_Pointer;
Frame_A : in c_math_c.Matrix_4x4.Pointer) return box2d_c.Pointers.Joint_Pointer;
function b2d_new_space_hinge_Joint
(in_Space : in box2d_c.Pointers.Space_Pointer;
Object_A : in box2d_c.Pointers.Object_Pointer;
Frame_A : in c_math_c.Matrix_4x4.Pointer)
return box2d_c.Pointers.Joint_Pointer;
function b2d_new_DoF6_Joint (Object_A : in box2d_c.Pointers.Object_Pointer;
Object_B : in box2d_c.Pointers.Object_Pointer;
Frame_A : in c_math_c.Matrix_4x4.Pointer;
Frame_B : in c_math_c.Matrix_4x4.Pointer) return box2d_c.Pointers.Joint_Pointer;
function b2d_new_DoF6_Joint
(Object_A : in box2d_c.Pointers.Object_Pointer;
Object_B : in box2d_c.Pointers.Object_Pointer;
Frame_A : in c_math_c.Matrix_4x4.Pointer;
Frame_B : in c_math_c.Matrix_4x4.Pointer)
return box2d_c.Pointers.Joint_Pointer;
function b2d_new_cone_twist_Joint (Object_A : in box2d_c.Pointers.Object_Pointer;
Object_B : in box2d_c.Pointers.Object_Pointer;
Frame_A : in c_math_c.Matrix_4x4.Pointer;
Frame_B : in c_math_c.Matrix_4x4.Pointer) return box2d_c.Pointers.Joint_Pointer;
function b2d_new_cone_twist_Joint
(Object_A : in box2d_c.Pointers.Object_Pointer;
Object_B : in box2d_c.Pointers.Object_Pointer;
Frame_A : in c_math_c.Matrix_4x4.Pointer;
Frame_B : in c_math_c.Matrix_4x4.Pointer)
return box2d_c.Pointers.Joint_Pointer;
function b2d_new_slider_Joint (Object_A : in box2d_c.Pointers.Object_Pointer;
Object_B : in box2d_c.Pointers.Object_Pointer;
Frame_A : in c_math_c.Matrix_4x4.Pointer;
Frame_B : in c_math_c.Matrix_4x4.Pointer) return box2d_c.Pointers.Joint_Pointer;
function b2d_new_slider_Joint
(Object_A : in box2d_c.Pointers.Object_Pointer;
Object_B : in box2d_c.Pointers.Object_Pointer;
Frame_A : in c_math_c.Matrix_4x4.Pointer;
Frame_B : in c_math_c.Matrix_4x4.Pointer)
return box2d_c.Pointers.Joint_Pointer;
function b2d_new_ball_Joint (Object_A : in box2d_c.Pointers.Object_Pointer;
Object_B : in box2d_c.Pointers.Object_Pointer;
Pivot_in_A : in c_math_c.Vector_3.Pointer;
Pivot_in_B : in c_math_c.Vector_3.Pointer) return box2d_c.Pointers.Joint_Pointer;
function b2d_new_ball_Joint
(Object_A : in box2d_c.Pointers.Object_Pointer;
Object_B : in box2d_c.Pointers.Object_Pointer;
Pivot_in_A : in c_math_c.Vector_3.Pointer;
Pivot_in_B : in c_math_c.Vector_3.Pointer)
return box2d_c.Pointers.Joint_Pointer;
function b2d_Joint_user_Data (Self : in box2d_c.Pointers.Joint_Pointer) return swig.void_ptr;
function b2d_Joint_user_Data
(Self : in box2d_c.Pointers.Joint_Pointer) return swig.void_ptr;
procedure b2d_Joint_user_Data_is (Self : in box2d_c.Pointers.Joint_Pointer;
Now : in swig.void_ptr);
function b2d_Joint_Object_A
(Self : in box2d_c.Pointers.Joint_Pointer)
return box2d_c.Pointers.Object_Pointer;
function b2d_Joint_Object_A (Self : in box2d_c.Pointers.Joint_Pointer) return box2d_c.Pointers.Object_Pointer;
function b2d_Joint_Object_B
(Self : in box2d_c.Pointers.Joint_Pointer)
return box2d_c.Pointers.Object_Pointer;
function b2d_Joint_Object_B (Self : in box2d_c.Pointers.Joint_Pointer) return box2d_c.Pointers.Object_Pointer;
function b2d_Joint_Frame_A
(Self : in box2d_c.Pointers.Joint_Pointer)
return c_math_c.Matrix_4x4.Item;
function b2d_Joint_Frame_A (Self : in box2d_c.Pointers.Joint_Pointer) return c_math_c.Matrix_4x4.Item;
function b2d_Joint_Frame_B
(Self : in box2d_c.Pointers.Joint_Pointer)
return c_math_c.Matrix_4x4.Item;
function b2d_Joint_Frame_B (Self : in box2d_c.Pointers.Joint_Pointer) return c_math_c.Matrix_4x4.Item;
procedure b2d_Joint_Frame_A_is
(Self : in box2d_c.Pointers.Joint_Pointer;
Now : in c_math_c.Matrix_4x4.Pointer);
procedure b2d_Joint_Frame_A_is (Self : in box2d_c.Pointers.Joint_Pointer;
Now : in c_math_c.Matrix_4x4.Pointer);
procedure b2d_Joint_Frame_B_is
(Self : in box2d_c.Pointers.Joint_Pointer;
Now : in c_math_c.Matrix_4x4.Pointer);
procedure b2d_Joint_Frame_B_is (Self : in box2d_c.Pointers.Joint_Pointer;
Now : in c_math_c.Matrix_4x4.Pointer);
procedure b2d_Joint_set_local_Anchor
(Self : in box2d_c.Pointers.Joint_Pointer; is_Anchor_A : in swig.bool;
local_Anchor : in c_math_c.Vector_3.Pointer);
procedure b2d_Joint_set_local_Anchor (Self : in box2d_c.Pointers.Joint_Pointer;
is_Anchor_A : in swig.bool;
local_Anchor : in c_math_c.Vector_3.Pointer);
function b2d_Joint_is_Limited
(Self : in box2d_c.Pointers.Joint_Pointer; DoF : in Interfaces.C.int)
return swig.bool;
function b2d_Joint_is_Limited (Self : in box2d_c.Pointers.Joint_Pointer;
DoF : in interfaces.c.int) return swig.bool;
function b2d_Joint_Extent
(Self : in box2d_c.Pointers.Joint_Pointer; DoF : in Interfaces.C.int)
return swig.bool;
function b2d_Joint_Extent (Self : in box2d_c.Pointers.Joint_Pointer;
DoF : in interfaces.c.int) return swig.bool;
procedure b2d_Joint_Velocity_is
(Self : in box2d_c.Pointers.Joint_Pointer; DoF : in Interfaces.C.int;
Now : in c_math_c.Real);
procedure b2d_Joint_Velocity_is (Self : in box2d_c.Pointers.Joint_Pointer;
DoF : in interfaces.c.int;
Now : in c_math_c.Real);
function b2d_Joint_reaction_Force
(Self : in box2d_c.Pointers.Joint_Pointer) return c_math_c.Vector_3.Item;
function b2d_Joint_reaction_Force (Self : in box2d_c.Pointers.Joint_Pointer) return c_math_c.Vector_3.Item;
function b2d_Joint_reaction_Torque
(Self : in box2d_c.Pointers.Joint_Pointer) return c_math_c.Real;
function b2d_Joint_reaction_Torque (Self : in box2d_c.Pointers.Joint_Pointer) return c_math_c.Real;
function b2d_Joint_collide_Connected
(Self : in box2d_c.Pointers.Joint_Pointer) return swig.bool;
procedure b2d_Joint_hinge_Limits_are (Self : in box2d_c.Pointers.Joint_Pointer;
Low : in c_math_c.Real;
High : in c_math_c.Real);
function b2d_Joint_hinge_limit_Enabled
(Self : in box2d_c.Pointers.Joint_Pointer) return swig.bool;
function b2d_new_Space return box2d_c.Pointers.Space_Pointer;
procedure b2d_Joint_hinge_Limits_are
(Self : in box2d_c.Pointers.Joint_Pointer; Low : in c_math_c.Real;
High : in c_math_c.Real);
function b2d_Joint_hinge_local_Anchor_on_A
(Self : in box2d_c.Pointers.Joint_Pointer) return c_math_c.Vector_3.Item;
function b2d_Joint_hinge_local_Anchor_on_B
(Self : in box2d_c.Pointers.Joint_Pointer) return c_math_c.Vector_3.Item;
function b2d_Joint_hinge_reference_Angle
(Self : in box2d_c.Pointers.Joint_Pointer) return c_math_c.Real;
function b2d_Joint_hinge_Angle
(Self : in box2d_c.Pointers.Joint_Pointer) return c_math_c.Real;
function b2d_Joint_hinge_motor_Enabled
(Self : in box2d_c.Pointers.Joint_Pointer) return swig.bool;
function b2d_Joint_hinge_motor_Speed
(Self : in box2d_c.Pointers.Joint_Pointer) return c_math_c.Real;
function b2d_Joint_hinge_max_motor_Torque
(Self : in box2d_c.Pointers.Joint_Pointer) return c_math_c.Real;
function b2d_new_Space return box2d_c.Pointers.Space_Pointer;
procedure b2d_free_Space (Self : in box2d_c.Pointers.Space_Pointer);
procedure b2d_Space_add_Object (Self : in box2d_c.Pointers.Space_Pointer;
the_Object : in box2d_c.Pointers.Object_Pointer);
procedure b2d_Space_add_Object
(Self : in box2d_c.Pointers.Space_Pointer;
the_Object : in box2d_c.Pointers.Object_Pointer);
procedure b2d_Space_rid_Object (Self : in box2d_c.Pointers.Space_Pointer;
the_Object : in box2d_c.Pointers.Object_Pointer);
procedure b2d_Space_rid_Object
(Self : in box2d_c.Pointers.Space_Pointer;
the_Object : in box2d_c.Pointers.Object_Pointer);
procedure b2d_Space_add_Joint (Self : in box2d_c.Pointers.Space_Pointer;
the_Joint : in box2d_c.Pointers.Joint_Pointer);
procedure b2d_Space_add_Joint
(Self : in box2d_c.Pointers.Space_Pointer;
the_Joint : in box2d_c.Pointers.Joint_Pointer);
procedure b2d_Space_rid_Joint (Self : in box2d_c.Pointers.Space_Pointer;
the_Joint : in box2d_c.Pointers.Joint_Pointer);
procedure b2d_Space_rid_Joint
(Self : in box2d_c.Pointers.Space_Pointer;
the_Joint : in box2d_c.Pointers.Joint_Pointer);
function b2d_b2Joint_user_Data (the_Joint : in box2d_c.Pointers.b2Joint_Pointer) return swig.void_ptr;
function b2d_b2Joint_user_Data
(the_Joint : in box2d_c.Pointers.b2Joint_Pointer) return swig.void_ptr;
function b2d_Space_first_Joint (Self : in box2d_c.Pointers.Space_Pointer) return box2d_c.joint_Cursor.Item;
function b2d_Space_first_Joint
(Self : in box2d_c.Pointers.Space_Pointer)
return box2d_c.joint_Cursor.Item;
procedure b2d_Space_next_Joint (Cursor : in box2d_c.joint_Cursor.Pointer);
function b2d_Space_joint_Element (Cursor : in box2d_c.joint_Cursor.Pointer) return box2d_c.Pointers.b2Joint_Pointer;
procedure b2d_Space_Gravity_is (Self : in box2d_c.Pointers.Space_Pointer;
Now : in c_math_c.Vector_3.Pointer);
procedure b2d_Space_evolve (Self : in box2d_c.Pointers.Space_Pointer;
By : in interfaces.c.c_float);
function b2d_Space_cast_Ray (Self : in box2d_c.Pointers.Space_Pointer;
From : in c_math_c.Vector_3.Pointer;
To : in c_math_c.Vector_3.Pointer) return box2d_c.b2d_ray_Collision.Item;
function b2d_Space_cast_Point (Self : in box2d_c.Pointers.Space_Pointer;
Point : in c_math_c.Vector_3.Pointer) return box2d_c.b2d_point_Collision.Item;
function b2d_space_contact_Count (Self : in box2d_c.Pointers.Space_Pointer) return interfaces.c.int;
function b2d_space_Contact (Self : in box2d_c.Pointers.Space_Pointer;
contact_Id : in interfaces.c.int) return box2d_c.b2d_Contact.Item;
function b2d_Space_joint_Element
(Cursor : in box2d_c.joint_Cursor.Pointer)
return box2d_c.Pointers.b2Joint_Pointer;
procedure b2d_Space_Gravity_is
(Self : in box2d_c.Pointers.Space_Pointer;
Now : in c_math_c.Vector_3.Pointer);
procedure b2d_Space_evolve
(Self : in box2d_c.Pointers.Space_Pointer; By : in Interfaces.C.C_float);
function b2d_Space_cast_Ray
(Self : in box2d_c.Pointers.Space_Pointer;
From : in c_math_c.Vector_3.Pointer; To : in c_math_c.Vector_3.Pointer)
return box2d_c.b2d_ray_Collision.Item;
function b2d_Space_cast_Point
(Self : in box2d_c.Pointers.Space_Pointer;
Point : in c_math_c.Vector_3.Pointer)
return box2d_c.b2d_point_Collision.Item;
function b2d_space_contact_Count
(Self : in box2d_c.Pointers.Space_Pointer) return Interfaces.C.int;
function b2d_space_Contact
(Self : in box2d_c.Pointers.Space_Pointer;
contact_Id : in Interfaces.C.int) return box2d_c.b2d_Contact.Item;
private
pragma Import (C, b2d_new_Circle, "Ada_b2d_new_Circle");
pragma Import (C, b2d_new_Polygon, "Ada_b2d_new_Polygon");
pragma Import (C, b2d_new_Box, "Ada_b2d_new_Box");
@@ -296,10 +381,12 @@ private
pragma Import (C, b2d_Object_Scale_is, "Ada_b2d_Object_Scale_is");
pragma Import (C, b2d_Object_Shape, "Ada_b2d_Object_Shape");
pragma Import (C, b2d_Object_user_Data, "Ada_b2d_Object_user_Data");
pragma Import (C, b2d_Object_user_Data_is, "Ada_b2d_Object_user_Data_is");
pragma Import
(C, b2d_Object_user_Data_is, "Ada_b2d_Object_user_Data_is");
pragma Import (C, b2d_Object_Mass, "Ada_b2d_Object_Mass");
pragma Import (C, b2d_Object_Friction_is, "Ada_b2d_Object_Friction_is");
pragma Import (C, b2d_Object_Restitution_is, "Ada_b2d_Object_Restitution_is");
pragma Import
(C, b2d_Object_Restitution_is, "Ada_b2d_Object_Restitution_is");
pragma Import (C, b2d_Object_Site, "Ada_b2d_Object_Site");
pragma Import (C, b2d_Object_Site_is, "Ada_b2d_Object_Site_is");
pragma Import (C, b2d_Object_Spin, "Ada_b2d_Object_Spin");
@@ -307,38 +394,72 @@ private
pragma Import (C, b2d_Object_xy_Spin, "Ada_b2d_Object_xy_Spin");
pragma Import (C, b2d_Object_xy_Spin_is, "Ada_b2d_Object_xy_Spin_is");
pragma Import (C, b2d_Object_Transform, "Ada_b2d_Object_Transform");
pragma Import (C, b2d_Object_Transform_is, "Ada_b2d_Object_Transform_is");
pragma Import
(C, b2d_Object_Transform_is, "Ada_b2d_Object_Transform_is");
pragma Import (C, b2d_Object_Speed, "Ada_b2d_Object_Speed");
pragma Import (C, b2d_Object_Speed_is, "Ada_b2d_Object_Speed_is");
pragma Import (C, b2d_Object_Gyre, "Ada_b2d_Object_Gyre");
pragma Import (C, b2d_Object_Gyre_is, "Ada_b2d_Object_Gyre_is");
pragma Import (C, b2d_Object_apply_Force, "Ada_b2d_Object_apply_Force");
pragma Import (C, b2d_Object_apply_Torque, "Ada_b2d_Object_apply_Torque");
pragma Import (C, b2d_Object_apply_Torque_impulse, "Ada_b2d_Object_apply_Torque_impulse");
pragma Import
(C, b2d_Object_apply_Torque, "Ada_b2d_Object_apply_Torque");
pragma Import
(C, b2d_Object_apply_Torque_impulse,
"Ada_b2d_Object_apply_Torque_impulse");
pragma Import (C, b2d_dump, "Ada_b2d_dump");
pragma Import (C, b2d_new_hinge_Joint_with_local_anchors, "Ada_b2d_new_hinge_Joint_with_local_anchors");
pragma Import
(C, b2d_new_hinge_Joint_with_local_anchors,
"Ada_b2d_new_hinge_Joint_with_local_anchors");
pragma Import (C, b2d_new_hinge_Joint, "Ada_b2d_new_hinge_Joint");
pragma Import (C, b2d_free_hinge_Joint, "Ada_b2d_free_hinge_Joint");
pragma Import (C, b2d_new_space_hinge_Joint, "Ada_b2d_new_space_hinge_Joint");
pragma Import
(C, b2d_new_space_hinge_Joint, "Ada_b2d_new_space_hinge_Joint");
pragma Import (C, b2d_new_DoF6_Joint, "Ada_b2d_new_DoF6_Joint");
pragma Import (C, b2d_new_cone_twist_Joint, "Ada_b2d_new_cone_twist_Joint");
pragma Import
(C, b2d_new_cone_twist_Joint, "Ada_b2d_new_cone_twist_Joint");
pragma Import (C, b2d_new_slider_Joint, "Ada_b2d_new_slider_Joint");
pragma Import (C, b2d_new_ball_Joint, "Ada_b2d_new_ball_Joint");
pragma Import (C, b2d_Joint_user_Data, "Ada_b2d_Joint_user_Data");
pragma Import (C, b2d_Joint_user_Data_is, "Ada_b2d_Joint_user_Data_is");
pragma Import (C, b2d_Joint_Object_A, "Ada_b2d_Joint_Object_A");
pragma Import (C, b2d_Joint_Object_B, "Ada_b2d_Joint_Object_B");
pragma Import (C, b2d_Joint_Frame_A, "Ada_b2d_Joint_Frame_A");
pragma Import (C, b2d_Joint_Frame_B, "Ada_b2d_Joint_Frame_B");
pragma Import (C, b2d_Joint_Frame_A_is, "Ada_b2d_Joint_Frame_A_is");
pragma Import (C, b2d_Joint_Frame_B_is, "Ada_b2d_Joint_Frame_B_is");
pragma Import (C, b2d_Joint_set_local_Anchor, "Ada_b2d_Joint_set_local_Anchor");
pragma Import
(C, b2d_Joint_set_local_Anchor, "Ada_b2d_Joint_set_local_Anchor");
pragma Import (C, b2d_Joint_is_Limited, "Ada_b2d_Joint_is_Limited");
pragma Import (C, b2d_Joint_Extent, "Ada_b2d_Joint_Extent");
pragma Import (C, b2d_Joint_Velocity_is, "Ada_b2d_Joint_Velocity_is");
pragma Import (C, b2d_Joint_reaction_Force, "Ada_b2d_Joint_reaction_Force");
pragma Import (C, b2d_Joint_reaction_Torque, "Ada_b2d_Joint_reaction_Torque");
pragma Import (C, b2d_Joint_hinge_Limits_are, "Ada_b2d_Joint_hinge_Limits_are");
pragma Import
(C, b2d_Joint_reaction_Force, "Ada_b2d_Joint_reaction_Force");
pragma Import
(C, b2d_Joint_reaction_Torque, "Ada_b2d_Joint_reaction_Torque");
pragma Import
(C, b2d_Joint_collide_Connected, "Ada_b2d_Joint_collide_Connected");
pragma Import
(C, b2d_Joint_hinge_limit_Enabled,
"Ada_b2d_Joint_hinge_limit_Enabled");
pragma Import
(C, b2d_Joint_hinge_Limits_are, "Ada_b2d_Joint_hinge_Limits_are");
pragma Import
(C, b2d_Joint_hinge_local_Anchor_on_A,
"Ada_b2d_Joint_hinge_local_Anchor_on_A");
pragma Import
(C, b2d_Joint_hinge_local_Anchor_on_B,
"Ada_b2d_Joint_hinge_local_Anchor_on_B");
pragma Import
(C, b2d_Joint_hinge_reference_Angle,
"Ada_b2d_Joint_hinge_reference_Angle");
pragma Import (C, b2d_Joint_hinge_Angle, "Ada_b2d_Joint_hinge_Angle");
pragma Import
(C, b2d_Joint_hinge_motor_Enabled,
"Ada_b2d_Joint_hinge_motor_Enabled");
pragma Import
(C, b2d_Joint_hinge_motor_Speed, "Ada_b2d_Joint_hinge_motor_Speed");
pragma Import
(C, b2d_Joint_hinge_max_motor_Torque,
"Ada_b2d_Joint_hinge_max_motor_Torque");
pragma Import (C, b2d_new_Space, "Ada_b2d_new_Space");
pragma Import (C, b2d_free_Space, "Ada_b2d_free_Space");
pragma Import (C, b2d_Space_add_Object, "Ada_b2d_Space_add_Object");
@@ -348,14 +469,14 @@ private
pragma Import (C, b2d_b2Joint_user_Data, "Ada_b2d_b2Joint_user_Data");
pragma Import (C, b2d_Space_first_Joint, "Ada_b2d_Space_first_Joint");
pragma Import (C, b2d_Space_next_Joint, "Ada_b2d_Space_next_Joint");
pragma Import (C, b2d_Space_joint_Element, "Ada_b2d_Space_joint_Element");
pragma Import
(C, b2d_Space_joint_Element, "Ada_b2d_Space_joint_Element");
pragma Import (C, b2d_Space_Gravity_is, "Ada_b2d_Space_Gravity_is");
pragma Import (C, b2d_Space_evolve, "Ada_b2d_Space_evolve");
pragma Import (C, b2d_Space_cast_Ray, "Ada_b2d_Space_cast_Ray");
pragma Import (C, b2d_Space_cast_Point, "Ada_b2d_Space_cast_Point");
pragma Import (C, b2d_space_contact_Count, "Ada_b2d_space_contact_Count");
pragma Import
(C, b2d_space_contact_Count, "Ada_b2d_space_contact_Count");
pragma Import (C, b2d_space_Contact, "Ada_b2d_space_Contact");
end box2d_c.Binding;

View File

@@ -1,82 +1,57 @@
-- This file is generated by SWIG. Please do not modify by hand.
--
with Interfaces.C;
use Interfaces.C;
with interfaces.C.Pointers;
use Interfaces.C;
with Interfaces.C.Pointers;
package box2d_c.joint_Cursor is
-- Item
--
type Item is
record
Joint : access box2d_c.b2Joint;
end record;
type Item is record
Joint : access box2d_c.b2Joint;
end record;
-- Item_Array
--
type Item_Array is array (interfaces.C.Size_t range <>) of aliased box2d_c.joint_Cursor.Item;
type Item_Array is
array (Interfaces.C.size_t range <>) of aliased box2d_c.joint_Cursor.Item;
-- Pointer
--
package C_Pointers is new interfaces.c.Pointers (Index => interfaces.c.size_t,
Element => box2d_c.joint_Cursor.Item,
element_Array => box2d_c.joint_Cursor.Item_Array,
default_Terminator => (others => <>));
package C_Pointers is new Interfaces.C.Pointers
(Index => Interfaces.C.size_t, Element => box2d_c.joint_Cursor.Item,
Element_Array => box2d_c.joint_Cursor.Item_Array,
Default_Terminator => (others => <>));
subtype Pointer is C_Pointers.Pointer;
subtype Pointer is C_Pointers.Pointer;
-- Pointer_Array
--
type Pointer_Array is array (interfaces.C.Size_t range <>) of aliased box2d_c.joint_Cursor.Pointer;
type Pointer_Array is
array
(Interfaces.C.size_t range <>) of aliased box2d_c.joint_Cursor.Pointer;
-- Pointer_Pointer
--
package C_Pointer_Pointers is new interfaces.c.Pointers (Index => interfaces.c.size_t,
Element => box2d_c.joint_Cursor.Pointer,
element_Array => box2d_c.joint_Cursor.Pointer_Array,
default_Terminator => null);
package C_Pointer_Pointers is new Interfaces.C.Pointers
(Index => Interfaces.C.size_t, Element => box2d_c.joint_Cursor.Pointer,
Element_Array => box2d_c.joint_Cursor.Pointer_Array,
Default_Terminator => null);
subtype Pointer_Pointer is C_Pointer_Pointers.Pointer;
subtype Pointer_Pointer is C_Pointer_Pointers.Pointer;
function construct return box2d_c.joint_Cursor.Item;
function construct return box2d_c.joint_Cursor.Item;
procedure destruct_0 (Self : in box2d_c.joint_Cursor.Item);
procedure destruct (Self : in box2d_c.joint_Cursor.Item);
private
pragma Import (CPP, construct, "ada_new_joint_Cursor_joint_Cursor");
pragma Import (CPP, destruct_0, "_ZN12joint_CursorD1Ev");
pragma Import (CPP, destruct, "_ZN12joint_CursorD1Ev");
end box2d_c.joint_Cursor;

View File

@@ -2,76 +2,55 @@
--
with box2d_c.Pointers;
with Interfaces.C;
use Interfaces.C;
with interfaces.C.Pointers;
use Interfaces.C;
with Interfaces.C.Pointers;
package box2d_c.pointer_Pointers is
-- Shape_Pointer_Pointer
--
package C_Shape_Pointer_Pointers is new interfaces.c.Pointers (Index => interfaces.c.size_t,
Element => box2d_c.Pointers.Shape_Pointer,
element_Array => box2d_c.Pointers.Shape_Pointer_Array,
default_Terminator => null);
subtype Shape_Pointer_Pointer is C_Shape_Pointer_Pointers.Pointer;
--
package C_Shape_Pointer_Pointers is new Interfaces.C.Pointers
(Index => Interfaces.C.size_t, Element => box2d_c.Pointers.Shape_Pointer,
Element_Array => box2d_c.Pointers.Shape_Pointer_Array,
Default_Terminator => null);
subtype Shape_Pointer_Pointer is C_Shape_Pointer_Pointers.Pointer;
-- Object_Pointer_Pointer
--
package C_Object_Pointer_Pointers is new interfaces.c.Pointers (Index => interfaces.c.size_t,
Element => box2d_c.Pointers.Object_Pointer,
element_Array => box2d_c.Pointers.Object_Pointer_Array,
default_Terminator => null);
subtype Object_Pointer_Pointer is C_Object_Pointer_Pointers.Pointer;
--
package C_Object_Pointer_Pointers is new Interfaces.C.Pointers
(Index => Interfaces.C.size_t, Element => box2d_c.Pointers.Object_Pointer,
Element_Array => box2d_c.Pointers.Object_Pointer_Array,
Default_Terminator => null);
subtype Object_Pointer_Pointer is C_Object_Pointer_Pointers.Pointer;
-- Joint_Pointer_Pointer
--
package C_Joint_Pointer_Pointers is new interfaces.c.Pointers (Index => interfaces.c.size_t,
Element => box2d_c.Pointers.Joint_Pointer,
element_Array => box2d_c.Pointers.Joint_Pointer_Array,
default_Terminator => null);
subtype Joint_Pointer_Pointer is C_Joint_Pointer_Pointers.Pointer;
--
package C_Joint_Pointer_Pointers is new Interfaces.C.Pointers
(Index => Interfaces.C.size_t, Element => box2d_c.Pointers.Joint_Pointer,
Element_Array => box2d_c.Pointers.Joint_Pointer_Array,
Default_Terminator => null);
subtype Joint_Pointer_Pointer is C_Joint_Pointer_Pointers.Pointer;
-- Space_Pointer_Pointer
--
package C_Space_Pointer_Pointers is new interfaces.c.Pointers (Index => interfaces.c.size_t,
Element => box2d_c.Pointers.Space_Pointer,
element_Array => box2d_c.Pointers.Space_Pointer_Array,
default_Terminator => null);
subtype Space_Pointer_Pointer is C_Space_Pointer_Pointers.Pointer;
--
package C_Space_Pointer_Pointers is new Interfaces.C.Pointers
(Index => Interfaces.C.size_t, Element => box2d_c.Pointers.Space_Pointer,
Element_Array => box2d_c.Pointers.Space_Pointer_Array,
Default_Terminator => null);
subtype Space_Pointer_Pointer is C_Space_Pointer_Pointers.Pointer;
-- b2Joint_Pointer_Pointer
--
package C_b2Joint_Pointer_Pointers is new interfaces.c.Pointers (Index => interfaces.c.size_t,
Element => box2d_c.Pointers.b2Joint_Pointer,
element_Array => box2d_c.Pointers.b2Joint_Pointer_Array,
default_Terminator => null);
subtype b2Joint_Pointer_Pointer is C_b2Joint_Pointer_Pointers.Pointer;
--
package C_b2Joint_Pointer_Pointers is new Interfaces.C.Pointers
(Index => Interfaces.C.size_t,
Element => box2d_c.Pointers.b2Joint_Pointer,
Element_Array => box2d_c.Pointers.b2Joint_Pointer_Array,
Default_Terminator => null);
subtype b2Joint_Pointer_Pointer is C_b2Joint_Pointer_Pointers.Pointer;
end box2d_c.pointer_Pointers;

View File

@@ -1,90 +1,88 @@
-- This file is generated by SWIG. Please do not modify by hand.
--
with Interfaces.C;
use Interfaces.C;
with interfaces.C.Pointers;
use Interfaces.C;
with Interfaces.C.Pointers;
with System;
package box2d_c.Pointers is
use System;
-- Shape_Pointer
--
package C_Shape_Pointers is new interfaces.c.Pointers (Index => interfaces.c.size_t,
Element => box2d_c.Shape,
element_Array => box2d_c.Shape_Array,
default_Terminator => System.null_Address);
package C_Shape_Pointers is new interfaces.c.Pointers
(Index => interfaces.c.size_t, Element => box2d_c.Shape,
element_Array => box2d_c.Shape_Array, default_Terminator => null_Address);
subtype Shape_Pointer is C_Shape_Pointers.Pointer;
-- Shape_Pointer_Array
--
type Shape_Pointer_Array is array (interfaces.C.Size_t range <>) of aliased box2d_c.Pointers.Shape_Pointer;
type Shape_Pointer_Array is
array
(Interfaces.C.size_t range <>) of aliased box2d_c.Pointers
.Shape_Pointer;
-- Object_Pointer
--
package C_Object_Pointers is new interfaces.c.Pointers (Index => interfaces.c.size_t,
Element => box2d_c.Object,
element_Array => box2d_c.Object_Array,
default_Terminator => System.null_Address);
package C_Object_Pointers is new interfaces.c.Pointers
(Index => interfaces.c.size_t, Element => box2d_c.Object,
element_Array => box2d_c.Object_Array, default_Terminator => null_Address);
subtype Object_Pointer is C_Object_Pointers.Pointer;
-- Object_Pointer_Array
--
type Object_Pointer_Array is array (interfaces.C.Size_t range <>) of aliased box2d_c.Pointers.Object_Pointer;
type Object_Pointer_Array is
array
(Interfaces.C.size_t range <>) of aliased box2d_c.Pointers
.Object_Pointer;
-- Joint_Pointer
--
package C_Joint_Pointers is new interfaces.c.Pointers (Index => interfaces.c.size_t,
Element => box2d_c.Joint,
element_Array => box2d_c.Joint_Array,
default_Terminator => System.null_Address);
package C_Joint_Pointers is new interfaces.c.Pointers
(Index => interfaces.c.size_t, Element => box2d_c.Joint,
element_Array => box2d_c.Joint_Array, default_Terminator => null_Address);
subtype Joint_Pointer is C_Joint_Pointers.Pointer;
-- Joint_Pointer_Array
--
type Joint_Pointer_Array is array (interfaces.C.Size_t range <>) of aliased box2d_c.Pointers.Joint_Pointer;
type Joint_Pointer_Array is
array
(Interfaces.C.size_t range <>) of aliased box2d_c.Pointers
.Joint_Pointer;
-- Space_Pointer
--
package C_Space_Pointers is new interfaces.c.Pointers (Index => interfaces.c.size_t,
Element => box2d_c.Space,
element_Array => box2d_c.Space_Array,
default_Terminator => System.null_Address);
package C_Space_Pointers is new interfaces.c.Pointers
(Index => interfaces.c.size_t, Element => box2d_c.Space,
element_Array => box2d_c.Space_Array, default_Terminator => null_Address);
subtype Space_Pointer is C_Space_Pointers.Pointer;
-- Space_Pointer_Array
--
type Space_Pointer_Array is array (interfaces.C.Size_t range <>) of aliased box2d_c.Pointers.Space_Pointer;
type Space_Pointer_Array is
array
(Interfaces.C.size_t range <>) of aliased box2d_c.Pointers
.Space_Pointer;
-- b2Joint_Pointer
--
package C_b2Joint_Pointers is new interfaces.c.Pointers (Index => interfaces.c.size_t,
Element => box2d_c.b2Joint,
element_Array => box2d_c.b2Joint_Array,
default_Terminator => System.null_Address);
package C_b2Joint_Pointers is new interfaces.c.Pointers
(Index => interfaces.c.size_t, Element => box2d_c.b2Joint,
element_Array => box2d_c.b2Joint_Array, default_Terminator => null_Address);
subtype b2Joint_Pointer is C_b2Joint_Pointers.Pointer;
-- b2Joint_Pointer_Array
--
type b2Joint_Pointer_Array is array (interfaces.C.Size_t range <>) of aliased box2d_c.Pointers.b2Joint_Pointer;
type b2Joint_Pointer_Array is
array
(Interfaces.C.size_t range <>) of aliased box2d_c.Pointers
.b2Joint_Pointer;
end box2d_c.Pointers;

View File

@@ -2,50 +2,43 @@
--
with swig;
with Interfaces.C;
use Interfaces.C;
use Interfaces.C;
package box2d_c is
-- Shape
--
--
subtype Shape is swig.opaque_structure;
type Shape_array is array (interfaces.C.Size_t range <>) of aliased box2d_c.Shape;
type Shape_array is
array (interfaces.C.Size_t range <>) of aliased box2d_c.Shape;
-- Object
--
--
subtype Object is swig.opaque_structure;
type Object_array is array (interfaces.C.Size_t range <>) of aliased box2d_c.Object;
type Object_array is
array (interfaces.C.Size_t range <>) of aliased box2d_c.Object;
-- Joint
--
--
subtype Joint is swig.opaque_structure;
type Joint_array is array (interfaces.C.Size_t range <>) of aliased box2d_c.Joint;
type Joint_array is
array (interfaces.C.Size_t range <>) of aliased box2d_c.Joint;
-- Space
--
--
subtype Space is swig.opaque_structure;
type Space_array is array (interfaces.C.Size_t range <>) of aliased box2d_c.Space;
type Space_array is
array (interfaces.C.Size_t range <>) of aliased box2d_c.Space;
-- b2Joint
--
--
subtype b2Joint is swig.opaque_structure;
type b2Joint_array is array (interfaces.C.Size_t range <>) of aliased box2d_c.b2Joint;
type b2Joint_array is
array (interfaces.C.Size_t range <>) of aliased box2d_c.b2Joint;
end box2d_c;

File diff suppressed because it is too large Load Diff

View File

@@ -18,6 +18,21 @@ is
function lower_Limit (Self : in Item) return Real is abstract;
function upper_Limit (Self : in Item) return Real is abstract;
function Angle (Self : in Item) return Real is abstract;
function limit_Enabled (Self : in Item) return Boolean is abstract;
function reference_Angle (Self : in Item) return Radians is abstract;
function Angle (Self : in Item) return Real is abstract;
function local_Anchor_on_A (Self : in Item) return Vector_3 is abstract;
function local_Anchor_on_B (Self : in Item) return Vector_3 is abstract;
---------
--- Motor
--
function motor_Enabled (Self : in Item) return Boolean is abstract;
function motor_Speed (Self : in Item) return Real is abstract;
function max_motor_Torque (Self : in Item) return Real is abstract;
end physics.Joint.hinge;

View File

@@ -56,4 +56,7 @@ is
function user_Data (Self : in Item) return access lace.Any.limited_item'Class is abstract;
function collide_Connected (Self : in Item) return Boolean is abstract;
end physics.Joint;

View File

@@ -66,6 +66,15 @@ is
end user_Data;
overriding
function collide_Connected (Self : in Item) return Boolean
is
begin
return Boolean'Val (b2d_Joint_collide_Connected (Self.C));
end collide_Connected;
--------
-- DoF6
--
@@ -245,7 +254,7 @@ is
c_Object_B,
c_Pivot_in_A'unchecked_Access,
c_Pivot_in_B'unchecked_Access);
return Self;
return physics.Joint.ball.view (Self);
end new_Ball_Joint;
@@ -408,7 +417,7 @@ is
c_Object_B,
c_Frame_A'unchecked_Access,
c_Frame_B'unchecked_Access);
return Self;
return physics.Joint.slider.view (Self);
end new_Slider_Joint;
@@ -571,7 +580,7 @@ is
c_Object_B,
c_Frame_A'unchecked_Access,
c_Frame_B'unchecked_Access);
return Self;
return physics.Joint.cone_twist.view (Self);
end new_cone_Twist_Joint;
@@ -761,7 +770,7 @@ is
c_math_c.Real (low_Limit),
c_math_c.Real (high_Limit),
Boolean'Pos (collide_Conected));
return Self;
return physics.Joint.hinge.view (Self);
end new_hinge_Joint;
@@ -780,7 +789,7 @@ is
Self.C := b2d_new_space_hinge_Joint (in_Space,
c_Object_A,
c_Frame_A'unchecked_Access);
return Self;
return physics.Joint.hinge.view (Self);
end new_hinge_Joint;
@@ -825,7 +834,7 @@ is
c_math_c.Real (low_Limit),
c_math_c.Real (high_Limit),
Boolean'Pos (collide_Conected));
return Self;
return physics.Joint.hinge.view (Self);
end new_hinge_Joint;
@@ -850,6 +859,7 @@ is
end Limits_are;
overriding
function lower_Limit (Self : in Hinge) return Real
is
@@ -872,8 +882,7 @@ is
function Angle (Self : in Hinge) return Real
is
begin
raise Error with "TODO";
return 0.0;
return Real (b2d_Joint_hinge_Angle (Self.C));
end Angle;
@@ -980,6 +989,68 @@ is
end desired_Extent_is;
overriding
function local_Anchor_on_A (Self : in Hinge) return Vector_3
is
begin
return +b2d_Joint_hinge_local_Anchor_on_A (Self.C);
end local_Anchor_on_A;
overriding
function local_Anchor_on_B (Self : in Hinge) return Vector_3
is
begin
return +b2d_Joint_hinge_local_Anchor_on_B (Self.C);
end local_Anchor_on_B;
overriding
function reference_Angle (Self : in Hinge) return Radians
is
begin
return Radians (b2d_Joint_hinge_reference_Angle (Self.C));
end reference_Angle;
overriding
function limit_Enabled (Self : in Hinge) return Boolean
is
begin
return Boolean'Val (b2d_Joint_hinge_limit_Enabled (Self.C));
end limit_Enabled;
overriding
function motor_Enabled (Self : in Hinge) return Boolean
is
begin
return Boolean'Val (b2d_Joint_hinge_motor_Enabled (Self.C));
end motor_Enabled;
overriding
function motor_Speed (Self : in Hinge) return Real
is
begin
return Real (b2d_Joint_hinge_motor_Speed (Self.C));
end motor_Speed;
overriding
function max_motor_Torque (Self : in Hinge) return Real
is
begin
return Real (b2d_Joint_hinge_max_motor_Torque (Self.C));
end max_motor_Torque;
--------
--- Free
--

View File

@@ -11,6 +11,7 @@ with
lace.Any;
package box2d_Physics.Joint
--
-- Provides glue between a physics joint and a Box2D joint.
@@ -51,9 +52,9 @@ is
low_Limit, high_Limit : in math.Real;
collide_Conected : in Boolean) return physics.Joint.hinge.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;
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;
procedure free (the_Joint : in out physics.Joint.view);
@@ -78,6 +79,11 @@ private
function user_Data (Self : in Item) return access lace.Any.limited_Item'Class;
overriding
function collide_Connected (Self : in Item) return Boolean;
use physics.Joint;
--------
@@ -341,11 +347,33 @@ private
relaxationFactor : in Real := 1.0);
overriding
function lower_Limit (Self : in Hinge) return Real;
overriding
function upper_Limit (Self : in Hinge) return Real;
overriding
function limit_Enabled (Self : in Hinge) return Boolean;
overriding
function Angle (Self : in Hinge) return Real;
overriding
function reference_Angle (Self : in Hinge) return Radians;
overriding
function local_Anchor_on_A (Self : in Hinge) return Vector_3;
overriding
function local_Anchor_on_B (Self : in Hinge) return Vector_3;
overriding
function motor_Enabled (Self : in Hinge) return Boolean;
overriding
function motor_Speed (Self : in Hinge) return Real;
overriding
function max_motor_Torque (Self : in Hinge) return Real;
end box2d_Physics.Joint;

View File

@@ -269,7 +269,6 @@ is
function new_hinge_Joint (Self : access Item; Object_A : in physics.Object.view;
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 (Self.C, Object_A, Frame_A);
begin
return the_Joint;

View File

@@ -66,6 +66,13 @@ private
overriding
function user_Data (Self : in Item) return access lace.Any.limited_item'Class;
overriding
function collide_Connected (Self : in Item) return Boolean
is
(False);
--------
-- DoF6
@@ -76,8 +83,7 @@ private
null;
end record;
type DoF6_view is access DoF6
;
type DoF6_view is access DoF6;
overriding
procedure destruct (Self : in out DoF6);
@@ -329,5 +335,34 @@ private
overriding
function Angle (Self : in Hinge) return Real;
overriding
function reference_Angle (Self : in Hinge) return Radians
is (raise Program_Error);
overriding
function local_Anchor_on_A (Self : in Hinge) return Vector_3
is (raise Program_Error);
overriding
function local_Anchor_on_B (Self : in Hinge) return Vector_3
is (raise Program_Error);
overriding
function limit_Enabled (Self : in Hinge) return Boolean
is (raise Program_Error);
overriding
function motor_Enabled (Self : in Hinge) return Boolean
is (raise Program_Error);
overriding
function motor_Speed (Self : in Hinge) return Real
is (raise Program_Error);
overriding
function max_motor_Torque (Self : in Hinge) return Real
is (raise Program_Error);
end bullet_Physics.Joint;

View File

@@ -25,6 +25,8 @@ is
low_Limit => to_Radians (-180.0),
high_Limit => to_Radians ( 180.0),
collide_Conected => False);
Self.pivot_Anchor := pivot_Anchor;
end define;
@@ -162,11 +164,50 @@ is
function Angle (Self : in Item'Class) return Real
function Anchor_on_A (Self : in Item) return Vector_3
is
begin
raise Error with "TODO";
return 0.0;
return Self.Physics.local_Anchor_on_A;
end Anchor_on_A;
function Anchor_on_B (Self : in Item) return Vector_3
is
begin
return Self.Physics.local_Anchor_on_B;
end Anchor_on_B;
function pivot_Anchor (Self : in Item) return Vector_3
is
begin
return Self.pivot_Anchor;
end pivot_Anchor;
function reference_Angle (Self : in Item) return Radians
is
begin
return Self.Physics.reference_Angle;
end reference_Angle;
function limit_Enabled (Self : in Item) return Boolean
is
begin
return Self.Physics.limit_Enabled;
end limit_Enabled;
function Angle (Self : in Item) return Real
is
begin
return Self.Physics.Angle;
end Angle;
@@ -210,6 +251,35 @@ is
end Physics;
---------
--- Motor
--
function motor_Enabled (Self : in Item) return Boolean
is
begin
return Self.Physics.motor_Enabled;
end motor_Enabled;
function motor_Speed (Self : in Item) return Real
is
begin
return Self.Physics.motor_Speed;
end motor_Speed;
function max_motor_Torque (Self : in Item) return Real
is
begin
return Self.Physics.max_motor_Torque;
end max_motor_Torque;
----------------
--- Joint Limits
--

View File

@@ -66,11 +66,14 @@ is
procedure destroy (Self : in out Item);
--------------
--- Attributes
--
function Angle (Self : in Item'Class) return Real;
function reference_Angle (Self : in Item) return Radians;
function Angle (Self : in Item) return Real;
overriding
function Physics (Self : in Item) return Joint.Physics_view;
@@ -81,11 +84,13 @@ is
relaxation_Factor : in Real := 1.0);
overriding
function Frame_A (Self : in Item) return Matrix_4x4;
overriding
function Frame_B (Self : in Item) return Matrix_4x4;
overriding
procedure Frame_A_is (Self : in out Item; Now : in Matrix_4x4);
overriding
procedure Frame_B_is (Self : in out Item; Now : in Matrix_4x4);
@@ -93,16 +98,27 @@ is
function Degrees_of_freedom (Self : in Item) return joint.degree_of_Freedom;
function Anchor_on_A (Self : in Item) return Vector_3;
function Anchor_on_B (Self : in Item) return Vector_3;
function pivot_Anchor (Self : in Item) return Vector_3;
function limit_Enabled (Self : in Item) return Boolean;
-- Bounds - limits the range of motion for a degree of freedom.
--
overriding
function low_Bound (Self : access Item; for_Degree : in joint.Degree_of_freedom) return Real;
overriding
procedure low_Bound_is (Self : access Item; for_Degree : in joint.Degree_of_freedom;
Now : in Real);
overriding
function high_Bound (Self : access Item; for_Degree : in joint.Degree_of_freedom) return Real;
overriding
procedure high_Bound_is (Self : access Item; for_Degree : in joint.Degree_of_freedom;
Now : in Real);
@@ -116,11 +132,14 @@ is
procedure Velocity_is (Self : in Item; for_Degree : in joint.Degree_of_freedom;
Now : in Real);
--------------
--- Operations
---------
--- Motor
--
-- Nil.
function motor_Enabled (Self : in Item) return Boolean;
function motor_Speed (Self : in Item) return Real;
function max_motor_Torque (Self : in Item) return Real;
@@ -130,6 +149,8 @@ private
record
Physics : access std_physics.Joint.hinge.item'Class;
pivot_Anchor : Vector_3;
low_Bound,
high_Bound : Real;

View File

@@ -61,26 +61,28 @@ is
--- Hinges
--
function local_Anchor_on_A (Self : in Item) return Vector_3
is
begin
return Self.local_Anchor_on_A;
end local_Anchor_on_A;
function local_Anchor_on_B (Self : in Item) return Vector_3
is
begin
return Self.local_Anchor_on_B;
end local_Anchor_on_B;
-- function local_Anchor_on_A (Self : in Item'Class) return Vector_3
-- is
-- begin
-- return Self.Physics.local_Anchor_on_A;
-- -- return Self.local_Anchor_on_A;
-- end local_Anchor_on_A;
--
--
--
-- function local_Anchor_on_B (Self : in Item'Class) return Vector_3
-- is
-- begin
-- return Self.Physics.local_Anchor_on_B;
-- -- return Self.local_Anchor_on_B;
-- end local_Anchor_on_B;
procedure local_Anchor_on_A_is (Self : out Item; Now : in Vector_3)
is
begin
Self.local_Anchor_on_A := Now;
-- Self.local_Anchor_on_A := Now;
if Self.Sprite_A.World /= null
then
@@ -94,7 +96,7 @@ is
procedure local_Anchor_on_B_is (Self : out Item; Now : in Vector_3)
is
begin
Self.local_Anchor_on_B := Now;
-- Self.local_Anchor_on_B := Now;
if Self.Sprite_B.World /= null
then
@@ -120,4 +122,12 @@ is
end reaction_Torque;
function collide_Connected (Self : in Item'Class) return Boolean
is
begin
return Self.Physics.collide_Connected;
end collide_Connected;
end gel.Joint;

View File

@@ -89,6 +89,13 @@ is
function reaction_Torque (Self : in Item'Class) return Real;
function collide_Connected (Self : in Item'Class) return Boolean;
-- function local_Anchor_on_A (Self : in Item'Class) return Vector_3;
-- function local_Anchor_on_B (Self : in Item'Class) return Vector_3;
--------------
--- Operations
--
@@ -100,8 +107,8 @@ is
--- Hinges
--
function local_Anchor_on_A (Self : in Item) return Vector_3;
function local_Anchor_on_B (Self : in Item) return Vector_3;
-- function local_Anchor_on_A (Self : in Item) return Vector_3;
-- function local_Anchor_on_B (Self : in Item) return Vector_3;
procedure local_Anchor_on_A_is (Self : out Item; Now : in Vector_3);
procedure local_Anchor_on_B_is (Self : out Item; Now : in Vector_3);
@@ -115,8 +122,8 @@ private
Sprite_A : access gel.Sprite.item'Class;
Sprite_B : access gel.Sprite.item'Class;
local_Anchor_on_A : Vector_3;
local_Anchor_on_B : Vector_3;
-- local_Anchor_on_A : Vector_3;
-- local_Anchor_on_B : Vector_3;
end record;
null_Joints : constant Joint.views (1 .. 0) := [others => null];