Reference
Last updated 11 September 2011
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
This page used to have a comment section. It's closed now; what remains are the questions I answered.
Chance · 7 October 2010, 19:25
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 Baert author · 16 October 2010, 15:07
I'm trying to write a script to convert everything to a zip file. It should be finished soon.
-coco- · 11 January 2011, 21:04
Hello Maarten.
I like Extremephysics, it's just genious.
Do you have a project to make a Lib for Extremephysics? (with D&D icons) (with LibBuilder)
I began one, but you should better know Extremephysics than me (mine is really rudymentary).
It think it should help many users.
-Coco-
(Sorry for my english, I just learn it at school)
Maarten Baert author · 13 January 2011, 16:58
Currently I don't. ExtremePhysics is rather difficult anyway, I don't think D&D icons would make it easier to use :).
Nickgerrets · 30 December 2012, 16:38
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 Baert author · 30 December 2012, 20:14
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:
http://gm.maartenbaert.be/curve.gmk
'cardinal' is probably the easiest. NURBS is more powerful, but don't try to understand it unless you really like complex math :).
Caohimin · 29 June 2013, 23:26
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 Baert author · 23 July 2013, 20:13
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 · 30 March 2015, 17:25
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 Baert author · 6 April 2015, 00:45
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 · 11 October 2015, 01:49
Is it possible to have EP 2.2 in Unreal Engine 4? Please
Maarten Baert author · 11 October 2015, 20:01
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.
Lukayson · 19 October 2015, 16:15
Is there any way to ask directly body, if he has any contacts, please?
I made this solution, but it is performance killer, if I use it to much.
https://drive.google.com/file/d/0B3lN5CN0ykMqRXNFb0pwTVJ6Vlk/view?usp=sharing
it is for this project: https://twitter.com/Cybermotiongame
Thank you
Maarten Baert author · 22 October 2015, 20:51
Yes, this is all explained in this article. Contacts are stored for each shape, not body.
Lukayson · 7 March 2017, 14:57
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 Baert author · 19 March 2017, 16:28
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:
Not tested.