1 %module btManifoldPoint 2 3 %typemap(javadirectorin) btManifoldPoint, const btManifoldPoint, const btManifoldPoint &, btManifoldPoint & "btManifoldPoint.obtainForArgument($1, false)" 4 %typemap(javadirectorin) btManifoldPoint *, const btManifoldPoint *, btManifoldPoint * const & "btManifoldPoint.obtainForArgument($1, false)" 5 6 %typemap(javaout) btManifoldPoint *, const btManifoldPoint *, btManifoldPoint * const & { 7 return btManifoldPoint.obtainTemp($jnicall, $owner); 8 } 9 10 %typemap(javacode) btManifoldPoint %{ 11 private final static btManifoldPoint temp = new btManifoldPoint(0, false); 12 /** Obtains a temporary instance, used by native methods that return a btManifoldPoint instance */ 13 protected static btManifoldPoint obtainTemp(long cPtr, boolean own) { 14 temp.reset(cPtr, own); 15 return temp; 16 } 17 18 private static btManifoldPoint[] argumentInstances = new btManifoldPoint[] {new btManifoldPoint(0, false), 19 new btManifoldPoint(0, false), new btManifoldPoint(0, false), new btManifoldPoint(0, false)}; 20 private static int argumentIndex = -1; 21 /** Obtains a temporary instance, used for callback methods with one or more btManifoldPoint arguments */ 22 protected static btManifoldPoint obtainForArgument(final long swigCPtr, boolean owner) { 23 btManifoldPoint instance = argumentInstances[argumentIndex = (argumentIndex + 1) & 3]; 24 instance.reset(swigCPtr, owner); 25 return instance; 26 } 27 %} 28 29 %ignore btManifoldPoint::m_localPointA; 30 %ignore btManifoldPoint::m_localPointB; 31 %ignore btManifoldPoint::m_positionWorldOnA; 32 %ignore btManifoldPoint::m_positionWorldOnB; 33 %ignore btManifoldPoint::m_normalWorldOnB; 34 %ignore btManifoldPoint::m_lateralFrictionDir1; 35 %ignore btManifoldPoint::m_lateralFrictionDir2; 36 %ignore btManifoldPoint::getPositionWorldOnA() const; 37 %ignore btManifoldPoint::getPositionWorldOnB() const; 38 //%rename(internalGetPositionWorldOnA) btManifoldPoint::getPositionWorldOnA() const; 39 //%rename(internalGetPositionWorldOnB) btManifoldPoint::getPositionWorldOnB() const; 40 41 %{ 42 #include <BulletCollision/NarrowPhaseCollision/btManifoldPoint.h> 43 %} 44 %include "BulletCollision/NarrowPhaseCollision/btManifoldPoint.h" 45 46 %extend btManifoldPoint { 47 int getUserValue() { 48 int result; 49 *(const void **)&result = $self->m_userPersistentData; 50 return result; 51 } 52 53 void setUserValue(int value) { 54 $self->m_userPersistentData = (void*)value; 55 } 56 57 void getLocalPointA(btVector3 &out) { 58 out = $self->m_localPointA; 59 } 60 61 void setLocalPointA(const btVector3 &value) { 62 $self->m_localPointA = value; 63 } 64 65 void getLocalPointB(btVector3 &out) { 66 out = $self->m_localPointB; 67 } 68 69 void setLocalPointB(const btVector3 &value) { 70 $self->m_localPointB = value; 71 } 72 73 void getPositionWorldOnA(btVector3 &out) { 74 out = $self->m_positionWorldOnA; 75 } 76 77 void setPositionWorldOnA(const btVector3 &value) { 78 $self->m_positionWorldOnA = value; 79 } 80 81 void getPositionWorldOnB(btVector3 &out) { 82 out = $self->m_positionWorldOnB; 83 } 84 85 void setPositionWorldOnB(const btVector3 &value) { 86 $self->m_positionWorldOnB = value; 87 } 88 89 void getNormalWorldOnB(btVector3 &out) { 90 out = $self->m_normalWorldOnB; 91 } 92 93 void setNormalWorldOnB(const btVector3 &value) { 94 $self->m_normalWorldOnB = value; 95 } 96 97 void getLateralFrictionDir1(btVector3 &out) { 98 out = $self->m_lateralFrictionDir1; 99 } 100 101 void setLateralFrictionDir1(const btVector3 &value) { 102 $self->m_lateralFrictionDir1 = value; 103 } 104 105 void getLateralFrictionDir2(btVector3 &out) { 106 out = $self->m_lateralFrictionDir2; 107 } 108 109 void setLateralFrictionDir2(const btVector3 &value) { 110 $self->m_lateralFrictionDir2 = value; 111 } 112 };