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

Concept for symbol names #65

Open
DerKarlos opened this issue Dec 11, 2023 · 3 comments
Open

Concept for symbol names #65

DerKarlos opened this issue Dec 11, 2023 · 3 comments

Comments

@DerKarlos
Copy link
Owner

We may define a concept for the names, we use for symbols.

  • Some years we added the compiler type like iName or n8Name. Not needed, tools are showing the type now.
  • The os/Bevy API uses its own types, also shown by the tools. Well mostly. Sometimes it may be just a Vec3. In this cases we should specify it like "pub type ScenePos = glam::Vec3;” We can’t add our own functions to “type”s? Or can we, instead define the same struct again?
  • And our code also uses its own types. See Replacing native types by functional names? #39
    So we may use symbols naming the purpose, not the type. Well. Sometimes it’s the same anyway.

A challenge for this concept is the Bevy Resource Transform. Let’s ignore the big-space for a start. So Transform can be splittet in Translation and Rotation. But Bevy-ECS does not have extra types for them but uses Vec3.
A) Both may have world- or relative/delta/diff-meaning.
B) Because we use the Earth in its real size and sphericity, the “flat” surface, the OSM-Tiles are orientated to, is gone! But we should provide functions to calculate between word- and surface-values. So shall we use “type” or in the naming style?
C) And now consider big-space. The Translation may be local inside a grid as Vec3
or big-space (grid,local). Again wie could invent types or clarify it by the symbol name. Even write an issue to big-space to get extra names.

We could start with a wiki page and invent "roles" and examples.

@oli-obk
Copy link
Collaborator

oli-obk commented Dec 12, 2023

Because we use the Earth in its real size and sphericity, the “flat” surface, the OSM-Tiles are orientated to, is gone! But we should provide functions to calculate between word- and surface-values. So shall we use “type” or in the naming style?

We have TileCoord and TileIndex for this. They have methods for converting to and from Cartesian coordinates

@oli-obk
Copy link
Collaborator

oli-obk commented Dec 12, 2023

And now consider big-space. The Translation may be local inside a grid as Vec3
or big-space (grid,local). Again wie could invent types or clarify it by the symbol name. Even write an issue to big-space to get extra names.

I can create a helper like Player to handle transform + grid together with helper methods

@oli-obk oli-obk mentioned this issue Dec 12, 2023
@DerKarlos
Copy link
Owner Author

Your comments are good for #51 and "Player" may also be a good idea. I will write for details there.
As long as we use our own types, it is fine.
I will give concrete undefined examples here later

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