77import com .jme3 .renderer .Camera ;
88import com .jme3 .scene .Node ;
99import com .jme3 .scene .Spatial ;
10+ import com .ss .editor .annotation .FromAnyThread ;
11+ import com .ss .editor .annotation .JMEThread ;
1012import com .ss .editor .util .LocalObjects ;
1113import org .jetbrains .annotations .NotNull ;
1214import org .jetbrains .annotations .Nullable ;
@@ -92,6 +94,7 @@ enum TransformationMode {
9294 GLOBAL {
9395
9496 @ Override
97+ @ JMEThread
9598 public void prepareToRotate (@ NotNull final Node parent , @ NotNull final Node child ,
9699 @ NotNull final Transform transform , @ NotNull final Camera camera ) {
97100 parent .setLocalRotation (Quaternion .IDENTITY );
@@ -100,6 +103,7 @@ public void prepareToRotate(@NotNull final Node parent, @NotNull final Node chil
100103
101104 @ NotNull
102105 @ Override
106+ @ JMEThread
103107 protected Vector3f getScaleAxis (@ NotNull final Transform transform , @ NotNull final PickedAxis pickedAxis ,
104108 @ NotNull final Camera camera ) {
105109
@@ -113,6 +117,7 @@ protected Vector3f getScaleAxis(@NotNull final Transform transform, @NotNull fin
113117 }
114118
115119 @ Override
120+ @ JMEThread
116121 public void prepareToMove (@ NotNull final Node parent , @ NotNull final Node child ,
117122 @ NotNull final Transform transform , @ NotNull final Camera camera ) {
118123 parent .setLocalTranslation (Vector3f .ZERO );
@@ -123,6 +128,7 @@ public void prepareToMove(@NotNull final Node parent, @NotNull final Node child,
123128
124129 @ NotNull
125130 @ Override
131+ @ JMEThread
126132 public Quaternion getToolRotation (@ NotNull final Transform transform , @ NotNull final Camera camera ) {
127133 return Quaternion .IDENTITY ;
128134 }
@@ -133,6 +139,7 @@ public Quaternion getToolRotation(@NotNull final Transform transform, @NotNull f
133139 VIEW {
134140
135141 @ Override
142+ @ JMEThread
136143 public void prepareToRotate (@ NotNull final Node parent , @ NotNull final Node child ,
137144 @ NotNull final Transform transform , @ NotNull final Camera camera ) {
138145 parent .setLocalRotation (Quaternion .IDENTITY );
@@ -141,6 +148,7 @@ public void prepareToRotate(@NotNull final Node parent, @NotNull final Node chil
141148
142149 @ NotNull
143150 @ Override
151+ @ JMEThread
144152 protected Vector3f getScaleAxis (@ NotNull final Transform transform , @ NotNull final PickedAxis pickedAxis ,
145153 @ NotNull final Camera camera ) {
146154
@@ -155,6 +163,7 @@ protected Vector3f getScaleAxis(@NotNull final Transform transform, @NotNull fin
155163
156164 @ NotNull
157165 @ Override
166+ @ JMEThread
158167 protected Vector3f getPickedVector (@ NotNull final Transform transform , @ NotNull final PickedAxis pickedAxis ,
159168 @ NotNull final Camera camera ) {
160169
@@ -168,6 +177,7 @@ protected Vector3f getPickedVector(@NotNull final Transform transform, @NotNull
168177 }
169178
170179 @ Override
180+ @ JMEThread
171181 public void prepareToMove (@ NotNull final Node parent , @ NotNull final Node child ,
172182 @ NotNull final Transform transform , @ NotNull final Camera camera ) {
173183 parent .setLocalRotation (camera .getRotation ());
@@ -178,6 +188,7 @@ public void prepareToMove(@NotNull final Node parent, @NotNull final Node child,
178188
179189 @ NotNull
180190 @ Override
191+ @ JMEThread
181192 public Quaternion getToolRotation (@ NotNull final Transform transform , @ NotNull final Camera camera ) {
182193 return camera .getRotation ();
183194 }
@@ -187,6 +198,7 @@ public Quaternion getToolRotation(@NotNull final Transform transform, @NotNull f
187198 private static final TransformationMode [] VALUES = values ();
188199
189200 @ NotNull
201+ @ FromAnyThread
190202 public static TransformationMode valueOf (final int index ) {
191203 return VALUES [index ];
192204 }
@@ -199,6 +211,7 @@ public static TransformationMode valueOf(final int index) {
199211 * @return the tool rotation.
200212 */
201213 @ NotNull
214+ @ JMEThread
202215 public Quaternion getToolRotation (@ NotNull final Transform transform , @ NotNull final Camera camera ) {
203216 return transform .getRotation ();
204217 }
@@ -211,6 +224,7 @@ public Quaternion getToolRotation(@NotNull final Transform transform, @NotNull f
211224 * @param transform the base transform.
212225 * @param camera the camera.
213226 */
227+ @ JMEThread
214228 public void prepareToRotate (@ NotNull final Node parent , @ NotNull final Node child ,
215229 @ NotNull final Transform transform , @ NotNull final Camera camera ) {
216230 parent .setLocalRotation (transform .getRotation ());
@@ -225,6 +239,7 @@ public void prepareToRotate(@NotNull final Node parent, @NotNull final Node chil
225239 * @param transform the base transform.
226240 * @param camera the camera.
227241 */
242+ @ JMEThread
228243 public void prepareToScale (@ NotNull final Node parent , @ NotNull final Node child ,
229244 @ NotNull final Transform transform , @ NotNull final Camera camera ) {
230245 parent .setLocalScale (transform .getScale ());
@@ -239,6 +254,7 @@ public void prepareToScale(@NotNull final Node parent, @NotNull final Node child
239254 * @param transform the base transform.
240255 * @param camera the camera.
241256 */
257+ @ JMEThread
242258 public void prepareToMove (@ NotNull final Node parent , @ NotNull final Node child ,
243259 @ NotNull final Transform transform , @ NotNull final Camera camera ) {
244260 parent .setLocalTranslation (transform .getTranslation ());
@@ -256,6 +272,7 @@ public void prepareToMove(@NotNull final Node parent, @NotNull final Node child,
256272 * @return the axis vector.
257273 */
258274 @ NotNull
275+ @ JMEThread
259276 protected Vector3f getPickedVector (@ NotNull final Transform transform , @ NotNull final PickedAxis pickedAxis ,
260277 @ NotNull final Camera camera ) {
261278
@@ -275,6 +292,7 @@ protected Vector3f getPickedVector(@NotNull final Transform transform, @NotNull
275292 * @return the axis vector.
276293 */
277294 @ NotNull
295+ @ JMEThread
278296 protected Vector3f getScaleAxis (@ NotNull final Transform transform , @ NotNull final PickedAxis pickedAxis ,
279297 @ NotNull final Camera camera ) {
280298
@@ -292,13 +310,15 @@ protected Vector3f getScaleAxis(@NotNull final Transform transform, @NotNull fin
292310 * @return the center of transformation.
293311 */
294312 @ Nullable
313+ @ JMEThread
295314 Transform getTransformCenter ();
296315
297316 /**
298317 * Sets picked axis.
299318 *
300319 * @param axis the picked axis.
301320 */
321+ @ JMEThread
302322 void setPickedAxis (@ NotNull final PickedAxis axis );
303323
304324 /**
@@ -307,63 +327,73 @@ protected Vector3f getScaleAxis(@NotNull final Transform transform, @NotNull fin
307327 * @return the picked axis.
308328 */
309329 @ NotNull
330+ @ JMEThread
310331 PickedAxis getPickedAxis ();
311332
312333 /**
313334 * Gets the transform mode.
314335 *
315336 * @return the transform mode.
316337 */
317- @ NotNull EditorTransformSupport .TransformationMode getTransformationMode ();
338+ @ NotNull
339+ @ JMEThread
340+ EditorTransformSupport .TransformationMode getTransformationMode ();
318341
319342 /**
320343 * Gets collision plane.
321344 *
322345 * @return the collision plane.
323346 */
324347 @ Nullable
348+ @ JMEThread
325349 Node getCollisionPlane ();
326350
327351 /**
328352 * Set delta of transformation.
329353 *
330354 * @param transformDeltaX the x delta.
331355 */
356+ @ JMEThread
332357 void setTransformDeltaX (float transformDeltaX );
333358
334359 /**
335360 * Set delta of transformation.
336361 *
337362 * @param transformDeltaY the y delta.
338363 */
364+ @ JMEThread
339365 void setTransformDeltaY (float transformDeltaY );
340366
341367 /**
342368 * Set delta of transformation.
343369 *
344370 * @param transformDeltaZ the z delta.
345371 */
372+ @ JMEThread
346373 void setTransformDeltaZ (float transformDeltaZ );
347374
348375 /**
349376 * Get delta of transformation.
350377 *
351378 * @return the delta x.
352379 */
380+ @ JMEThread
353381 float getTransformDeltaX ();
354382
355383 /**
356384 * Get delta of transformation.
357385 *
358386 * @return the delta y.
359387 */
388+ @ JMEThread
360389 float getTransformDeltaY ();
361390
362391 /**
363392 * Get delta of transformation.
364393 *
365394 * @return the delta z.
366395 */
396+ @ JMEThread
367397 float getTransformDeltaZ ();
368398
369399 /**
@@ -372,13 +402,15 @@ protected Vector3f getScaleAxis(@NotNull final Transform transform, @NotNull fin
372402 * @return the model to transform.
373403 */
374404 @ Nullable
405+ @ JMEThread
375406 Spatial getToTransform ();
376407
377408 /**
378409 * Notify transformed.
379410 *
380411 * @param spatial the model which was transformed.
381412 */
413+ @ JMEThread
382414 void notifyTransformed (@ NotNull final Spatial spatial );
383415
384416 /**
@@ -387,5 +419,6 @@ protected Vector3f getScaleAxis(@NotNull final Transform transform, @NotNull fin
387419 * @return the camera.
388420 */
389421 @ NotNull
422+ @ JMEThread
390423 Camera getCamera ();
391424}
0 commit comments