This commit is contained in:
lvfulong
2021-03-22 19:32:28 +08:00
parent e32ab4cd9f
commit 1f6af9ab2a
30 changed files with 137 additions and 54 deletions
@@ -646,6 +646,13 @@ pointer_t WASM_EXP AllConvexResultCallback_get_m_collisionObjects(pointer_t ptr)
}
//btCollisionShape
int WASM_EXP btCollisionShape_getShapeType(pointer_t ptr)
{
btCollisionShape *shape = (btCollisionShape *)ptr;
return shape->getShapeType();
}
pointer_t WASM_EXP btCollisionShape_getLocalScaling(pointer_t ptr)
{
btCollisionShape *shape = (btCollisionShape *)ptr;
@@ -676,7 +683,18 @@ pointer_t WASM_EXP btBoxShape_create(pointer_t boxHalfExtents)
return (pointer_t) new btBoxShape(*(btVector3 *)boxHalfExtents);
}
void WASM_EXP btBoxShape_getAabb(pointer_t ptr, pointer_t t, pointer_t aabbMin, pointer_t aabbMax)
{
btBoxShape *shape = (btBoxShape *)ptr;
shape->getAabb(*(btTransform *)t, *(btVector3 *)aabbMin, *(btVector3 *)aabbMax);
}
pointer_t WASM_EXP btBoxShape_getHalfExtentsWithMargin(pointer_t ptr, pointer_t t, pointer_t aabbMin, pointer_t aabbMax)
{
btBoxShape *shape = (btBoxShape *)ptr;
tempbtVector3 = shape->getHalfExtentsWithMargin();
return (pointer_t)&tempbtVector3;
}
//btCapsuleShape
pointer_t WASM_EXP btCapsuleShape_create(btScalar radius, btScalar height)
@@ -1256,6 +1274,18 @@ void WASM_EXP btKinematicCharacterController_setStepHeight(pointer_t ptr, btScal
character->setStepHeight(h);
}
void WASM_EXP btKinematicCharacterController_setMaxPenetrationDepth(pointer_t ptr, btScalar d)
{
btKinematicCharacterController *character = (btKinematicCharacterController *)ptr;
character->setMaxPenetrationDepth(d);
}
btScalar WASM_EXP btKinematicCharacterController_getMaxPenetrationDepth(pointer_t ptr)
{
btKinematicCharacterController *character = (btKinematicCharacterController *)ptr;
return character->getMaxPenetrationDepth();
}
void WASM_EXP btKinematicCharacterController_destroy(pointer_t ptr)
{
btKinematicCharacterController *character = (btKinematicCharacterController *)ptr;
@@ -154,11 +154,15 @@ namespace laya
pointer_t AllConvexResultCallback_get_m_hitPointWorld(pointer_t ptr);
pointer_t AllConvexResultCallback_get_m_hitFractions(pointer_t ptr);
pointer_t AllConvexResultCallback_get_m_collisionObjects(pointer_t ptr);
int btCollisionShape_getShapeType(pointer_t ptr);
pointer_t btCollisionShape_getLocalScaling(pointer_t ptr);
void btCollisionShape_setLocalScaling(pointer_t ptr, pointer_t scaling);
void btCollisionShape_calculateLocalInertia(pointer_t ptr, btScalar mass, pointer_t inertia);
void btCollisionShape_destroy(pointer_t ptr);
pointer_t btBoxShape_create(pointer_t boxHalfExtents);
void btBoxShape_getAabb(pointer_t ptr, pointer_t t, pointer_t aabbMin, pointer_t aabbMax);
pointer_t btBoxShape_getHalfExtentsWithMargin(pointer_t ptr, pointer_t t, pointer_t aabbMin, pointer_t aabbMax);
pointer_t btCapsuleShape_create(btScalar radius, btScalar height);
pointer_t btCapsuleShapeX_create(btScalar radius, btScalar height);
pointer_t btCapsuleShapeZ_create(btScalar radius, btScalar height);
@@ -220,6 +224,8 @@ namespace laya
void btRigidBody_setGravity(pointer_t ptr, pointer_t acceleration);
void btKinematicCharacterController_setUp(pointer_t ptr, pointer_t up);
void btKinematicCharacterController_setStepHeight(pointer_t ptr, btScalar h);
void btKinematicCharacterController_setMaxPenetrationDepth(pointer_t ptr, btScalar d);
btScalar btKinematicCharacterController_getMaxPenetrationDepth(pointer_t ptr);
void btCollisionObject_setInterpolationWorldTransform(pointer_t ptr, pointer_t worldTrans);
void btCollisionObject_setWorldTransform(pointer_t ptr, pointer_t worldTrans);
pointer_t btRigidBody_getTotalForce(pointer_t ptr);