return Rotation.rotate(yawSymmetric ? Yaw.NONE : rot.getYaw(), pitchSymmetric ? Pitch.NONE : rot.getPitch(), rollSymmetric ? Roll.NONE : rot.getRoll());
}
private CollisionShape rotate(CollisionShape shape, Quat4f rot) {
if (shape instanceof BoxShape) {
BoxShape box = (BoxShape) shape;
Vector3f extents = box.getHalfExtentsWithMargin(new Vector3f());
QuaternionUtil.quatRotate(rot, extents, extents);
extents.absolute();
return new BoxShape(extents);
} else if (shape instanceof CompoundShape) {
CompoundShape compound = (CompoundShape) shape;
CompoundShape newShape = new CompoundShape();
for (CompoundShapeChild child : compound.getChildList()) {
CollisionShape rotatedChild = rotate(child.childShape, rot);