FileDocCategorySizeDatePackage
Transform.javaAPI DocAndroid 5.1 API2730Thu Mar 12 22:22:44 GMT 2015com.android.scenegraph

Transform

public abstract class Transform extends SceneGraphBase
hide

Fields Summary
Transform
mParent
ArrayList
mChildren
ScriptField_SgTransform
mField
ScriptField_SgTransform.Item
mTransformData
Constructors Summary
public Transform()

        mChildren = new ArrayList<Transform>();
        mParent = null;
    
Methods Summary
public voidappendChild(com.android.scenegraph.Transform t)

        mChildren.add(t);
        t.mParent = this;
        updateRSChildData(true);
    
ScriptField_SgTransformgetRSData()

        if (mField != null) {
            return mField;
        }

        RenderScriptGL rs = SceneManager.getRS();
        if (rs == null) {
            return null;
        }
        mField = new ScriptField_SgTransform(rs, 1);

        mTransformData = new ScriptField_SgTransform.Item();
        mTransformData.name = getNameAlloc(rs);
        mTransformData.isDirty = 1;
        mTransformData.timestamp = 1;

        initLocalData();
        updateRSChildData(false);

        mField.set(mTransformData, 0, true);
        return mField;
    
abstract voidinitLocalData()

voidupdateRSChildData(boolean copyData)

        if (mField == null) {
            return;
        }
        RenderScriptGL rs = SceneManager.getRS();
        if (mChildren.size() != 0) {
            Allocation childRSData = Allocation.createSized(rs, Element.ALLOCATION(rs),
                                                            mChildren.size());
            mTransformData.children = childRSData;

            Allocation[] childrenAllocs = new Allocation[mChildren.size()];
            for (int i = 0; i < mChildren.size(); i ++) {
                Transform child = mChildren.get(i);
                childrenAllocs[i] = child.getRSData().getAllocation();
            }
            childRSData.copyFrom(childrenAllocs);
        }
        if (copyData) {
            mField.set(mTransformData, 0, true);
        }