/** * Builds a new implementation of {@code SphericalJointBasics}. * * @param name the joint name. * @param predecessor the predecessor of the joint. * @param transformToParent the transform to the frame after the parent joint. * @return the new spherical joint. */ default SphericalJointBasics buildSphericalJoint(String name, RigidBodyBasics predecessor, RigidBodyTransform transformToParent) { return new SphericalJoint(name, predecessor, transformToParent); }
/** * Generates a 3-DoF spherical joint with random physical parameters and attaches it to the given * {@code predecessor}. * * @param random the random generator to use. * @param name the joint name. * @param predecessor the rigid-body to which the joint is added as a child. * @return the random joint. */ public static SphericalJoint nextSphericalJoint(Random random, String name, RigidBodyBasics predecessor) { RigidBodyTransform transformToParent = predecessor.isRootBody() ? null : EuclidCoreRandomTools.nextRigidBodyTransform(random); return new SphericalJoint(name, predecessor, transformToParent); }