protected void gimpacttrimeshpart_vs_plane_collision(CollisionObject body0, CollisionObject body1, GImpactMeshShapePart shape0, StaticPlaneShape shape1, boolean swapped) {
Transform orgtrans0 = body0.getWorldTransform(Stack.alloc(Transform.class));
Transform orgtrans1 = body1.getWorldTransform(Stack.alloc(Transform.class));
StaticPlaneShape planeshape = shape1;
Vector4f plane = Stack.alloc(Vector4f.class);
PlaneShape.get_plane_equation_transformed(planeshape, orgtrans1, plane);
// test box against plane
AABB tribox = Stack.alloc(AABB.class);
shape0.getAabb(orgtrans0, tribox.min, tribox.max);
tribox.increment_margin(planeshape.getMargin());
if (tribox.plane_classify(plane) != PlaneIntersectionType.COLLIDE_PLANE) {
return;
}
shape0.lockChildShapes();
float margin = shape0.getMargin() + planeshape.getMargin();
Vector3f vertex = Stack.alloc(Vector3f.class);
Vector3f tmp = Stack.alloc(Vector3f.class);