#### Archived

This topic is now archived and is closed to further replies.

# Advice for my Physics Engine

This topic is 5303 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I am starting a new physics engine project and would like some advice about how I should design it. What type of naming convention should I use for the equations? I thought of two possibilities: try to come up with a descriptive name for each of them (such as "light_refraction" for an equation that solves for the angle of refraction). The problem is that there are so many equations that it may become too difficult to remember the exact names of the functions. The other option is to enumerate each function and name them light_001, or thermo_145. Then, I would have a table in the help file that has each function''s purpose, and sort it according to categories such as light and thermo. Does anyone think either of these two methods would work? If not, please suggest any other naming scheme. So far, I''ve been leaning toward the enumerated option. Also, feel free to suggest any specific areas of physics that should be included in a physics engine. Finally, if anyone knows of some good physics engines let me know so I can see what areas are covered by other programs. -------------------- Nicholas Skapura skapura.2@wright.edu http://skap.8k.com AIM: skap35

##### Share on other sites

How appropriate. You fight like a cow.

##### Share on other sites
quote:
Original post by skap20
The other option is to enumerate each function and name them light_001, or thermo_145. Then, I would have a table in the help file that has each function''s purpose, and sort it according to categories such as light and thermo.

Is there a reason why you can''t have descriptive names AND a table describing each function''s purpose?

##### Share on other sites
Yeah you are right, Sneftel, it probably would make it pretty unreadable. I will probably use a naming convention like type_name(). So something like "kin_projectile()" for a projectile equation, which would be in the kinetics module.

--------------------
Nicholas Skapura
skapura.2@wright.edu
http://skap.8k.com
AIM: skap35

##### Share on other sites
You could just use namespaces?

like
namespace Kinetics{  void MyFunc()  {  }}then:Kinetics::MyFunc();

~Graham

[edited by - gwihlidal on June 7, 2003 4:48:45 PM]

• ### Forum Statistics

• Total Topics
628682
• Total Posts
2984198

• 13
• 12
• 9
• 10
• 10