Vector3D v = new Vector3D(0,-100, 0);
//Add the textarea to the set parent
if (getParentToAddNewTextAreaTo() != null){
//Transform the textarea so it appears at the same world coords after its added to another parent
Matrix m = MTComponent.getTransformToDestinationParentSpace(ta, getParentToAddNewTextAreaTo());
ta.transform(m);
//Transform the direction vector for the translation animation
//to preserve the direction from the old reference frame to the new parents one
// v.transformNormal(m);
v.transformDirectionVector(m);
ta.tweenTranslate(v, 500, 0.3f, 0.7f);
getParentToAddNewTextAreaTo().addChild(ta);
}else{
//If that isnt set, try to add it to the keyboards parent
if (getParent() != null){
/////////////////////////
// Transform the textarea so it appears at the same place after its added to another parent
Matrix m = MTComponent.getTransformToDestinationParentSpace(ta, getParent());
ta.transform(m);
//Transform the direction vector to preserve the global direction
//from the old reference frame to the new parents one
//The translation part has to be removed from the matrix because we're transforming
//a translation vector not a point vector