Vector3f offset = QuaternionUtil.quatRotate(rot, child.transform.origin, new Vector3f());
newShape.addChildShape(new Transform(new Matrix4f(Rotation.none().getQuat4f(), offset, 1.0f)), rotatedChild);
}
return newShape;
} else if (shape instanceof ConvexHullShape) {
ConvexHullShape convexHull = (ConvexHullShape) shape;
ObjectArrayList<Vector3f> transformedVerts = new ObjectArrayList<>();
for (Vector3f vert : convexHull.getPoints()) {
transformedVerts.add(QuaternionUtil.quatRotate(rot, vert, new Vector3f()));
}
return new ConvexHullShape(transformedVerts);
}
return shape;
}