Android Matrix4f - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android Matrix4f class.

This code example shows how to use the following methods:
                // rotation-vector, which is what we want. 
                SensorManager.getRotationMatrixFromVector(
                        mRotationMatrix , event.values);
 
                if (mRender != null) {
                    mRender.onPostureChanged(new Matrix4f(mRotationMatrix));
                } 
            } 
        } 
    } 
 
    public void onAccuracyChanged(Sensor sensor, int accuracy) {
    } 
 
    public void toggleSensor() { 
        mUseSensor = !mUseSensor;
        if (mUseSensor == false) {
            mRender.onPostureChanged(mIdentityMatrix);
        } 
    } 
7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:
 */ 
public class MatrixTransform extends Transform { 
 
    Matrix4f mLocalMatrix;
    public MatrixTransform() { 
        mLocalMatrix = new Matrix4f();
    } 
 
    public void setMatrix(Matrix4f matrix) {
        mLocalMatrix = matrix;
        updateRSData(); 
    } 
 
    public Matrix4f getMatrix() {
        return new Matrix4f(mLocalMatrix.getArray());
    } 
 
    void initLocalData() { 
        mTransformData.localMat = mLocalMatrix;
    } 
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:
    private long HOLDOFF_DELAY = 100;
    private Handler mAsyncHandler; // Background thread handler for reading textures, geometry, etc.
    private Handler mSyncHandler; // Synchronous handler for interacting with UI elements.
 
    public static class TextureParameters { 
        public TextureParameters() { matrix = new Matrix4f(); }
        public TextureParameters(Matrix4f _matrix) { matrix = _matrix; }
        public Matrix4f matrix;
    }; 
 
    public static class DetailTextureParameters { 
        public DetailTextureParameters(float textureOffsetX, float textureOffsetY) {
            this.textureOffsetX = textureOffsetX;
            this.textureOffsetY = textureOffsetY;
            this.lineOffsetX = 0.0f;
            this.lineOffsetY = 0.0f;
        } 
        public DetailTextureParameters( 
                float textureOffsetX, float textureOffsetY,
                float lineOffsetX, float lineOffsetY) {
5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:loadProjectionNormalized
	private void initProgramVertex() { 
		ProgramVertexFixedFunction.Builder pvb = new ProgramVertexFixedFunction.Builder(mRS);
		mProgramVertex = pvb.create();
		ProgramVertexFixedFunction.Constants pva = new ProgramVertexFixedFunction.Constants(mRS);
		((ProgramVertexFixedFunction) mProgramVertex).bindConstants(pva);
		Matrix4f proj = new Matrix4f();
		proj.loadProjectionNormalized(1, 1);
		pva.setProjection(proj);
		mScript.set_gProgramVertex(mProgramVertex);
	} 
 
	/** 
	 * Prepares the Sampler (controls how pixels are pulled from a texture) 
	 */ 
	private void initSampler() { 
		mLinearClamp = Sampler.CLAMP_LINEAR(mRS);
		mScript.set_gLinearClamp(mLinearClamp);
	} 
} 
5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:loadOrthoWindow
	} 
 
	public void surfaceChanged() { 
		mWidth = mRS.getWidth();
		mHeight = mRS.getHeight();
		Matrix4f proj = new Matrix4f();
		proj.loadOrthoWindow(mWidth, mHeight);
		mPVA.setProjection(proj);
	} 
 
	private Resources mRes;
	private RenderScriptGL mRS;
	private Sampler mLinearClamp;
	private ProgramStore mProgStoreBlendNone;
	private ProgramFragment mProgFragmentTexture;
	private ProgramVertex mProgVertex;
	private ProgramVertexFixedFunction.Constants mPVA;
	private ProgramRaster mCullNone;
	private ScriptC_carousel mScript;
 
5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:loadOrthoWindow
    } 
 
    public void surfaceChanged() { 
        mWidth = mRS.getWidth();
        mHeight = mRS.getHeight();
        Matrix4f proj = new Matrix4f();
        proj.loadOrthoWindow(mWidth, mHeight);
        mPVA.setProjection(proj);
    } 
 
    private Resources mRes;
    private RenderScriptGL mRS;
    private Sampler mLinearClamp;
    private ProgramStore mProgStoreBlendNone;
    private ProgramFragment mProgFragmentTexture;
    private ProgramVertex mProgVertex;
    private ProgramVertexFixedFunction.Constants mPVA;
    private ProgramRaster mCullNone;
    private ScriptC_carousel mScript;
 
5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:loadOrthoWindow
    } 
 
    public void surfaceChanged() { 
        mWidth = mRS.getWidth();
        mHeight = mRS.getHeight();
        Matrix4f proj = new Matrix4f();
        proj.loadOrthoWindow(mWidth, mHeight);
        mPVA.setProjection(proj);
    } 
 
    private Resources mRes;
    private RenderScriptGL mRS;
    private Sampler mLinearClamp;
    private ProgramStore mProgStoreBlendNone;
    private ProgramFragment mProgFragmentTexture;
    private ProgramVertex mProgVertex;
    private ProgramVertexFixedFunction.Constants mPVA;
    private ProgramRaster mCullNone;
    private ScriptC_carousel mScript;
 
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:loadProjectionNormalized
        programVertex = pvBuilder.create();
        ProgramVertexFixedFunction.Constants pvConstants =
                new ProgramVertexFixedFunction.Constants(renderScriptGL);
        programVertex.bindConstants(pvConstants);
         
        Matrix4f projection = new Matrix4f();
        projection.loadProjectionNormalized(1, 1);
        pvConstants.setProjection(projection);
        script.set_programVertex(programVertex);
    } 
 
    private void initProgramFragment() { 
        final ProgramFragmentFixedFunction.Builder pfBuilder =
                new ProgramFragmentFixedFunction.Builder(renderScriptGL);
         
        pfBuilder.setTexture(
                ProgramFragmentFixedFunction.Builder.EnvMode.REPLACE,
                ProgramFragmentFixedFunction.Builder.Format.RGBA, 0);
        singleTextureFragmentProcess = pfBuilder.create();
        script.set_singleTextureFragmentProgram(singleTextureFragmentProcess);
5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:loadOrthoWindow
    } 
 
    public void surfaceChanged() { 
        mWidth = mRS.getWidth();
        mHeight = mRS.getHeight();
        Matrix4f proj = new Matrix4f();
        proj.loadOrthoWindow(mWidth, mHeight);
        mPVA.setProjection(proj);
    } 
 
    private Resources mRes;
    private RenderScriptGL mRS;
    private Sampler mLinearClamp;
    private ProgramStore mProgStoreBlendNone;
    private ProgramFragment mProgFragmentTexture;
    private ProgramVertex mProgVertex;
    private ProgramVertexFixedFunction.Constants mPVA;
    private ProgramRaster mCullNone;
    private ScriptC_pagecurl mScript;
 
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:loadIdentity
    private final float[] mRotationMatrix = new float[16];
 
    private static final int INVALID_POINTER_ID = -1;
    private int mActivePointerId = INVALID_POINTER_ID;
    private boolean mUseSensor = false;
    private Matrix4f mIdentityMatrix = new Matrix4f();
 
    public SimpleModelView(Context context) {
        super(context);
        ensureRenderScript(); 
        mScaleDetector = new ScaleGestureDetector(context, new ScaleListener());
        // Get an instance of the SensorManager 
        mSensorManager = (SensorManager)getContext().getSystemService(Context.SENSOR_SERVICE);
        // find the rotation-vector sensor 
        mRotationVectorSensor = mSensorManager.getDefaultSensor(
                Sensor.TYPE_ROTATION_VECTOR);
        mIdentityMatrix.loadIdentity();
    } 
 
    private void ensureRenderScript() { 

4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
See Code Examples for Android Matrix4f Methods: