float back_wheel_h = (wheelRadius * 1.7f) - 1f; float front_wheel_h = (wheelRadius * 1.9f) - 1f; player.addWheel(wheel_fr.getParent(), box.getCenter().add(0, -front_wheel_h, 0), wheelDirection, wheelAxle, 0.2f, wheelRadius, true); wheel_fl.center(); box = (BoundingBox) wheel_fl.getModelBound(); player.addWheel(wheel_fl.getParent(), box.getCenter().add(0, -front_wheel_h, 0), wheelDirection, wheelAxle, 0.2f, wheelRadius, true); wheel_br.center(); box = (BoundingBox) wheel_br.getModelBound(); player.addWheel(wheel_br.getParent(), box.getCenter().add(0, -back_wheel_h, 0), wheelDirection, wheelAxle, 0.2f, wheelRadius, false); wheel_bl.center(); box = (BoundingBox) wheel_bl.getModelBound(); player.addWheel(wheel_bl.getParent(), box.getCenter().add(0, -back_wheel_h, 0), wheelDirection, wheelAxle, 0.2f, wheelRadius, false);
wheels1.rotate(0, FastMath.HALF_PI, 0); wheels1.setMaterial(mat); vehicle.addWheel(node1, new Vector3f(-xOff, yOff, zOff), wheelDirection, wheelAxle, restLength, radius, true); wheels2.rotate(0, FastMath.HALF_PI, 0); wheels2.setMaterial(mat); vehicle.addWheel(node2, new Vector3f(xOff, yOff, zOff), wheelDirection, wheelAxle, restLength, radius, true); wheels3.rotate(0, FastMath.HALF_PI, 0); wheels3.setMaterial(mat); vehicle.addWheel(node3, new Vector3f(-xOff, yOff, -zOff), wheelDirection, wheelAxle, restLength, radius, false); wheels4.rotate(0, FastMath.HALF_PI, 0); wheels4.setMaterial(mat); vehicle.addWheel(node4, new Vector3f(xOff, yOff, -zOff), wheelDirection, wheelAxle, restLength, radius, false);
VehicleWheel newWheel = control.addWheel(wheel.getLocation(), wheel.getDirection(), wheel.getAxle(), wheel.getRestLength(), wheel.getRadius(), wheel.isFrontWheel()); newWheel.setFrictionSlip(wheel.getFrictionSlip()); newWheel.setMaxSuspensionTravelCm(wheel.getMaxSuspensionTravelCm());
VehicleWheel newWheel = control.addWheel(wheel.getLocation(), wheel.getDirection(), wheel.getAxle(), wheel.getRestLength(), wheel.getRadius(), wheel.isFrontWheel()); newWheel.setFrictionSlip(wheel.getFrictionSlip()); newWheel.setMaxSuspensionTravelCm(wheel.getMaxSuspensionTravelCm());
wheels1.rotate(0, FastMath.HALF_PI, 0); wheels1.setMaterial(mat); vehicle.addWheel(node1, new Vector3f(-xOff, yOff, zOff), wheelDirection, wheelAxle, restLength, radius, true); wheels2.rotate(0, FastMath.HALF_PI, 0); wheels2.setMaterial(mat); vehicle.addWheel(node2, new Vector3f(xOff, yOff, zOff), wheelDirection, wheelAxle, restLength, radius, true); wheels3.rotate(0, FastMath.HALF_PI, 0); wheels3.setMaterial(mat); vehicle.addWheel(node3, new Vector3f(-xOff, yOff, -zOff), wheelDirection, wheelAxle, restLength, radius, false); wheels4.rotate(0, FastMath.HALF_PI, 0); wheels4.setMaterial(mat); vehicle.addWheel(node4, new Vector3f(xOff, yOff, -zOff), wheelDirection, wheelAxle, restLength, radius, false);
VehicleWheel newWheel = control.addWheel(wheel.getLocation(), wheel.getDirection(), wheel.getAxle(), wheel.getRestLength(), wheel.getRadius(), wheel.isFrontWheel()); newWheel.setFrictionSlip(wheel.getFrictionSlip()); newWheel.setMaxSuspensionTravelCm(wheel.getMaxSuspensionTravelCm());
VehicleWheel newWheel = control.addWheel(wheel.getLocation(), wheel.getDirection(), wheel.getAxle(), wheel.getRestLength(), wheel.getRadius(), wheel.isFrontWheel()); newWheel.setFrictionSlip(wheel.getFrictionSlip()); newWheel.setMaxSuspensionTravelCm(wheel.getMaxSuspensionTravelCm());
VehicleWheel newWheel = control.addWheel(wheel.getLocation(), wheel.getDirection(), wheel.getAxle(), wheel.getRestLength(), wheel.getRadius(), wheel.isFrontWheel()); newWheel.setFrictionSlip(wheel.getFrictionSlip()); newWheel.setMaxSuspensionTravelCm(wheel.getMaxSuspensionTravelCm());
VehicleWheel newWheel = control.addWheel(wheel.getLocation(), wheel.getDirection(), wheel.getAxle(), wheel.getRestLength(), wheel.getRadius(), wheel.isFrontWheel()); newWheel.setFrictionSlip(wheel.getFrictionSlip()); newWheel.setMaxSuspensionTravelCm(wheel.getMaxSuspensionTravelCm());
VehicleWheel newWheel = control.addWheel(wheel.getLocation(), wheel.getDirection(), wheel.getAxle(), wheel.getRestLength(), wheel.getRadius(), wheel.isFrontWheel()); newWheel.setFrictionSlip(wheel.getFrictionSlip()); newWheel.setMaxSuspensionTravelCm(wheel.getMaxSuspensionTravelCm());