Skip to content

Commit

Permalink
...and that's cross-portal collision
Browse files Browse the repository at this point in the history
  • Loading branch information
Gaming32 committed Jul 10, 2023
1 parent 7bc3fd1 commit e319421
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ private VoxelShape calculateCrossPortalCollisionShape(Vec3 normal, Vec3 origin,
final Vec3 scaledNormalOffset = getNormal().scale(SURFACE_OFFSET);
if (facing != getFacingDirection().getOpposite()) {
result = result.move(-origin.x, -origin.y, -origin.z);
final IPQuaternion transform = getTransformQuat().hamiltonProduct(FLIP_AXIS_W);
final IPQuaternion transform = getTransformQuat().getConjugated();
final MutableObject<VoxelShape> rotatedShape = new MutableObject<>(Shapes.empty());
result.forAllBoxes((x1, y1, z1, x2, y2, z2) -> {
final Vec3 minT = transform.rotate(new Vec3(x1, y1, z1), false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,7 @@ public static void setupPortalShapes(Entity entity) {
for (Portal portal : list) {
if (portal.calculateCutoutBox() != NULL_BOX && portal.calculateBoundsCheckBox() != NULL_BOX && portal.getActive()) {
cutoutShape = Shapes.or(cutoutShape, Shapes.create(portal.getCutoutBoundingBox()));
// TODO: Uncomment for testing or when it's working fully
// crossPortalCollisionShape = Shapes.or(crossPortalCollisionShape, portal.getCrossPortalCollisionShapeOther(entity));
crossPortalCollisionShape = Shapes.or(crossPortalCollisionShape, portal.getCrossPortalCollisionShapeOther(entity));
}
}

Expand Down

0 comments on commit e319421

Please sign in to comment.