Skip to content

Some suggestions on the naming of elements #38

@experdot

Description

@experdot

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;
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions