瀏覽代碼

update what's new and Matrix method return type

Julien Barrois 6 年之前
父節點
當前提交
4cbc2f7096
共有 2 個文件被更改,包括 4 次插入2 次删除
  1. 2 0
      dist/preview release/what's new.md
  2. 2 2
      src/Math/babylon.math.ts

+ 2 - 0
dist/preview release/what's new.md

@@ -34,6 +34,7 @@
   - Added an option `useClonedMeshhMap` in the `Scene` constructor options. When set to true, each `Mesh` will have and will keep up-to-date a map of cloned meshes. This is to avoid browsing all the meshes of the scene to retrieve the ones that have the current mesh as source mesh. Disabled by default
   - Added `blockfreeActiveMeshesAndRenderingGroups` property in the `Scene`, following the same model as `blockMaterialDirtyMechanism`. This is to avoid calling `Scene.freeActiveMeshes` and `Scene.freeRenderingGroups` for each disposed mesh when we dispose several meshes in a row. One have to set `blockfreeActiveMeshesAndRenderingGroups` to `true` just before disposing the meshes, and set it back to `false` just after
   - Prevented code from doing useless and possible time consuming computation when disposing the `ShaderMaterial` of a `LinesMesh`
+  - Make a better use of the `isIdentity` cached value wihtin a `Matrix`
 - Align `BoundingBox` and `BoundingSphere` API and behavior for clarity and simplicity. As a consequence, the `BoundingBox`'s method `setWorldMatrix` has been removed and the underlying world matrix cannot be modified but by calling `reConstruct` or `update`. ([barroij](https://github.com/barroij))
 
 ### glTF Loader
@@ -64,3 +65,4 @@
 - `Database.openAsync` was renamed by `Database.open` ([Deltakosh](https://github.com/deltakosh))
 - `scene.database` was renamed to `scene.offlineProvider` ([Deltakosh](https://github.com/deltakosh))
 - `BoundingBox.setWorldMatrix` was removed. `BoundingBox.getWorldMatrix` now returns a `Readonly<Matrix>` ([barroij](https://github.com/barroij))
+- `Matrix`'s accessor `m` and method `toArray` and `adArray`now returns a `Readonly<Float32Array>` as the matrix underlying array is not supposed to be modified manually from the outside of the class ([barroij](https://github.com/barroij))

+ 2 - 2
src/Math/babylon.math.ts

@@ -4318,14 +4318,14 @@ module BABYLON {
          * Returns the matrix as a Float32Array
          * @returns the matrix underlying array
          */
-        public toArray(): Float32Array {
+        public toArray(): Readonly<Float32Array> {
             return this._m;
         }
         /**
          * Returns the matrix as a Float32Array
         * @returns the matrix underlying array.
         */
-        public asArray(): Float32Array {
+        public asArray(): Readonly<Float32Array> {
             return this._m;
         }