babylonjs-editcontrol 3.3.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +54 -29
- package/dist/EditControl.d.ts +323 -325
- package/dist/EditControl.js +1 -1
- package/dist/EditControl.js.map +1 -1
- package/dist/EditControl.max.js +2084 -2
- package/dist/EditControl.max.js.map +1 -1
- package/package.json +8 -9
- package/src/EditControl.ts +34 -56
- package/dist/EditControl.max.js.LICENSE.txt +0 -9
package/README.md
CHANGED
|
@@ -31,52 +31,71 @@ I would address this in a future release.
|
|
|
31
31
|
|
|
32
32
|
For a list of other know issues, shortcomings and planned enhancements see <a href="https://github.com/ssatguru/BabylonJS-EditControl/issues" target="_blank"> https://github.com/ssatguru/BabylonJS-EditControl/issues </a>
|
|
33
33
|
|
|
34
|
-
###
|
|
34
|
+
### Changes
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
#### 4.0.0 (Breaking changes )
|
|
37
|
+
|
|
38
|
+
- Breaking change. Now user does not have to specify if the mesh, to which the edit control is being attached, uses Euler or Quaternion rotation. It figure that out itself. If mesh.rotationQuaternion is not null it assumes quaternion else euler.
|
|
39
|
+
As such the contructor now has changed from
|
|
40
|
+
```
|
|
41
|
+
constructor(mesh: TransformNode, camera: Camera, canvas: HTMLCanvasElement, scale?: number, eulerian?: boolean, pickWidth?: number)
|
|
42
|
+
```
|
|
43
|
+
to
|
|
44
|
+
```
|
|
45
|
+
constructor(mesh: TransformNode, camera: Camera, canvas: HTMLCanvasElement, scale?: number, pickWidth?: number)
|
|
46
|
+
```
|
|
47
|
+
- An edit control axes color now changes to yellow rather than white when pointer hovers over it or selects it. This seems to be the standard practice.
|
|
48
|
+
|
|
49
|
+
- Upgraded to latest version of babylonjs namely 8.47.0
|
|
50
|
+
- Upgraded other dev dependenices to latest version - typescript, webpack etc.
|
|
51
|
+
|
|
52
|
+
#### 3.3.0
|
|
53
|
+
|
|
54
|
+
- Moved the EditControl to the Babylonjs DefaultUtilityLayer scene.
|
|
37
55
|
Because this scene is different from the main scene there is less interference with the main scene. Also makes it a bit faster.
|
|
38
56
|
This is similar to how the native gizmos of Babylonjs work.
|
|
39
57
|
|
|
40
|
-
Upgraded to latest version of Babylons js - 5.41.
|
|
58
|
+
- Upgraded to latest version of Babylons js - 5.41.
|
|
41
59
|
Replaced deprecated methods with new ones.
|
|
42
|
-
Upgraded other dev dependenices to latest version - typescript, webpack etc.
|
|
60
|
+
- Upgraded other dev dependenices to latest version - typescript, webpack etc.
|
|
43
61
|
|
|
44
|
-
|
|
62
|
+
#### 3.2.0 (Breaking changes)
|
|
45
63
|
|
|
46
|
-
Version 3.2.0 converts the project from a plain vanilla JavaScript project to a module based JavaScript project.
|
|
64
|
+
- Version 3.2.0 converts the project from a plain vanilla JavaScript project to a module based JavaScript project.
|
|
47
65
|
With this change, the way to load the application has changed.
|
|
48
66
|
In JavaScript, instead of
|
|
49
67
|
|
|
50
|
-
```
|
|
51
|
-
var EditControl = org.ssatguru.babylonjs.component.EditControl;
|
|
52
|
-
editControl = new EditControl(box,camera, canvas, 0.75);
|
|
53
|
-
```
|
|
68
|
+
```
|
|
69
|
+
var EditControl = org.ssatguru.babylonjs.component.EditControl;
|
|
70
|
+
editControl = new EditControl(box,camera, canvas, 0.75);
|
|
71
|
+
```
|
|
54
72
|
|
|
55
|
-
now do
|
|
73
|
+
now do
|
|
56
74
|
|
|
57
|
-
```
|
|
58
|
-
var editControl = new EditControl(box,camera, canvas, 0.75);
|
|
59
|
-
```
|
|
75
|
+
```
|
|
76
|
+
var editControl = new EditControl(box,camera, canvas, 0.75);
|
|
77
|
+
```
|
|
60
78
|
|
|
61
|
-
In TypeScript, instead of
|
|
79
|
+
In TypeScript, instead of
|
|
62
80
|
|
|
63
|
-
```
|
|
64
|
-
import EditControl = org.ssatguru.babylonjs.component.EditControl;
|
|
65
|
-
```
|
|
81
|
+
```
|
|
82
|
+
import EditControl = org.ssatguru.babylonjs.component.EditControl;
|
|
83
|
+
```
|
|
66
84
|
|
|
67
|
-
now do
|
|
85
|
+
now do
|
|
68
86
|
|
|
69
|
-
```
|
|
70
|
-
import {EditControl} from "babaylonjs-editcontrol";
|
|
71
|
-
```
|
|
87
|
+
```
|
|
88
|
+
import {EditControl} from "babaylonjs-editcontrol";
|
|
89
|
+
```
|
|
72
90
|
|
|
73
|
-
See below for more details.
|
|
91
|
+
See below for more details.
|
|
74
92
|
|
|
75
93
|
## Quick start
|
|
76
94
|
|
|
77
95
|
1. add the following dependencies
|
|
78
96
|
|
|
79
97
|
```
|
|
98
|
+
<!-- pep.js is optional -->
|
|
80
99
|
<script src="https://code.jquery.com/pep/0.4.2/pep.js"></script>
|
|
81
100
|
<script src="https://cdn.babylonjs.com/babylon.js"></script>
|
|
82
101
|
<script src="EditControl.js"></script>
|
|
@@ -171,7 +190,7 @@ Global Module
|
|
|
171
190
|
|
|
172
191
|
## DEPENDENCIES
|
|
173
192
|
|
|
174
|
-
- pepjs
|
|
193
|
+
- pepjs - optional. Its a polyfill needed for pointer support in very old browsers. Not needed if targeting relatively new browsers.
|
|
175
194
|
- babylonjs
|
|
176
195
|
|
|
177
196
|
The two can be installed from npm
|
|
@@ -193,23 +212,22 @@ or via cdn
|
|
|
193
212
|
|
|
194
213
|
```
|
|
195
214
|
// JavaScript
|
|
196
|
-
var editControl = new EditControl(mesh,camera, canvas, 0.75,
|
|
215
|
+
var editControl = new EditControl(mesh,camera, canvas, 0.75,0.02);
|
|
197
216
|
```
|
|
198
217
|
|
|
199
218
|
```
|
|
200
219
|
// TypeScript
|
|
201
220
|
import {EditControl} from "babaylonjs-editcontrol";
|
|
202
|
-
let editControl:EditControl = new EditControl(mesh,camera, canvas, 0.75,
|
|
221
|
+
let editControl:EditControl = new EditControl(mesh,camera, canvas, 0.75, 0.02);
|
|
203
222
|
```
|
|
204
223
|
|
|
205
224
|
This positions the edit control at the mesh pivot position and displays x,y,z axis.
|
|
206
|
-
Takes
|
|
225
|
+
Takes four parms
|
|
207
226
|
|
|
208
227
|
- mesh - the mesh to control using the editcontrol
|
|
209
228
|
- camera - active camera
|
|
210
229
|
- canvas - the mesh canvas
|
|
211
230
|
- scale - number. Optional. Default 1. Determines how small or large the editcontrol should appear.
|
|
212
|
-
- eulerian - true/false. Optional. Default false. True indicates that rotation of the mesh is in euler.If rotation is unresponsive then it is possible that the rotation may not have been initialized to either a eulerian or quaternion value.
|
|
213
231
|
- pickWidth - number. Optional. Default 0.02. Determines how close to an axis should the pointer get before we can pick it
|
|
214
232
|
|
|
215
233
|
#### To show Translation, Rotation or Scaling controls
|
|
@@ -424,7 +442,14 @@ Run "npm install", once, to install all the dependencies.
|
|
|
424
442
|
### Build
|
|
425
443
|
|
|
426
444
|
Run "npm run build" - this will compile the files in "src" and create a development module in the "dist" folder.
|
|
427
|
-
Run "npm run build-prod" - this will compile and create a minified production module in the "dist" folder.
|
|
445
|
+
Run "npm run build-prod" - this will compile and create a minified production module in the "dist" folder.
|
|
446
|
+
|
|
447
|
+
The project uses webpack which compiles using typescipt compiler and then optmize and packages the module.
|
|
448
|
+
The typescript compiler has been configured to output es6 code.
|
|
449
|
+
The webpack has been configured to output a UMD module.
|
|
450
|
+
In development mode it outputs a unoptmized UMD module, that is a human readable, properly formatted javascript UMD module. This file ends in ".max.js".
|
|
451
|
+
In production mode it outputs a optmized UMD module. The module is minified and its variables are mangled.
|
|
452
|
+
|
|
428
453
|
|
|
429
454
|
### To test
|
|
430
455
|
|