All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.jogamp.oculusvr.ovrMatrix4f Maven / Gradle / Ivy

/* !---- DO NOT EDIT: This file autogenerated by com/jogamp/gluegen/JavaEmitter.java on Wed Mar 11 21:09:24 CET 2015 ----! */


package com.jogamp.oculusvr;

import java.nio.*;

import com.jogamp.gluegen.runtime.*;
import com.jogamp.common.os.*;
import com.jogamp.common.nio.*;
import jogamp.common.os.MachineDataInfoRuntime;

import com.jogamp.oculusvr.*;
import java.security.AccessController;
import java.security.PrivilegedAction;

public class ovrMatrix4f {

  StructAccessor accessor;

  private static final int mdIdx = MachineDataInfoRuntime.getStatic().ordinal();
  private final MachineDataInfo md;

  private static final int[] ovrMatrix4f_size = new int[] { 64 /* ARM_MIPS_32 */, 64 /* X86_32_UNIX */, 64 /* X86_32_MACOS */, 64 /* PPC_32_UNIX */, 64 /* SPARC_32_SUNOS */, 64 /* X86_32_WINDOWS */, 64 /* LP64_UNIX */, 64 /* X86_64_WINDOWS */  };
  private static final int[] M_offset = new int[] { 0 /* ARM_MIPS_32 */, 0 /* X86_32_UNIX */, 0 /* X86_32_MACOS */, 0 /* PPC_32_UNIX */, 0 /* SPARC_32_SUNOS */, 0 /* X86_32_WINDOWS */, 0 /* LP64_UNIX */, 0 /* X86_64_WINDOWS */ };
  private static final int[] M_size = new int[] { 64 /* ARM_MIPS_32 */, 64 /* X86_32_UNIX */, 64 /* X86_32_MACOS */, 64 /* PPC_32_UNIX */, 64 /* SPARC_32_SUNOS */, 64 /* X86_32_WINDOWS */, 64 /* LP64_UNIX */, 64 /* X86_64_WINDOWS */  };

  public static int size() {
    return ovrMatrix4f_size[mdIdx];
  }

  public static ovrMatrix4f create() {
    return create(Buffers.newDirectByteBuffer(size()));
  }

  public static ovrMatrix4f create(java.nio.ByteBuffer buf) {
      return new ovrMatrix4f(buf);
  }

  ovrMatrix4f(java.nio.ByteBuffer buf) {
    md = MachineDataInfo.StaticConfig.values()[mdIdx].md;
    accessor = new StructAccessor(buf);
  }

  public java.nio.ByteBuffer getBuffer() {
    return accessor.getBuffer();
  }

  /** Getter for native field M: CType[(ArrayType) 'float * *', size [fixed false, lnx64 64], [const[false], array*2]], with array length of 4*4 */
  public static final int getMArrayLength() {
    return 4*4;
  }

  /** Setter for native field M: CType[(ArrayType) 'float * *', size [fixed false, lnx64 64], [const[false], array*2]], with array length of 4*4 */
  public ovrMatrix4f setM(final int offset, float[] val) {
    final int arrayLength = 4*4;
    if( offset + val.length > arrayLength ) { throw new IndexOutOfBoundsException("offset "+offset+" + val.length "+val.length+" > array-length "+arrayLength); };
    final int elemSize = Buffers.SIZEOF_FLOAT;
    final ByteBuffer destB = getBuffer();
    final int bTotal = arrayLength * elemSize;
    if( bTotal > M_size[mdIdx] ) { throw new IndexOutOfBoundsException("bTotal "+bTotal+" > size "+M_size[mdIdx]+", elemSize "+elemSize+" * "+arrayLength); };
    int bOffset = M_offset[mdIdx];
    final int bLimes = bOffset + bTotal;
    if( bLimes > destB.limit() ) { throw new IndexOutOfBoundsException("bLimes "+bLimes+" > buffer.limit "+destB.limit()+", elemOff "+bOffset+", elemSize "+elemSize+" * "+arrayLength); };
    bOffset += elemSize * offset;
    accessor.setFloatsAt(bOffset, val);
    return this;
  }

  /** Getter for native field M: CType[(ArrayType) 'float * *', size [fixed false, lnx64 64], [const[false], array*2]], with array length of 4*4 */
  public FloatBuffer getM() {
    return accessor.slice(M_offset[mdIdx],  Buffers.SIZEOF_FLOAT * 4*4).asFloatBuffer();
  }

  /** Getter for native field M: CType[(ArrayType) 'float * *', size [fixed false, lnx64 64], [const[false], array*2]], with array length of 4*4 */
  public float[] getM(final int offset, float result[]) {
    final int arrayLength = 4*4;
    if( offset + result.length > arrayLength ) { throw new IndexOutOfBoundsException("offset "+offset+" + result.length "+result.length+" > array-length "+arrayLength); };
    return accessor.getFloatsAt(M_offset[mdIdx] + (Buffers.SIZEOF_FLOAT * offset), result);
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy