FileDocCategorySizeDatePackage
CompoundTransform.javaAPI DocAndroid 5.1 API6578Thu Mar 12 22:22:44 GMT 2015com.android.scenegraph

CompoundTransform

public class CompoundTransform extends Transform
hide

Fields Summary
ScriptField_TransformComponent_s
mComponentField
public ArrayList
mTransformComponents
Constructors Summary
public CompoundTransform()

        mTransformComponents = new ArrayList<Component>();
    
Methods Summary
public voidaddComponent(com.android.scenegraph.CompoundTransform$Component c)

        if (c.mParent != null) {
            throw new IllegalArgumentException("Transform components may not be shared");
        }
        c.mParent = this;
        c.mParentIndex = mTransformComponents.size();
        mTransformComponents.add(c);
        updateRSComponentAllocation();
    
public com.android.scenegraph.CompoundTransform$RotateComponentaddRotate(java.lang.String name, android.renderscript.Float3 axis, float angle)

        RotateComponent c = new RotateComponent(name, axis, angle);
        addComponent(c);
        return c;
    
public com.android.scenegraph.CompoundTransform$ScaleComponentaddScale(java.lang.String name, android.renderscript.Float3 scale)

        ScaleComponent c = new ScaleComponent(name, scale);
        addComponent(c);
        return c;
    
public com.android.scenegraph.CompoundTransform$TranslateComponentaddTranslate(java.lang.String name, android.renderscript.Float3 translate)

        TranslateComponent c = new TranslateComponent(name, translate);
        addComponent(c);
        return c;
    
voidinitLocalData()

        RenderScriptGL rs = SceneManager.getRS();
        int numComponenets = mTransformComponents.size();
        if (numComponenets > 0) {
            mComponentField = new ScriptField_TransformComponent_s(rs, numComponenets);
            for (int i = 0; i < numComponenets; i ++) {
                Component ith = mTransformComponents.get(i);
                mComponentField.set(ith.getRSData(), i, false);
            }
            mComponentField.copyAll();

            mTransformData.components = mComponentField.getAllocation();
        }
    
public voidsetComponent(int index, com.android.scenegraph.CompoundTransform$Component c)

        if (c.mParent != null) {
            throw new IllegalArgumentException("Transform components may not be shared");
        }
        if (index >= mTransformComponents.size()) {
            throw new IllegalArgumentException("Invalid component index");
        }
        c.mParent = this;
        c.mParentIndex = index;
        mTransformComponents.set(index, c);
        updateRSComponent(c);
    
voidupdateRSComponent(com.android.scenegraph.CompoundTransform$Component c)

        if (mField == null || mComponentField == null) {
            return;
        }
        mComponentField.set(c.getRSData(), c.mParentIndex, true);
        mField.set_isDirty(0, 1, true);
    
voidupdateRSComponentAllocation()

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

        mField.set_components(0, mTransformData.components, false);
        mField.set_isDirty(0, 1, true);