Procházet zdrojové kódy

updatable vertexData

a.vinogradov před 4 roky
rodič
revize
02e7c8d80b
1 změnil soubory, kde provedl 13 přidání a 6 odebrání
  1. 13 6
      src/Meshes/Builders/capsuleBuilder.ts

+ 13 - 6
src/Meshes/Builders/capsuleBuilder.ts

@@ -246,6 +246,9 @@ export interface ICreateCapsuleOptions{
 
 
     /** Overwrite for the bottom capSubdivisions. */
     /** Overwrite for the bottom capSubdivisions. */
     bottomCapSubdivisions?: number;
     bottomCapSubdivisions?: number;
+
+    /** Internal geometry is supposed to change once created. */
+    updatable?: boolean;
 }
 }
 
 
 /**
 /**
@@ -271,18 +274,22 @@ export class CapsuleBuilder {
      * @param scene The scene the mesh is scoped to.
      * @param scene The scene the mesh is scoped to.
      * @returns Capsule Mesh
      * @returns Capsule Mesh
      */
      */
-    public static CreateCapsule(name: string, options: ICreateCapsuleOptions = {
+    public static CreateCapsule(
+        name: string,
+        options: ICreateCapsuleOptions = {
             orientation : Vector3.Up(),
             orientation : Vector3.Up(),
             subdivisions: 2,
             subdivisions: 2,
             tessellation: 16,
             tessellation: 16,
             height: 1,
             height: 1,
             radius: 0.25,
             radius: 0.25,
-            capSubdivisions: 6
-        }, scene: any): Mesh {
-
+            capSubdivisions: 6,
+            updatable: false,
+        },
+        scene: any
+    ): Mesh {
         var capsule = new Mesh(name, scene);
         var capsule = new Mesh(name, scene);
         var vertexData = VertexData.CreateCapsule(options);
         var vertexData = VertexData.CreateCapsule(options);
-        vertexData.applyToMesh(capsule);
+        vertexData.applyToMesh(capsule, options.updatable);
         return capsule;
         return capsule;
     }
     }
-}
+}