Reference
All function names are lowercase and start with "ep_".
If the return value of a function is not mentioned, the function will return 1 on success and 0 on failure. Almost all other functions will also return 0 on failure.
All angles in ExtremePhysics are in radians.
This reference lists the functions in the latest version of ExtremePhysics. If some function is missing or some arguments are different, make sure you're using the latest version.
Comments
Chance |
Comment #1: Thu, 7 Oct 2010, 19:25 (GMT+1, DST) Hi Maarten. Have you considered releasing the Reference as a downloadable document? Maybe an HTML document? Even PDF would be fine. I find myself using it a lot, and I'm worried your site may be off-air sometimes. I would panic! haha... |
Maarten BaertAdministrator |
Comment #2: Sat, 16 Oct 2010, 15:07 (GMT+1, DST) I'm trying to write a script to convert everything to a zip file. It should be finished soon. |
-coco- |
Comment #3: Tue, 11 Jan 2011, 21:04 (GMT+1, DST) Hello Maarten. (Sorry for my english, I just learn it at school) |
Maarten BaertAdministrator |
Comment #4: Thu, 13 Jan 2011, 16:58 (GMT+1, DST) Quote: -coco-
Do you have a project to make a Lib for Extremephysics? (with D&D icons) (with LibBuilder) Currently I don't. ExtremePhysics is rather difficult anyway, I don't think D&D icons would make it easier to use :). |
Nickgerrets |
Comment #5: Sun, 30 Dec 2012, 16:38 (GMT+1, DST) Is there a way to make a very smooth terrain, i tryed boxchaining in your rolling ball example, but i need something much more smoother. |
Maarten BaertAdministrator |
Comment #6: Sun, 30 Dec 2012, 20:14 (GMT+1, DST) Quote: Nickgerrets
Is there a way to make a very smooth terrain, i tryed boxchaining in your rolling ball example, but i need something much more smoother. Use more points, i.e. more boxes :). ExtremePhysics is quite good at handling many boxes as long as they're all static. If you really thing performance will be a problem (because you have a huge world), you should split the terrain into multiple parts and only create the parts that are currently visible. If you don't want to place all the points manually, try something like Bezier splines. I have an old example with various types of curves: |
Nickgerrets |
Comment #7: Sun, 30 Dec 2012, 20:40 (GMT+1, DST)
I figured it out, i accidentally putted the creation of a body in the step event. :( Last modified: Sun, 30 Dec 2012, 20:52 (GMT+1, DST) |
Caohimin |
Comment #8: Sat, 29 Jun 2013, 23:26 (GMT+1, DST) Bonjour Maarten, Je suis français, et nouvel utilisateur de "Extreme Physics". Je viens vers toi pour essayer de comprendre comment mettre en mouvement un objet ( vaisseau, dans mon cas, en vue du dessus ), je ne sais pas par où commencer... Si tu pouvais m'éclairé un peu. Merci. |
Maarten BaertAdministrator |
Comment #9: Tue, 23 Jul 2013, 20:13 (GMT+1, DST) Quote: Caohimin
Bonjour Maarten, Je suis français, et nouvel utilisateur de "Extreme Physics". Je viens vers toi pour essayer de comprendre comment mettre en mouvement un objet ( vaisseau, dans mon cas, en vue du dessus ), je ne sais pas par où commencer... Si tu pouvais m'éclairé un peu. Merci. I understand your question, but I don't think I can answer this in french, sorry ;). If you want to move the object with a specific velocity, use ep_body_set_velocity_center. If you just want to push the object, use ep_body_apply_impulse_relative. In any case, don't try to move the body directly (ep_body_set_position), otherwise ExtremePhysics can't simulate collisions correctly. |
Lukayson |
Comment #10: Mon, 30 Mar 2015, 17:25 (GMT+1, DST) Good day, is there possibility how to simulate air resistance? I am making rocket simulator. I need different behavior between vacuum and air. Thank you |
Maarten BaertAdministrator |
Comment #11: Mon, 6 Apr 2015, 0:45 (GMT+1, DST) Quote: Lukayson
Good day, is there possibility how to simulate air resistance? I am making rocket simulator. I need different behavior between vacuum and air. Thank you ep_body_set_damping gives you basic (linear) air resistance. If this is not accurate enough for what you're doing, then you should simulate the air resistance yourself and apply it either with ep_body_apply_impulse_relative or with ep_force_create. |
Lukayson |
Comment #12: Sun, 11 Oct 2015, 1:49 (GMT+1, DST) Is it possible to have EP 2.2 in Unreal Engine 4? Please |
Maarten BaertAdministrator |
Comment #13: Sun, 11 Oct 2015, 20:01 (GMT+1, DST) Quote: Lukayson
Is it possible to have EP 2.2 in Unreal Engine 4? Please I have no idea, I've never tried using UE4. You have the EP source code, so in theory nothing stops you from tying it together with whatever engine you want. You can get a pure C++ version of EP just by throwing out all the game maker related files from the source code. Last modified: Sun, 11 Oct 2015, 20:01 (GMT+1, DST) |
Lukayson |
Comment #14: Mon, 19 Oct 2015, 16:15 (GMT+1, DST) Is there any way to ask directly body, if he has any contacts, please? it is for this project: https://twitter.com/Cybermotiongame Last modified: Mon, 19 Oct 2015, 16:20 (GMT+1, DST) |
Maarten BaertAdministrator |
Comment #15: Thu, 22 Oct 2015, 20:51 (GMT+1, DST) Quote: Lukayson
Is there any way to ask directly body, if he has any contacts, please? it is for this project: https://twitter.com/Cybermotiongame Yes, this is all explained in this article. Contacts are stored for each shape, not body. |
Lukayson |
Comment #16: Fri, 23 Oct 2015, 2:08 (GMT+1, DST) Quote: Maarten Baert
Quote: Lukayson
Is there any way to ask directly body, if he has any contacts, please? it is for this project: https://twitter.com/Cybermotiongame Yes, this is all explained in this article. Contacts are stored for each shape, not body. Thank you very much and sorry. I did not notice Last modified: Sun, 19 Mar 2017, 16:27 (GMT+1, DST) |
Lukayson |
Comment #17: Tue, 7 Mar 2017, 14:57 (GMT+1, DST) Hello, Is there a way to detect if body is sliding on another? I want for example metal part making sparks when sliding on concrete. Thank you |
Maarten BaertAdministrator |
Comment #18: Sun, 19 Mar 2017, 16:28 (GMT+1, DST) Quote: Lukayson
Hello, Is there a way to detect if body is sliding on another? I want for example metal part making sparks when sliding on concrete. Thank you Read this article. Combine this with ep_body_get_xvel_local_point and ep_body_get_yvel_local_point to detect whether the bodies are sliding. Example: var s, c, b, object; for(s = ep_body_first_shape(global.world, body); s!=0; s = ep_shape_next(global.world, body, s)) { for(c = ep_shape_get_first_contact(global.world, body, s); c!=0; c = ep_shape_get_next_contact(global.world, body, s, c)) { b = ep_contact_get_body1(global.world, c); if b=body { b = ep_contact_get_body2(global.world, c); } object = ep_body_get_user_var(global.world, b, 0); if object.object_index=obj_block { // this instance is touching a block b1 = ep_contact_get_body1(global.world, c); gx1 = ep_contact_get_point1_x(global.world, c); gy1 = ep_contact_get_point1_y(global.world, c); lx1 = ep_body_coord_world_to_local_x(global.world, b1, gx1, gy1); ly1 = ep_body_coord_world_to_local_y(global.world, b1, gx1, gy1); vx1 = ep_body_get_xvel_local_point(world_id, b1, lx1, ly1); vy1 = ep_body_get_yvel_local_point(world_id, b1, lx1, ly1); b2 = ep_contact_get_body2(global.world, c); gx2 = ep_contact_get_point2_x(global.world, c); gy2 = ep_contact_get_point2_y(global.world, c); lx2 = ep_body_coord_world_to_local_x(global.world, b2, gx2, gy2); ly2 = ep_body_coord_world_to_local_y(global.world, b2, gx2, gy2); vx2 = ep_body_get_xvel_local_point(world_id, b2, lx2, ly2); vy2 = ep_body_get_yvel_local_point(world_id, b2, lx2, ly2); nx = ep_contact_get_normal_x(global.world, c); ny = ep_contact_get_normal_y(global.world, c); vel = abs(nx * (vy1 - vy2) - ny * (vx1 - vx2)); if(vel > 0.1) { // generate sparks here } } } } Not tested. Last modified: Sun, 19 Mar 2017, 16:38 (GMT+1, DST) |
Lukayson |
Comment #19: Mon, 14 Aug 2017, 14:57 (GMT+1, DST) Hello, can I speak with you privately Mr. Baert, please? |