Set a vector to the origin - Android java.lang

Android examples for java.lang:Math Vector

Description

Set a vector to the origin

Demo Code


//package com.java2s;

public class Main {
    /**//w w  w .j a v a 2  s  . c o  m
     * Set a vector to the origin
     * 
     * @param vec The vector to set (vec4)
     * @param vOffset index into vec where the result vector starts
     */
    public static void setOrigin(float[] vec, int vOffset) {
        //android.util.Log.d(TAG,"setOrigin()");
        vec[vOffset + 0] = vec[vOffset + 1] = vec[vOffset + 2] = 0f;
        vec[vOffset + 3] = 1f;
    }
}

Related Tutorials