-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Example Playgrounds for Properties and Methods of Vector3 #12874
Conversation
Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s). |
Snapshot stored with reference name: Test environment: To test a playground add it to the URL, for example: https://babylonsnapshots.z22.web.core.windows.net/refs/pull/12874/merge/index.html#WGZLGJ#4600 Links to test babylon tools with this snapshot: https://playground.babylonjs.com/?snapshot=refs/pull/12874/merge To test the snapshot in the playground with a playground ID add it after the snapshot query string: https://playground.babylonjs.com/?snapshot=refs/pull/12874/merge#BCU1XR#0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, thank you so much John! This is amazing.
I didn't go into all of the examples, but a playground to each of those methods will be very very helpful. especially for functions like project/unproject which can sometimes be a mystery.
There is a very small formatting issue and I think it will be great if the example be a part of the description (i.e. - before the @returns
and @param
lines.
Having problems getting prettier to run to correct any formatting errors. Also tried PS C:\Users\johnk\Documents\Github\Babylon.js> npm run format:check
'prettier' is not recognized as an internal or external command, I have checked that is it set as default formatter for all languages. Just found the format error (I hope) exactly one extra space at the end of one line. Happy to move it before @params and @return. Will wait until any more suggestions so I can deal with them in one go. |
Hey @BabylonJSGuide, so sorry about that prettier issue. If that doesn't work let's hop on a call to check what's up with your local repo. |
Hi @RaananW, thank you for the help. It was my problem, I just did a new clone of Babylon.js and then behaved as if it was the old one. Completely forgot to do npm install. All well now. As no more suggestions will get on with move Example line to descriptions. |
Examples move up to descriptions as requested |
Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s). |
Snapshot stored with reference name: Test environment: To test a playground add it to the URL, for example: https://babylonsnapshots.z22.web.core.windows.net/refs/pull/12874/merge/index.html#WGZLGJ#4600 Links to test babylon tools with this snapshot: https://playground.babylonjs.com/?snapshot=refs/pull/12874/merge To test the snapshot in the playground with a playground ID add it after the snapshot query string: https://playground.babylonjs.com/?snapshot=refs/pull/12874/merge#BCU1XR#0 |
Example Playgrounds for Properties and Methods of Vector3 Former-commit-id: 384092f708633873823ee589dd984c0adf2012fb
My apologies for the length of this comment, it is because I need advice on whether it will be part of my very limited project or a much larger undertaking by the community. As a large community undertaking it needs considering and approval by @deltakosh along with @PirateJC and @RaananW as it involves the docs even though it is on the API side and I would like to include @sebavan as he as also been very supportive and helpful to me. Please include anyone else you would like to talk to about it.
Reason Behind PR
Within the API classes the search the playground for each property and method is at best hit and miss, so I thought that each property and method of a class should have its own playground example, which should be simple and as meaningful as possible. For my limited project, except for a few where they were trivial or I couldn't think of a good example or I forgot, I have done this for all the methods and classes of Vector3 in this PR.
Implications for a Large Community Undertaking
An announcement about the undertaking.
If members do put in example PGs they could come in piecemeal so lots of individual PRs, unless there was somewhere else to submit them. This would require a moderator or moderators.
Some rules for submitting an example PG, eg
When meaningful means more complex code this can be achieved by wrapping the
a. method code in a function as in https://playground.babylonjs.com/#R1F8YU#111
b. method code within an onBeforeRenderObservable as in https://playground.babylonjs.com/#R1F8YU#63
c. complex code within functions as in https://playground.babylonjs.com/#R1F8YU#106
I am sure there are more implications and I am happy for the rules to change. I only came up with them after doing half the methods.
Also as members of the community have their own agendas it is probably wishful thinking that enough people would get involved to get it done.
In terms of my very limited project I am happy to continue with the math.vector.ts classes, eg Vector2, Vector4, etc
Let me know what you think and whether it is just my limited project or a community appeal.