/** * Set this transform to have zero translation */ public final void zeroTranslation() { setTranslation(0, 0, 0); }
@Override protected void updateTransformToParent(RigidBodyTransform transformToParent) { transformToParent.setRotationYawAndZeroTranslation(rotation); transformToParent.setTranslation(translation); }
public static RigidBodyTransform createTranslationTransform(Vector3d translation) { RigidBodyTransform transform = new RigidBodyTransform(); transform.setTranslation(translation); return transform; }
/** * Set this transform to have translation described in translation and a rotation equal to the * Matrix3f matrix. * * @param matrix */ public final void set(Matrix3f matrix, Tuple3f translation) { setRotation(matrix); setTranslation(translation); }
/** * Set this transform to have zero translation and a rotation equal to the * Matrix3d matrix. * * @param matrix */ public final void setRotationAndZeroTranslation(Matrix3d matrix) { setRotation(matrix); setTranslation(0, 0, 0); }
/** * Set this transform to have translation described in vector and a rotation * equal to the Quat4d quat. * * @param quat */ public final void set(Quat4d quat, Tuple3d translation) { setRotation(quat); setTranslation(translation); }
/** * Sets this transform to have rotation described by axisAngle and zero * translation. * * @param axisAngle */ public final void setRotationAndZeroTranslation(AxisAngle4f axisAngle) { setRotation(axisAngle); setTranslation(0, 0, 0); }
/** * Set this transform to have zero translation and a rotation equal to the * Quat4d quat. * * @param quat */ public final void setRotationAndZeroTranslation(Quat4d quat) { setRotation(quat); setTranslation(0, 0, 0); }
/** * Set this transform to have translation described in translation and a rotation * equal to the Quat4f quat. * * @param quat */ public final void set(Quat4f quat, Tuple3f translation) { setRotation(quat); setTranslation(translation); }
public void translateThenRotateEuler(Vector3d translationVector, Vector3d eulerAngles) { tempTransform.setRotationEulerAndZeroTranslation(eulerAngles); tempTransform.setTranslation(translationVector); transform.multiply(transform, tempTransform); }
public static RigidBodyTransform createTransformFromTranslationAndEulerAngles(Vector3d translation, Vector3d eulerAngles) { RigidBodyTransform transform = new RigidBodyTransform(); transform.setRotationEulerAndZeroTranslation(eulerAngles); transform.setTranslation(translation); return transform; }
/** * Set translational portion of the transformation matrix * * @param vec3d */ public final void setTranslation(Tuple3f translation) { setTranslation(translation.getX(), translation.getY(), translation.getZ()); }
/** * Set translational portion of the transformation matrix * * @param translation */ public final void setTranslation(Tuple3d translation) { setTranslation(translation.getX(), translation.getY(), translation.getZ()); }
/** * Set this transform to have translation described in vector * and a rotation equal to the Matrix3d matrix. * * @param matrix */ public final void set(Matrix3d matrix, Tuple3d translation) { setRotation(matrix); setTranslation(translation.getX(), translation.getY(), translation.getZ()); }
public static RigidBodyTransform generateRandomTransform(Random random) { RigidBodyTransform ret = new RigidBodyTransform(); ret.setRotationAndZeroTranslation(RandomTools.generateRandomRotation(random)); ret.setTranslation(RandomTools.generateRandomVector(random)); return ret; }
@Override protected void updateTransformToParent(RigidBodyTransform transformToParent) { centerOfMassCalculator.compute(); centerOfMassCalculator.getCenterOfMass(centerOfMass); centerOfMassVector3d.set(centerOfMass.getPoint()); transformToParent.setIdentity(); transformToParent.setTranslation(centerOfMassVector3d); }
public static Affine createAffineFromQuaternionAndTuple(Quat4d quaternion, Tuple3d translation) { RigidBodyTransform transform = new RigidBodyTransform(); transform.setRotation(quaternion); transform.setTranslation(translation.getX(), translation.getY(), translation.getZ()); return convertRigidBodyTransformToAffine(transform); }
@Override protected void updateTransformToParent(RigidBodyTransform transformToParent) { yoFramePose.getOrientation().getQuaternion(rotation); transformToParent.setRotation(rotation); YoFramePoint yoFramePoint = yoFramePose.getPosition(); transformToParent.setTranslation(yoFramePoint.getX(), yoFramePoint.getY(), yoFramePoint.getZ()); }
private static void setUpSlopedBox(CombinedTerrainObject3D combinedTerrainObject, double xCenter, double yCenter, double zCenter, double xLength, double yLength, double zLength, double slopeRadians, double yawDegrees, AppearanceDefinition app) { RigidBodyTransform location = new RigidBodyTransform(); location.setRotationYawAndZeroTranslation(Math.toRadians(yawDegrees)); RigidBodyTransform tilt = new RigidBodyTransform(); tilt.setRotationPitchAndZeroTranslation(-slopeRadians); location.multiply(tilt); location.setTranslation(new Vector3d(xCenter, yCenter, zCenter)); RotatableBoxTerrainObject newBox = new RotatableBoxTerrainObject(new Box3d(location, xLength, yLength, zLength), app); combinedTerrainObject.addTerrainObject(newBox); }
public void getPose(RigidBodyTransform pose) { pose.setRotationWithQuaternion(qx.getDoubleValue(), qy.getDoubleValue(), qz.getDoubleValue(), qw.getDoubleValue()); pose.setTranslation(xPos.getDoubleValue(), yPos.getDoubleValue(), zPos.getDoubleValue()); } }