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

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

There is a newer version: 2.3.2
Show newest version
/* !---- DO NOT EDIT: This file autogenerated by com/jogamp/gluegen/JavaEmitter.java on Mon Sep 08 08:44:12 CEST 2014 ----! */


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.MachineDescriptionRuntime;

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

public class ovrMatrix4f {

  StructAccessor accessor;

  private static final int mdIdx = MachineDescriptionRuntime.getStatic().ordinal();

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

  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) {
    accessor = new StructAccessor(buf);
  }

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

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

  /** Setter for native field: CType['float * *', size [fixed false, lnx64 64], [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: CType['float * *', size [fixed false, lnx64 64], [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: CType['float * *', size [fixed false, lnx64 64], [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