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
Create new EdgesRenderer for LineMeshes. #4919
Conversation
Hello, and thanks for the pull request. It seems like a few javadoc documentation are missing on the new API: |
should I just make javaDoc comments in .ts files? |
yup but I am sorry I said Javadoc... :-( , my bad. We are using Typedoc to generate our api doc so that our documentation should follow the following standards: http://doc.babylonjs.com/how_to/contribute_to_api Do you mind adapting it ? A second question is the work you are adding on line mesh is great. I am still wondering wether it is an issue with the default edge renderer and what in line mesh is creating the issue ? |
Sure I will adapt. And yes it was a problem with a standard edges renderer. It basicaly tried to go through 3 vertices for a line while there were only 2 so it iterated past the array getting Vector Zero as a last vertex per triangle. |
When you will have some time please look at the docs I made and tell me what should I change. |
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.
Basically, we do not need type annotations and @Class as this is infered from typescript by typedoc :-)
Aside of comments it looks all good.
src/Mesh/babylon.linesMesh.ts
Outdated
@@ -2,7 +2,7 @@ | |||
export class LinesMesh extends Mesh { | |||
public color = new Color3(1, 1, 1); | |||
public alpha = 1; | |||
|
|||
public _edgesRenderer: Nullable<LineEdgesRenderer>; |
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.
|
||
/** Gets or sets a boolean indicating if the edgesRenderer is active */ | ||
public isEnabled = true; | ||
|
||
// Beware when you use this class with complex objects as the adjacencies computation can be really long | ||
constructor(source: AbstractMesh, epsilon = 0.95, checkVerticesInsteadOfIndices = false) { | ||
/** | ||
* |
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.
Add a quick desc
constructor(source: AbstractMesh, epsilon = 0.95, checkVerticesInsteadOfIndices = false) { | ||
/** | ||
* | ||
* @param {BABYLON.AbstractMesh} source Mesh used to create edges |
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.
Remove the {Types}
/** | ||
* | ||
* @param {BABYLON.AbstractMesh} source Mesh used to create edges | ||
* @param {number} epsilon sum of angles in adjacency to check for edge |
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.
same
looks good, I ll try to merge it in the afternoon ! Thanks a lot. |
remove class param
Oh no, just noticed, could you remove the dist/preview release/babylon.d.ts from the PR ? I promise it is the last comment I have, thx |
Also the EdgesRenderer is missing a constructor Comment which fails the build. I ll merge as soon as the d.ts is removed from the PR and the comment has been put in the constructor. |
I took the liberty of fixing the left over issues and merged on master in #4920 Thanks for your contribution ! |
Thank you for merging and fixing issues. I had to urgently leave so I didn't see your last request |
np |
Normal EdgesRenderer was buggy because of unnecessary triangulation of lines.
Easy way to see difference is to run this code on playground: