/** * @deprecated use {@link #setRotationRollAndZeroTranslation(double)} instead * @param angle */ public void rotX(double angle) { setRotationRollAndZeroTranslation(angle); }
/** * Add a rotation to the current transform. */ public final void applyRotationX(double angle) { RigidBodyTransform temp = new RigidBodyTransform(); temp.setRotationRollAndZeroTranslation(angle); multiply(temp); }
private void setupRotationTransforms(int i) { tempTransformFromCurrentToRotary.setIdentity(); tempTransformFromCurrentToRotary.setRotationRollAndZeroTranslation(indexToAngle(i)); tempInverseTransformFromCurrentToRotary.invert(tempTransformFromCurrentToRotary); }
public static void rotate(RigidBodyTransform transform, double angle, Axis axis) { RigidBodyTransform rotator = new RigidBodyTransform(); if (axis == Axis.X) { rotator.setRotationRollAndZeroTranslation(angle); } else if (axis == Axis.Y) { rotator.setRotationPitchAndZeroTranslation(angle); } else if (axis == Axis.Z) { rotator.setRotationYawAndZeroTranslation(angle); } transform.multiply(rotator); }
public TransformRayDemo() incrementalRotation.setRotationRollAndZeroTranslation(-Math.PI / 16); graphic.addCylinder(5.0, 0.2, YoAppearance.Red());
private static void setUpCinderBlockUpright(CombinedTerrainObject3D combinedTerrainObject, double xCenter, double yCenter, int numberFlatSupports, double yawDegrees) { if (numberFlatSupports < 0) return; AppearanceDefinition app = cinderBlockAppearance; // wall RigidBodyTransform location = new RigidBodyTransform(); RigidBodyTransform setUpright = new RigidBodyTransform(); location.setRotationYawAndZeroTranslation(Math.toRadians(yawDegrees)); setUpright.setRotationRollAndZeroTranslation(Math.toRadians(90)); location.multiply(setUpright); location.setTranslation(new Vector3d(xCenter, yCenter, cinderBlockWidth / 2 + numberFlatSupports * cinderBlockHeight)); RotatableCinderBlockTerrainObject newBox = new RotatableCinderBlockTerrainObject(new Box3d(location, cinderBlockLength, cinderBlockWidth, cinderBlockHeight), app); combinedTerrainObject.addTerrainObject(newBox); }
private static void setUpCinderBlockUpright(CombinedTerrainObject3D combinedTerrainObject, double xCenter, double yCenter, int numberFlatSupports, double yawDegrees) { if (numberFlatSupports < 0) return; AppearanceDefinition app = cinderBlockAppearance; // wall RigidBodyTransform location = new RigidBodyTransform(); RigidBodyTransform setUpright = new RigidBodyTransform(); location.setRotationYawAndZeroTranslation(Math.toRadians(yawDegrees)); setUpright.setRotationRollAndZeroTranslation(Math.toRadians(90)); location.multiply(setUpright); location.setTranslation(new Vector3d(xCenter, yCenter, cinderBlockWidth / 2 + numberFlatSupports * cinderBlockHeight)); RotatableCinderBlockTerrainObject newBox = new RotatableCinderBlockTerrainObject( new Box3d(location, cinderBlockLength, cinderBlockWidth, cinderBlockHeight), app); combinedTerrainObject.addTerrainObject(newBox); }
transform.setRotationRollAndZeroTranslation(-Math.PI / 2.0); System.out.println(transform); momentOfInertia = InertiaTools.rotate(transform, momentOfInertia);
if (ROTATE_IMU_FRAMES) imu1Offset.setRotationRollAndZeroTranslation(Math.PI / 7.0);