Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code Janitoring - Reduce all lines to 80 chars in length to improve readiblity #17

Open
Waqar144 opened this issue Jul 8, 2015 · 4 comments

Comments

@Waqar144
Copy link
Contributor

Waqar144 commented Jul 8, 2015

Since I use Vi, and edit in a window with width set to 80. The code often looks a bit messy.
Is it a good idea or maybe just leave the code base as it is.

@MrNex
Copy link
Owner

MrNex commented Jul 8, 2015

I do not believe a fixed width is what we want, however I do agree some lines may be too long.

What we should do, instead of hardlimiting to 80 characters-- we should take longer lines and split them based on readability.

For example:

void DoSomething(float scalar, Vector v1, Vector v2, Vector v3, Vector v4, Matrix m1, Matrix m2, Matrix m3);

Might become

void DoSomething( 
  float Scalar,
  Vector v1, Vector v2, Vector v3, Vector v4,
  Matrix m1, Matrix m2, Matrix m3
);

Rather than

void DoSomething( float Scalar, Vector v1, Vector v2,
  Vector v3, Vector v4, Matrix m1, Matrix m2, Matrix m3,
  Matrix m4);

@Waqar144
Copy link
Contributor Author

Waqar144 commented Jul 8, 2015

One more thing I want to ask you, not related to this is... Since I may work on this system for a while, what would be the best starting point, if I were to dive into the code base?

@MrNex
Copy link
Owner

MrNex commented Jul 8, 2015

Well I'll be working on the Wiki including a quickstart guide.. But that might take me a while. However, it is important you understand the Common 3 as everything in the NGen will use them (Even the system Managers).

In the meantime, I think the most important place to start would be the Math section. It's fairly straight forward if you have a basic understanding of Linear Algebra, but you won't have success using the NGen without it.

If you feel comfortable with the Math sections, next take a quick look at FrameOfReference.h. FrameOfReference shows up quite a bit in various sections, and is responsible for facilitating the position, orientation, and scale of all objects.

From here there are a few more specialized areas you can go. GObject serves as the junction for all components of the NGen. I would look at GObject.h, see what makes up a GObject, then follow the path that interests you. Each one of those paths is essentially completely separate (I would say Material and Mesh are closely related, as well as Collider and RigidBody), and each has it's own starting point (Which GObject will point you to).

Once you understand a component (i.e. RigidBody) I would encourage you to check out the corresponding Manager for an even deeper understanding (If you went the RigidBody route, the corresponding manager would be the PhysicsManager). The managers will give you more of a system level view of how the component is handled, while the component will give you a detail oriented view of what functions you can perform on a component to get desired results.

It is a messy code-base but please send me questions if you have any trouble understanding. You can contact me privately at npg3253@rit.edu

@Waqar144
Copy link
Contributor Author

Waqar144 commented Jul 8, 2015

Thank you for this.
Lets see what I can do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants