Exemple #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();
 }
Exemple #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);
 }
Exemple #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());
 }