def startOfStep(): assert rigidbody3d.numStaticCylinders() == 1 t0 = 5.0 omega = 2.0 * math.pi t = rigidbody3d.nextIteration() * rigidbody3d.timestep() if t >= t0: theta = omega * ( t - t0 ) rigidbody3d.setStaticCylinderOrientation( 0, 0.0, 0.0, 1.0, theta ) rigidbody3d.setStaticCylinderAngularVelocity( 0, 0.0, 0.0, omega )
def startOfStep(): assert rigidbody3d.numStaticCylinders() == 1 t0 = 5.0 omega = 2.0 * math.pi t = rigidbody3d.nextIteration() * rigidbody3d.timestep() if t >= t0: theta = omega * ( t - t0 ) rotation0 = quaternion_about_axis( theta, numpy.array([0.0,0.0,1.0]) ) rotation1 = quaternion_from_two_vectors( numpy.array([0.0,1.0,0.0]), numpy.array([0.0,0.0,1.0]) ) rotation2 = quaternion_multiply( rotation0, rotation1 ) rigidbody3d.setStaticCylinderOrientation( 0, rotation2[0], rotation2[1], rotation2[2], rotation2[3] ) rigidbody3d.setStaticCylinderAngularVelocity( 0, 0.0, 0.0, omega )
def startOfStep(): assert rigidbody3d.numStaticCylinders() == 1 t0 = 5.0 omega = 2.0 * math.pi t = rigidbody3d.nextIteration() * rigidbody3d.timestep() if t >= t0: theta = omega * (t - t0) rotation0 = quaternion_about_axis(theta, numpy.array([0.0, 0.0, 1.0])) rotation1 = quaternion_from_two_vectors(numpy.array([0.0, 1.0, 0.0]), numpy.array([0.0, 0.0, 1.0])) rotation2 = quaternion_multiply(rotation0, rotation1) rigidbody3d.setStaticCylinderOrientation(0, rotation2[0], rotation2[1], rotation2[2], rotation2[3]) rigidbody3d.setStaticCylinderAngularVelocity(0, 0.0, 0.0, omega)