Пример #1
0
 /** Updates the transform of an attached model based on that of the primary. */
 protected static void updateAttachedTransform(
     Model attached, Transform3D mtrans, boolean rotate) {
   Transform3D atrans = attached.getLocalTransform();
   atrans.set(
       mtrans.getTranslation(),
       rotate ? mtrans.getRotation() : Quaternion.IDENTITY,
       atrans.approximateUniformScale());
   attached.updateBounds();
 }
Пример #2
0
 /**
  * Attaches a model to this sprite, setting its scale to the product of the provided base scale
  * and an attachment scale specified by the implementation.
  */
 public void attachScaledModel(Model model, float baseScale) {
   Transform3D transform = model.getLocalTransform();
   transform.setScale(baseScale * getAttachedScale());
   transform.promote(Transform3D.UNIFORM);
   attachModel(model, true);
 }
Пример #3
0
 /**
  * Attaches a model to this sprite, setting its scale to the product of its current scale and an
  * attachment scale specified by the implementation.
  */
 public void attachScaledModel(Model model) {
   attachScaledModel(model, model.getLocalTransform().approximateUniformScale());
 }