1 /* ---------------------------------------------------------------------------- 2 * This file was automatically generated by SWIG (http://www.swig.org). 3 * Version 3.0.8 4 * 5 * Do not make changes to this file unless you know what you are doing--modify 6 * the SWIG interface file instead. 7 * ----------------------------------------------------------------------------- */ 8 9 package com.badlogic.gdx.physics.bullet.collision; 10 11 import com.badlogic.gdx.physics.bullet.BulletBase; 12 import com.badlogic.gdx.physics.bullet.linearmath.*; 13 import com.badlogic.gdx.math.Vector3; 14 import com.badlogic.gdx.math.Quaternion; 15 import com.badlogic.gdx.math.Matrix3; 16 import com.badlogic.gdx.math.Matrix4; 17 18 public class btOptimizedBvh extends btQuantizedBvh { 19 private long swigCPtr; 20 btOptimizedBvh(final String className, long cPtr, boolean cMemoryOwn)21 protected btOptimizedBvh(final String className, long cPtr, boolean cMemoryOwn) { 22 super(className, CollisionJNI.btOptimizedBvh_SWIGUpcast(cPtr), cMemoryOwn); 23 swigCPtr = cPtr; 24 } 25 26 /** Construct a new btOptimizedBvh, normally you should not need this constructor it's intended for low-level usage. */ btOptimizedBvh(long cPtr, boolean cMemoryOwn)27 public btOptimizedBvh(long cPtr, boolean cMemoryOwn) { 28 this("btOptimizedBvh", cPtr, cMemoryOwn); 29 construct(); 30 } 31 32 @Override reset(long cPtr, boolean cMemoryOwn)33 protected void reset(long cPtr, boolean cMemoryOwn) { 34 if (!destroyed) 35 destroy(); 36 super.reset(CollisionJNI.btOptimizedBvh_SWIGUpcast(swigCPtr = cPtr), cMemoryOwn); 37 } 38 getCPtr(btOptimizedBvh obj)39 public static long getCPtr(btOptimizedBvh obj) { 40 return (obj == null) ? 0 : obj.swigCPtr; 41 } 42 43 @Override finalize()44 protected void finalize() throws Throwable { 45 if (!destroyed) 46 destroy(); 47 super.finalize(); 48 } 49 delete()50 @Override protected synchronized void delete() { 51 if (swigCPtr != 0) { 52 if (swigCMemOwn) { 53 swigCMemOwn = false; 54 CollisionJNI.delete_btOptimizedBvh(swigCPtr); 55 } 56 swigCPtr = 0; 57 } 58 super.delete(); 59 } 60 btOptimizedBvh()61 public btOptimizedBvh() { 62 this(CollisionJNI.new_btOptimizedBvh(), true); 63 } 64 build(btStridingMeshInterface triangles, boolean useQuantizedAabbCompression, Vector3 bvhAabbMin, Vector3 bvhAabbMax)65 public void build(btStridingMeshInterface triangles, boolean useQuantizedAabbCompression, Vector3 bvhAabbMin, Vector3 bvhAabbMax) { 66 CollisionJNI.btOptimizedBvh_build(swigCPtr, this, btStridingMeshInterface.getCPtr(triangles), triangles, useQuantizedAabbCompression, bvhAabbMin, bvhAabbMax); 67 } 68 refit(btStridingMeshInterface triangles, Vector3 aabbMin, Vector3 aabbMax)69 public void refit(btStridingMeshInterface triangles, Vector3 aabbMin, Vector3 aabbMax) { 70 CollisionJNI.btOptimizedBvh_refit(swigCPtr, this, btStridingMeshInterface.getCPtr(triangles), triangles, aabbMin, aabbMax); 71 } 72 refitPartial(btStridingMeshInterface triangles, Vector3 aabbMin, Vector3 aabbMax)73 public void refitPartial(btStridingMeshInterface triangles, Vector3 aabbMin, Vector3 aabbMax) { 74 CollisionJNI.btOptimizedBvh_refitPartial(swigCPtr, this, btStridingMeshInterface.getCPtr(triangles), triangles, aabbMin, aabbMax); 75 } 76 updateBvhNodes(btStridingMeshInterface meshInterface, int firstNode, int endNode, int index)77 public void updateBvhNodes(btStridingMeshInterface meshInterface, int firstNode, int endNode, int index) { 78 CollisionJNI.btOptimizedBvh_updateBvhNodes(swigCPtr, this, btStridingMeshInterface.getCPtr(meshInterface), meshInterface, firstNode, endNode, index); 79 } 80 serializeInPlace(long o_alignedDataBuffer, long i_dataBufferSize, boolean i_swapEndian)81 public boolean serializeInPlace(long o_alignedDataBuffer, long i_dataBufferSize, boolean i_swapEndian) { 82 return CollisionJNI.btOptimizedBvh_serializeInPlace(swigCPtr, this, o_alignedDataBuffer, i_dataBufferSize, i_swapEndian); 83 } 84 deSerializeInPlace(long i_alignedDataBuffer, long i_dataBufferSize, boolean i_swapEndian)85 public static btOptimizedBvh deSerializeInPlace(long i_alignedDataBuffer, long i_dataBufferSize, boolean i_swapEndian) { 86 long cPtr = CollisionJNI.btOptimizedBvh_deSerializeInPlace(i_alignedDataBuffer, i_dataBufferSize, i_swapEndian); 87 return (cPtr == 0) ? null : new btOptimizedBvh(cPtr, false); 88 } 89 90 } 91