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

Some suggestions on the naming of elements #38

Open
experdot opened this issue Aug 10, 2017 · 1 comment
Open

Some suggestions on the naming of elements #38

experdot opened this issue Aug 10, 2017 · 1 comment

Comments

@experdot
Copy link

experdot commented Aug 10, 2017

VelcroPhysics.Dynamics.Body

_xf is strange and it may be abbreviation of XForm which is similiar to Transform .In addition,variable names beginning with an underscore is not compliant with the CLS.

    public class Body
    {
        public Transform _xf; // the body origin transform
    }

Suggest :

    public class Body
    {
        public Transform Transform; // the body origin transform
    }

VelcroPhysics.Dynamics.TimeStep

In general,a public variable should be full word.

    public struct TimeStep
    {
        public float dt;
        public float dtRatio;
        public float inv_dt;
    }

Suggest :

    public struct TimeStep
    {
        public float DeltaTime;
        public float DeltaTimeRatio;
        public float InverseDeltaTime;
    }

VelcroPhysics.Shared.Rot

Rot doesn't name with a full noun,and fields s,c lead to confusion.

    public struct Rot
    {
        public float s,c;
    }

Suggest:

    public struct Rotation
    {
        public float SinValue;
        public float CosValue;
    }

VelcroPhysics.Shared.Transform

Likewise,the meanings of p and q are not clearly.

    public struct Transform
    {
        public Vector2 p;
        public Rot q;
    }

Suggest :

    public struct Transform
    {
        public Vector2 Position;
        public Rotation Rotation;
    }
@Genbox
Copy link
Owner

Genbox commented Aug 11, 2017

You are right. The naming comes from Box2D for the most part. The transform on the body is temporary to have the build in source control compile, nothing else. I will rename things correctly when I get some time to work on the engine.

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

No branches or pull requests

2 participants