/** 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(); }
/** * 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); }
/** * 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()); }