|
@@ -359,11 +359,12 @@
|
|
|
* The parameter `lines` is an array of lines, each line being an array of successive Vector3.
|
|
|
* The optional parameter `instance` is an instance of an existing LineSystem object to be updated with the passed `lines` parameter. The way to update it is the same than for
|
|
|
* The optional parameter `colors` is an array of line colors, each line colors being an array of successive Color4, one per line point.
|
|
|
+ * The optional parameter `useVertexAlpha' is to be set to `true` (default `false`) when the alpha value from the former `Color4` array must be used.
|
|
|
* updating a simple Line mesh, you just need to update every line in the `lines` array : http://doc.babylonjs.com/tutorials/How_to_dynamically_morph_a_mesh#lines-and-dashedlines
|
|
|
* When updating an instance, remember that only line point positions can change, not the number of points, neither the number of lines.
|
|
|
* The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created.
|
|
|
*/
|
|
|
- public static CreateLineSystem(name: string, options: { lines: Vector3[][], updatable: boolean, instance: Nullable<LinesMesh>, colors?: Nullable<Color4[][]> }, scene: Nullable<Scene>): LinesMesh {
|
|
|
+ public static CreateLineSystem(name: string, options: { lines: Vector3[][], updatable: boolean, instance: Nullable<LinesMesh>, colors?: Nullable<Color4[][]>, useVertexAlpha?: boolean }, scene: Nullable<Scene>): LinesMesh {
|
|
|
var instance = options.instance;
|
|
|
var lines = options.lines;
|
|
|
var colors = options.colors;
|
|
@@ -403,7 +404,7 @@
|
|
|
|
|
|
// line system creation
|
|
|
var useVertexColor = (colors) ? true : false;
|
|
|
- var lineSystem = new LinesMesh(name, scene, null, undefined, undefined, useVertexColor);
|
|
|
+ var lineSystem = new LinesMesh(name, scene, null, undefined, undefined, useVertexColor, options.useVertexAlpha);
|
|
|
var vertexData = VertexData.CreateLineSystem(options);
|
|
|
vertexData.applyToMesh(lineSystem, options.updatable);
|
|
|
return lineSystem;
|
|
@@ -417,12 +418,13 @@
|
|
|
* The parameter `points` is an array successive Vector3.
|
|
|
* The optional parameter `instance` is an instance of an existing LineMesh object to be updated with the passed `points` parameter : http://doc.babylonjs.com/tutorials/How_to_dynamically_morph_a_mesh#lines-and-dashedlines
|
|
|
* The optional parameter `colors` is an array of successive Color4, one per line point.
|
|
|
+ * The optional parameter `useVertexAlpha' is to be set to `true` (default `false`) when the alpha value from the former `Color4` array must be used.
|
|
|
* When updating an instance, remember that only point positions can change, not the number of points.
|
|
|
* The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created.
|
|
|
*/
|
|
|
- public static CreateLines(name: string, options: { points: Vector3[], updatable: boolean, instance: Nullable<LinesMesh>, colors?: Color4[] }, scene: Nullable<Scene> = null): LinesMesh {
|
|
|
+ public static CreateLines(name: string, options: { points: Vector3[], updatable: boolean, instance: Nullable<LinesMesh>, colors?: Color4[], useVertexAlpha?: boolean }, scene: Nullable<Scene> = null): LinesMesh {
|
|
|
var colors = (options.colors) ? [options.colors] : null;
|
|
|
- var lines = MeshBuilder.CreateLineSystem(name, { lines: [options.points], updatable: options.updatable, instance: options.instance, colors: colors }, scene);
|
|
|
+ var lines = MeshBuilder.CreateLineSystem(name, { lines: [options.points], updatable: options.updatable, instance: options.instance, colors: colors, useVertexAlpha: options.useVertexAlpha }, scene);
|
|
|
return lines;
|
|
|
}
|
|
|
|