|
@@ -144,7 +144,7 @@
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Associates the vertexData to the passed Mesh
|
|
|
+ * Associates the vertexData to the passed Mesh.
|
|
|
* Sets it as updatable or not (default `false`)
|
|
|
* @param mesh the mesh the vertexData is applied to
|
|
|
* @param updatable when used and having the value true allows new data to update the vertexData
|
|
@@ -156,7 +156,7 @@
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Associates the vertexData to the passed Geometry
|
|
|
+ * Associates the vertexData to the passed Geometry.
|
|
|
* Sets it as updatable or not (default `false`)
|
|
|
* @param geometry the geometry the vertexData is applied to
|
|
|
* @param updatable when used and having the value true allows new data to update the vertexData
|
|
@@ -371,7 +371,7 @@
|
|
|
|
|
|
/**
|
|
|
* Merges the passed VertexData into the current one
|
|
|
- * @param other the VetexData to be merged into the current one
|
|
|
+ * @param other the VertexData to be merged into the current one
|
|
|
* @returns the modified VertexData
|
|
|
*/
|
|
|
public merge(other: VertexData): VertexData {
|
|
@@ -1898,8 +1898,8 @@
|
|
|
* @param polygon a mesh built from polygonTriangulation.build()
|
|
|
* @param sideOrientation takes the values BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
|
|
|
* @param fUV an array of Vector4 elements used to set different images to the top, rings and bottom respectively
|
|
|
- * @param faceColors an array of Color3 elements used to set different colors to the top, rings and bottom respectively
|
|
|
- * @param frontUvs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)
|
|
|
+ * @param fColors an array of Color3 elements used to set different colors to the top, rings and bottom respectively
|
|
|
+ * @param frontUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)
|
|
|
* @param backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1)
|
|
|
* @returns the VertexData of the Polygon
|
|
|
*/
|
|
@@ -2243,22 +2243,22 @@
|
|
|
// inspired from // http://stemkoski.github.io/Three.js/Polyhedra.html
|
|
|
/**
|
|
|
* Creates the VertexData for a Polyhedron
|
|
|
- * * @param options an object used to set the following optional parameters for the polyhedron, required but can be empty
|
|
|
- * * type provided types are:
|
|
|
- * -- 0 : Tetrahedron, 1 : Octahedron, 2 : Dodecahedron, 3 : Icosahedron, 4 : Rhombicuboctahedron, 5 : Triangular Prism, 6 : Pentagonal Prism, 7 : Hexagonal Prism, 8 : Square Pyramid (J1)
|
|
|
- * -- 9 : Pentagonal Pyramid (J2), 10 : Triangular Dipyramid (J12), 11 : Pentagonal Dipyramid (J13), 12 : Elongated Square Dipyramid (J15), 13 : Elongated Pentagonal Dipyramid (J16), 14 : Elongated Pentagonal Cupola (J20)
|
|
|
- * * size the size of the IcoSphere, optional default 1
|
|
|
- * * sizeX allows stretching in the x direction, optional, default size
|
|
|
- * * sizeY allows stretching in the y direction, optional, default size
|
|
|
- * * sizeZ allows stretching in the z direction, optional, default size
|
|
|
- * * custom a number that overwrites the type to create from an extended set of polyhedron from https://www.babylonjs-playground.com/#21QRSK#15 with minimised editor
|
|
|
- * * faceUV an array of Vector4 elements used to set different images to the top, rings and bottom respectively
|
|
|
- * * faceColors an array of Color3 elements used to set different colors to the top, rings and bottom respectively
|
|
|
- * * flat when true creates a flat shaded mesh, optional, default true
|
|
|
- * * subdivisions increasing the subdivisions increases the number of faces, optional, default 4
|
|
|
- * * sideOrientation optional and takes the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
|
|
|
- * * frontUvs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)
|
|
|
- * * backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1)
|
|
|
+ * @param options an object used to set the following optional parameters for the polyhedron, required but can be empty
|
|
|
+ * * type provided types are:
|
|
|
+ * * 0 : Tetrahedron, 1 : Octahedron, 2 : Dodecahedron, 3 : Icosahedron, 4 : Rhombicuboctahedron, 5 : Triangular Prism, 6 : Pentagonal Prism, 7 : Hexagonal Prism, 8 : Square Pyramid (J1)
|
|
|
+ * * 9 : Pentagonal Pyramid (J2), 10 : Triangular Dipyramid (J12), 11 : Pentagonal Dipyramid (J13), 12 : Elongated Square Dipyramid (J15), 13 : Elongated Pentagonal Dipyramid (J16), 14 : Elongated Pentagonal Cupola (J20)
|
|
|
+ * * size the size of the IcoSphere, optional default 1
|
|
|
+ * * sizeX allows stretching in the x direction, optional, default size
|
|
|
+ * * sizeY allows stretching in the y direction, optional, default size
|
|
|
+ * * sizeZ allows stretching in the z direction, optional, default size
|
|
|
+ * * custom a number that overwrites the type to create from an extended set of polyhedron from https://www.babylonjs-playground.com/#21QRSK#15 with minimised editor
|
|
|
+ * * faceUV an array of Vector4 elements used to set different images to the top, rings and bottom respectively
|
|
|
+ * * faceColors an array of Color3 elements used to set different colors to the top, rings and bottom respectively
|
|
|
+ * * flat when true creates a flat shaded mesh, optional, default true
|
|
|
+ * * subdivisions increasing the subdivisions increases the number of faces, optional, default 4
|
|
|
+ * * sideOrientation optional and takes the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
|
|
|
+ * * frontUvs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)
|
|
|
+ * * backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1)
|
|
|
* @returns the VertexData of the Polyhedron
|
|
|
*/
|
|
|
public static CreatePolyhedron(options: { type?: number, size?: number, sizeX?: number, sizeY?: number, sizeZ?: number, custom?: any, faceUV?: Vector4[], faceColors?: Color4[], flat?: boolean, sideOrientation?: number, frontUVs?: Vector4, backUVs?: Vector4 }): VertexData {
|
|
@@ -2499,7 +2499,9 @@
|
|
|
}
|
|
|
|
|
|
// Tools
|
|
|
+
|
|
|
/**
|
|
|
+ * Compute normals for given positions and indices
|
|
|
* @param positions an array of vertex positions, [...., x, y, z, ......]
|
|
|
* @param indices an array of indices in groups of three for each triangular facet, [...., i, j, k, ......]
|
|
|
* @param normals an array of vertex normals, [...., x, y, z, ......]
|