Maarten Baert's website

Game Maker / C++ projects

Home Model Creator ExtremePhysics Game Maker DLLs SimpleScreenRecorder AlterPCB Quadcopters   Recent comments Search

Last modified: Tue, 2 Aug 2011
Refresh

Debug drawing


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

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

Birkb

Comment #1: Mon, 25 Jul 2011, 12:13 (GMT+1, DST)

Quote


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

Administrator

Comment #2: Tue, 2 Aug 2011, 2:44 (GMT+1, DST)

Quote


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.

Last modified: Tue, 2 Aug 2011, 19:43 (GMT+1, DST)

Birkb

Comment #3: Wed, 3 Aug 2011, 19:15 (GMT+1, DST)

Quote


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

Administrator

Comment #4: Tue, 16 Aug 2011, 12:44 (GMT+1, DST)

Quote


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

Comment #5: Wed, 22 Aug 2012, 6:55 (GMT+1, DST)

Quote


Hi Maarten!
Can i debug draw a Visual Box?

Maarten Baert

Administrator

Comment #6: Wed, 22 Aug 2012, 20:15 (GMT+1, DST)

Quote


Quote: Earacher

Hi Maarten!
Can i debug draw a Visual Box?

What's a 'visual box'?

Earacher

Comment #7: Thu, 23 Aug 2012, 10:52 (GMT+1, DST)

Quote


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!

Last modified: Thu, 23 Aug 2012, 10:56 (GMT+1, DST)

Maarten Baert

Administrator

Comment #8: Sun, 2 Sep 2012, 12:53 (GMT+1, DST)

Quote


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

Comment #9: Sat, 3 Aug 2013, 8:01 (GMT+1, DST)

Quote


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.

Last modified: Sat, 3 Aug 2013, 8:02 (GMT+1, DST)

Maarten Baert

Administrator

Comment #10: Sat, 3 Aug 2013, 15:37 (GMT+1, DST)

Quote


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.

Last modified: Sat, 3 Aug 2013, 15:37 (GMT+1, DST)

Xenolit

Comment #11: Sat, 3 Aug 2013, 19:34 (GMT+1, DST)

Quote


Quote: Maarten Baert
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.

Well It's their loss. Because Studio's physics engine is nothing compared to Extreme Physics. I'm switching back to GM8.

Last modified: Sat, 3 Aug 2013, 19:40 (GMT+1, DST)

Write a comment