ExtremePhysics: all pages

Debug drawing

Last updated 2 August 2011

ep_gm_functions_init

ep_gm_functions_init()

Initializes GM functions, for GM6, GM7 and GM8. It doesn't work in GM8.1, use the next function instead. You should call this function before using debug drawing. Don't rely on this function, use it only for debugging purposes.

Returns whether successful.


ep_gm_functions_init_address

ep_gm_functions_init_address(address)

Same as the previous function, but for GM8.1. It should be called like this:

ep_gm_functions_init_address(get_function_address("get_function_address"));

get_function_address was added in GM 8.1.106. If you get an error message saying the function can't be found, you should update Game Maker.

Returns whether successful.


ep_debugdraw_set_transformation

ep_debugdraw_set_transformation(translation_x, translation_y, rotation, scale)

Sets a transformation that will be used for debug drawing. The transformations are performed in this order: scale, rotate, translate.

  • translation_x: The x component of the translation vector.
  • translation_y: The y component of the translation vector.
  • rotation: The rotation (in radians).
  • scale: The scale factor.

ep_debugdraw_bodies

ep_debugdraw_bodies(world_id, color_static, color_dynamic)

Draws the outline of all bodies.

  • world_id: The id of the world.
  • color_static: The color of static bodies.
  • color_dynamic: The color of dynamic bodies.

ep_debugdraw_links(world_id, color_shapelink, color_contactlink, color_jointlink)

Draws links between connected bodies.

  • world_id: The id of the world.
  • color_shapelink: The color of shape links.
  • color_contactlink: The color of contact links.
  • color_jointlink: The color of joint links.

ep_debugdraw_views

ep_debugdraw_views(world_id, color_view)

Draws the outline of all views.

  • world_id: The id of the world.
  • color_view: The color of views.

ep_debugdraw_velocity

ep_debugdraw_velocity(world_id, color_velocity, scale, rotscale)

Draws the velocity vector of all bodies.

  • world_id: The id of the world.
  • color_velocity: The color of velocity vectors.
  • scale: The scale of velocity vectors.
  • rotscale: The scale of rotational velocity circles (use 0 to disable this).

ep_debugdraw_forces

ep_debugdraw_forces(world_id, color_force, scale, rotscale)

Draws important forces. This includes contacts, joints, joint limits and forces. This does not include springs and gravity.

  • world_id: The id of the world.
  • color_force: The color of forces.
  • scale: The scale of force vectors.
  • rotscale: The scale of torque circles (use 0 to disable this).

ep_debugdraw_constraints

ep_debugdraw_constraints(world_id, color_contactpoint, color_joint)

Draws all contacts and joints.

  • world_id: The id of the world.
  • color_contactpoint: The color of contact points.
  • color_hinge: The color of joints.

Comments

This page used to have a comment section. It's closed now; what remains are the questions I answered.

Birkb · 25 July 2011, 12:13

Hi Maarten!
Extreme Physics is really great!! :)
I'm just experiencing a problem when I switched from GM8 to GM8.1.
The ep_gm_functions_init(); cannot be initialized, so I am not able to use the ep_debugdraw_bodies..
Do you know whats wrong? Anyone else have this problem?

Maarten Baert author · 2 August 2011, 02:44

Quote: Birkb

Hi Maarten!
Extreme Physics is really great!! :)
I'm just experiencing a problem when I switched from GM8 to GM8.1.
The ep_gm_functions_init(); cannot be initialized, so I am not able to use the ep_debugdraw_bodies..
Do you know whats wrong? Anyone else have this problem?

It's a known issue, YYG changed something and I still have to write and upload the fix.

EDIT: Done.

Birkb · 3 August 2011, 19:15

Quote: Maarten Baert

It's a known issue, YYG changed something and I still have to write and upload the fix.

EDIT: Done.

Just downloaded your v2.2.11.
Hmm it still does not seem to work for me..
I have GM 8.1.124 (r6892) installed.

Best regards Birk

Maarten Baert author · 16 August 2011, 12:44

Quote: Birkb

Just downloaded your v2.2.11.
Hmm it still does not seem to work for me..
I have GM 8.1.124 (r6892) installed.

Best regards Birk

Did you use ep_gm_functions_init_address instead of ep_gm_functions_init?

Earacher · 22 August 2012, 06:55

Hi Maarten!
Can i debug draw a Visual Box?

Maarten Baert author · 22 August 2012, 20:15

Quote: Earacher

Hi Maarten!
Can i debug draw a Visual Box?

What's a 'visual box'?

Earacher · 23 August 2012, 10:52

Quote: Maarten Baert

Quote: Earacher

Hi Maarten!
Can i debug draw a virtual Box?

What's a 'virtual box'?

sorry! A "virtual box" ,collision_test_box/circle/polygon!

Maarten Baert author · 2 September 2012, 12:53

Quote: Earacher

sorry! A "virtual box" ,collision_test_box/circle/polygon!

No, you can't draw those because they don't actually exist. They are forgotten immediately after the collision function ends.

Xenolit · 3 August 2013, 08:01

Hi. I use Game Maker Studio v1.1.827 Professional Edition. When I enable
ep_gm_functions_init_address it tells me that it can't find get_function_address
The GMS developers were supposed to remove this function and they did. They just left it in auto complete in v1.1.7 and it is removed entirely in v.1.1.827. Now how can I enable debug drawing in GMS?

Btw thanx for the awesome physics engine, My computer graphics professor couldn't believe his eyes when he saw the fluid simulation ;p.

Maarten Baert author · 3 August 2013, 15:37

Quote: Xenolit

Hi. I use Game Maker Studio v1.1.827 Professional Edition. When I enable
ep_gm_functions_init_address it tells me that it can't find get_function_address
The GMS developers were supposed to remove this function and they did. They just left it in auto complete in v1.1.7 and it is removed entirely in v.1.1.827. Now how can I enable debug drawing in GMS?

Btw thanx for the awesome physics engine, My computer graphics professor couldn't believe his eyes when he saw the fluid simulation ;p.

I don't think debug drawing has ever worked in Studio. The runner has changed too much, and without get_function_address it's completely impossible, I would have to fix it again and again whenever a new version is released. Sorry, there's not much I can do. YYG just doesn't really care about extensions anymore.