|
@@ -1363,9 +1363,16 @@
|
|
public static CreateBox(name: string, options: any, scene: Scene, updatable?: boolean, sideOrientation: number = Mesh.DEFAULTSIDE): Mesh {
|
|
public static CreateBox(name: string, options: any, scene: Scene, updatable?: boolean, sideOrientation: number = Mesh.DEFAULTSIDE): Mesh {
|
|
// Check parameters
|
|
// Check parameters
|
|
updatable = updatable || options.updatable;
|
|
updatable = updatable || options.updatable;
|
|
-
|
|
|
|
|
|
+ if (typeof options === 'number') {
|
|
|
|
+ var size = options;
|
|
|
|
+ options = {
|
|
|
|
+ size: size,
|
|
|
|
+ sideOrientation: sideOrientation
|
|
|
|
+ };
|
|
|
|
+ }
|
|
|
|
+
|
|
var box = new Mesh(name, scene);
|
|
var box = new Mesh(name, scene);
|
|
- var vertexData = VertexData.CreateBox(options, sideOrientation);
|
|
|
|
|
|
+ var vertexData = VertexData.CreateBox(options);
|
|
|
|
|
|
vertexData.applyToMesh(box, updatable);
|
|
vertexData.applyToMesh(box, updatable);
|
|
|
|
|
|
@@ -1373,7 +1380,7 @@
|
|
}
|
|
}
|
|
|
|
|
|
public static CreateSphere(name: string, segments: number, diameter: number, scene?: Scene, updatable?: boolean, sideOrientation?: number): Mesh;
|
|
public static CreateSphere(name: string, segments: number, diameter: number, scene?: Scene, updatable?: boolean, sideOrientation?: number): Mesh;
|
|
- public static CreateSphere(name: string, options: { segments?: number, diameterX?: number, diameterY?: number, diameterZ?: number, sideOrientation?: number, updatable?: boolean }, scene: any): Mesh;
|
|
|
|
|
|
+ public static CreateSphere(name: string, options: { segments?: number, diameter?: number, diameterX?: number, diameterY?: number, diameterZ?: number, sideOrientation?: number, updatable?: boolean }, scene: any): Mesh;
|
|
public static CreateSphere(name: string, options: any, diameterOrScene: any, scene?: Scene, updatable?: boolean, sideOrientation: number = Mesh.DEFAULTSIDE): Mesh {
|
|
public static CreateSphere(name: string, options: any, diameterOrScene: any, scene?: Scene, updatable?: boolean, sideOrientation: number = Mesh.DEFAULTSIDE): Mesh {
|
|
if (diameterOrScene instanceof Scene) {
|
|
if (diameterOrScene instanceof Scene) {
|
|
scene = diameterOrScene;
|
|
scene = diameterOrScene;
|
|
@@ -1435,18 +1442,49 @@
|
|
}
|
|
}
|
|
|
|
|
|
// Torus (Code from SharpDX.org)
|
|
// Torus (Code from SharpDX.org)
|
|
- public static CreateTorus(name: string, diameter: number, thickness: number, tessellation: number, scene: Scene, updatable?: boolean, sideOrientation: number = Mesh.DEFAULTSIDE): Mesh {
|
|
|
|
|
|
+ public static CreateTorus(name: string, diameter: number, thickness: number, tessellation: number, scene: Scene, updatable?: boolean, sideOrientation?: number): Mesh;
|
|
|
|
+ public static CreateTorus(name: string, options: { diameter?: number, thickness?: number, tessellation?: number, updatable?: boolean, sideOrientation?: number}, scene: any): Mesh;
|
|
|
|
+ public static CreateTorus(name: string, options: any, thicknessOrScene: any, tessellation?: number, scene?: Scene, updatable?: boolean, sideOrientation?: number): Mesh {
|
|
|
|
+ if (thicknessOrScene instanceof Scene) {
|
|
|
|
+ scene = thicknessOrScene;
|
|
|
|
+ updatable = options.updatable;
|
|
|
|
+ } else {
|
|
|
|
+ var diameter = options;
|
|
|
|
+ options = {
|
|
|
|
+ diameter: diameter,
|
|
|
|
+ thickness: thicknessOrScene,
|
|
|
|
+ tessellation: tessellation,
|
|
|
|
+ sideOrientation: sideOrientation
|
|
|
|
+ }
|
|
|
|
+ }
|
|
var torus = new Mesh(name, scene);
|
|
var torus = new Mesh(name, scene);
|
|
- var vertexData = VertexData.CreateTorus(diameter, thickness, tessellation, sideOrientation);
|
|
|
|
|
|
+ var vertexData = VertexData.CreateTorus(options);
|
|
|
|
|
|
vertexData.applyToMesh(torus, updatable);
|
|
vertexData.applyToMesh(torus, updatable);
|
|
|
|
|
|
return torus;
|
|
return torus;
|
|
}
|
|
}
|
|
|
|
|
|
- public static CreateTorusKnot(name: string, radius: number, tube: number, radialSegments: number, tubularSegments: number, p: number, q: number, scene: Scene, updatable?: boolean, sideOrientation: number = Mesh.DEFAULTSIDE): Mesh {
|
|
|
|
|
|
+ public static CreateTorusKnot(name: string, radius: number, tube: number, radialSegments: number, tubularSegments: number, p: number, q: number, scene: Scene, updatable?: boolean, sideOrientation?: number): Mesh;
|
|
|
|
+ public static CreateTorusKnot(name: string, options: { radius?: number, tube?: number, radialSegments?: number, tubularSegments?: number, p?: number, q?: number, updatable?: boolean, sideOrientation?: number }, scene: any): Mesh;
|
|
|
|
+ public static CreateTorusKnot(name: string, options: any, tubeOrScene: any, radialSegments?: number, tubularSegments?: number, p?: number, q?: number, scene?: Scene, updatable?: boolean, sideOrientation?: number): Mesh {
|
|
|
|
+ if (tubeOrScene instanceof Scene) {
|
|
|
|
+ scene = tubeOrScene;
|
|
|
|
+ updatable = options.updatable;
|
|
|
|
+ } else {
|
|
|
|
+ var radius = options;
|
|
|
|
+ options = {
|
|
|
|
+ radius: radius,
|
|
|
|
+ tube: tubeOrScene,
|
|
|
|
+ radialSegments: radialSegments,
|
|
|
|
+ tubularSegments: tubularSegments,
|
|
|
|
+ p: p,
|
|
|
|
+ q: q,
|
|
|
|
+ sideOrientation: sideOrientation
|
|
|
|
+ }
|
|
|
|
+ }
|
|
var torusKnot = new Mesh(name, scene);
|
|
var torusKnot = new Mesh(name, scene);
|
|
- var vertexData = VertexData.CreateTorusKnot(radius, tube, radialSegments, tubularSegments, p, q, sideOrientation);
|
|
|
|
|
|
+ var vertexData = VertexData.CreateTorusKnot(options);
|
|
|
|
|
|
vertexData.applyToMesh(torusKnot, updatable);
|
|
vertexData.applyToMesh(torusKnot, updatable);
|
|
|
|
|
|
@@ -1665,11 +1703,20 @@
|
|
|
|
|
|
// Plane & ground
|
|
// Plane & ground
|
|
public static CreatePlane(name: string, size: number, scene: Scene, updatable?: boolean, sideOrientation?: number): Mesh;
|
|
public static CreatePlane(name: string, size: number, scene: Scene, updatable?: boolean, sideOrientation?: number): Mesh;
|
|
- public static CreatePlane(name: string, options: { width?: number, height?: number, sideOrientation?: number, updatable?: boolean }, scene: Scene): Mesh;
|
|
|
|
|
|
+ public static CreatePlane(name: string, options: { size?: number, width?: number, height?: number, sideOrientation?: number, updatable?: boolean }, scene: Scene): Mesh;
|
|
public static CreatePlane(name: string, options: any, scene: Scene, updatable?: boolean, sideOrientation: number = Mesh.DEFAULTSIDE): Mesh {
|
|
public static CreatePlane(name: string, options: any, scene: Scene, updatable?: boolean, sideOrientation: number = Mesh.DEFAULTSIDE): Mesh {
|
|
|
|
+ if (typeof options === 'number') {
|
|
|
|
+ var size = options;
|
|
|
|
+ options = {
|
|
|
|
+ size: size,
|
|
|
|
+ width: size,
|
|
|
|
+ height: size,
|
|
|
|
+ sideOrientation: sideOrientation
|
|
|
|
+ }
|
|
|
|
+ }
|
|
var plane = new Mesh(name, scene);
|
|
var plane = new Mesh(name, scene);
|
|
|
|
|
|
- var vertexData = VertexData.CreatePlane(options, sideOrientation);
|
|
|
|
|
|
+ var vertexData = VertexData.CreatePlane(options);
|
|
|
|
|
|
vertexData.applyToMesh(plane, updatable || options.updatable);
|
|
vertexData.applyToMesh(plane, updatable || options.updatable);
|
|
|
|
|
|
@@ -1677,7 +1724,7 @@
|
|
}
|
|
}
|
|
|
|
|
|
public static CreateGround(name: string, width: number, height: number, subdivisions: number, scene: Scene, updatable?: boolean): Mesh;
|
|
public static CreateGround(name: string, width: number, height: number, subdivisions: number, scene: Scene, updatable?: boolean): Mesh;
|
|
- public static CreateGround(name: string, options: { width?: number, height?: number, subdivisions?: number, sideOrientation?: number, updatable?: boolean }, scene: any): Mesh;
|
|
|
|
|
|
+ public static CreateGround(name: string, options: { width?: number, height?: number, subdivisions?: number, updatable?: boolean }, scene: any): Mesh;
|
|
public static CreateGround(name: string, options: any, heightOrScene: any, subdivisions?: number, scene?: Scene, updatable?: boolean): Mesh {
|
|
public static CreateGround(name: string, options: any, heightOrScene: any, subdivisions?: number, scene?: Scene, updatable?: boolean): Mesh {
|
|
if (heightOrScene instanceof Scene) {
|
|
if (heightOrScene instanceof Scene) {
|
|
scene = heightOrScene;
|
|
scene = heightOrScene;
|