Hello,
I am trying to set user data on a box2d Body, and get it back, the API says there exists
and
but I have an error and theses functions doesnât seem to exists in Box2d v3. âŚ?
My goal is to get back the GameObject Id from a box2d body⌠is this possible?
it does exists in the box2d v3 manual:
In debug mode, if I just evaluate b2d.body object, I get this⌠and no get_user_data !
b2d.body
{ -- <table: 0x0204c4c18bc0>
B2_DYNAMIC_BODY = 2,
B2_KINEMATIC_BODY = 1,
B2_STATIC_BODY = 0,
apply_angular_impulse = <function: 0x0204c4c1a0d0>,
apply_force = <function: 0x0204c4c2b840>,
apply_force_to_center = <function: 0x0204c4c2b8b0>,
apply_linear_impulse = <function: 0x0204c4c2b9a0>,
apply_linear_impulse_to_center = <function: 0x0204c4c2ba20>,
apply_torque = <function: 0x0204c4c2b930>,
compute_aabb = <function: 0x0204c4c19a30>,
create_chain = <function: 0x0204c4c18cf0>,
create_shape = <function: 0x0204c4c18c80>,
destroy_shape = <function: 0x0204c4c19aa0>,
enable_contact_events = <function: 0x0204c4c191c0>,
enable_hit_events = <function: 0x0204c4c19240>,
enable_sleep = <function: 0x0204c4c1a860>,
get_angle = <function: 0x0204c4c19550>,
get_angular_damping = <function: 0x0204c4c19e10>,
get_angular_velocity = <function: 0x0204c4c19c10>,
get_contact_data = <function: 0x0204c4c199b0>,
get_force = <function: 0x0204c4c2b500>,
get_gravity_scale = <function: 0x0204c4c19670>,
get_inertia = <function: 0x0204c4c19310>,
get_joints = <function: 0x0204c4c19940>,
get_linear_damping = <function: 0x0204c4c19d10>,
get_linear_velocity = <function: 0x0204c4c19b10>,
get_linear_velocity_from_local_point = <function: 0x0204c4c2b7b0>,
get_linear_velocity_from_world_point = <function: 0x0204c4c2b720>,
get_local_center = <function: 0x0204c4c2b480>,
get_local_center_of_mass = <function: 0x0204c4c2b400>,
get_local_point = <function: 0x0204c4c2b630>,
get_local_vector = <function: 0x0204c4c2b6a0>,
get_mass = <function: 0x0204c4c192a0>,
get_mass_data = <function: 0x0204c4c19400>,
get_name = <function: 0x0204c4c18c40>,
get_position = <function: 0x0204c4c18f40>,
get_rotational_inertia = <function: 0x0204c4c19380>,
get_shapes = <function: 0x0204c4c195c0>,
get_sleep_threshold = <function: 0x0204c4c1a8d0>,
get_transform = <function: 0x0204c4c18fb0>,
get_type = <function: 0x0204c4c19770>,
get_world = <function: 0x0204c4c1a150>,
get_world_center = <function: 0x0204c4c198d0>,
get_world_center_of_mass = <function: 0x0204c4c19850>,
get_world_point = <function: 0x0204c4c2b540>,
get_world_vector = <function: 0x0204c4c2b5b0>,
is_active = <function: 0x0204c4c19110>,
is_awake = <function: 0x0204c4c19ff0>,
is_bullet = <function: 0x0204c4c19f10>,
is_fixed_rotation = <function: 0x0204c4c1a6e0>,
is_sleeping_allowed = <function: 0x0204c4c18d60>,
is_sleeping_enabled = <function: 0x0204c4c1a7e0>,
is_valid = <function: 0x0204c4c18a90>,
reset_mass_data = <function: 0x0204c4c194e0>,
set_active = <function: 0x0204c4c19150>,
set_angular_damping = <function: 0x0204c4c19e90>,
set_angular_velocity = <function: 0x0204c4c19c90>,
set_awake = <function: 0x0204c4c1a060>,
set_bullet = <function: 0x0204c4c19f80>,
set_fixed_rotation = <function: 0x0204c4c1a760>,
set_gravity_scale = <function: 0x0204c4c196f0>,
set_linear_damping = <function: 0x0204c4c19d90>,
set_linear_velocity = <function: 0x0204c4c19b90>,
set_mass_data = <function: 0x0204c4c19470>,
set_name = <function: 0x0204c4c18e00>,
set_sleep_threshold = <function: 0x0204c4c1a950>,
set_sleeping_allowed = <function: 0x0204c4c18eb0>,
set_target_transform = <function: 0x0204c4c19090>,
set_transform = <function: 0x0204c4c19020>,
set_type = <function: 0x0204c4c197e0>
}