def startOfStep(): assert rigidbody3d.numStaticPlanes() == 1 t0 = 5.0; t = rigidbody3d.nextIteration() * rigidbody3d.timestep() if t >= t0: rigidbody3d.setStaticPlanePosition( 0, 0.0, math.sin( 2.0 * math.pi * ( t - t0 ) ), 0.0 ) rigidbody3d.setStaticPlaneVelocity( 0, 0.0, 2.0 * math.pi * math.cos( 2.0 * math.pi * ( t - t0 ) ), 0.0 )
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.numStaticPlanes() == 1 t0 = 5.0 t = rigidbody3d.nextIteration() * rigidbody3d.timestep() if t >= t0: rigidbody3d.setStaticPlanePosition(0, 0.0, math.sin(2.0 * math.pi * (t - t0)), 0.0) rigidbody3d.setStaticPlaneVelocity( 0, 0.0, 2.0 * math.pi * math.cos(2.0 * math.pi * (t - t0)), 0.0)
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)
def startOfStep(): assert rigidbody3d.numStaticPlanes() == 1 t0 = 5.0 t1 = 20.0 t = rigidbody3d.nextIteration() * rigidbody3d.timestep() if t >= t0 and t < t1: xpos = 1.0 - math.cos(math.pi * (t - t0)) ypos = 0.0 zpos = math.sin(2.0 * math.pi * (t - t0)) rigidbody3d.setStaticPlanePosition(0, xpos, ypos, zpos) vx = math.pi * math.sin(math.pi * (t - t0)) vy = 0.0 vz = 2.0 * math.pi * math.cos(2.0 * math.pi * (t - t0)) rigidbody3d.setStaticPlaneVelocity(0, vx, vy, vz) elif t >= t1: xpos = 1.0 - math.cos(math.pi * (t - t0)) ypos = math.sin(math.pi * (t - t1)) zpos = math.sin(2.0 * math.pi * (t - t0)) rigidbody3d.setStaticPlanePosition(0, xpos, ypos, zpos) vx = math.pi * math.sin(math.pi * (t - t0)) vy = math.pi * math.cos(math.pi * (t - t1)) vz = 2.0 * math.pi * math.cos(2.0 * math.pi * (t - t0)) rigidbody3d.setStaticPlaneVelocity(0, vx, vy, vz)
def startOfStep(): assert rigidbody3d.numStaticPlanes() == 1 t0 = 5.0 t1 = 20.0 t = rigidbody3d.nextIteration() * rigidbody3d.timestep() if t >= t0 and t < t1: xpos = 1.0 - math.cos( math.pi * ( t - t0 ) ) ypos = 0.0 zpos = math.sin( 2.0 * math.pi * ( t - t0 ) ) rigidbody3d.setStaticPlanePosition( 0, xpos, ypos, zpos ) vx = math.pi * math.sin( math.pi * ( t - t0 ) ) vy = 0.0 vz = 2.0 * math.pi * math.cos( 2.0 * math.pi * ( t - t0 ) ) rigidbody3d.setStaticPlaneVelocity( 0, vx, vy, vz ) elif t >= t1: xpos = 1.0 - math.cos( math.pi * ( t - t0 ) ) ypos = math.sin( math.pi * ( t - t1 ) ) zpos = math.sin( 2.0 * math.pi * ( t - t0 ) ) rigidbody3d.setStaticPlanePosition( 0, xpos, ypos, zpos ) vx = math.pi * math.sin( math.pi * ( t - t0 ) ) vy = math.pi * math.cos( math.pi * ( t - t1 ) ) vz = 2.0 * math.pi * math.cos( 2.0 * math.pi * ( t - t0 ) ) rigidbody3d.setStaticPlaneVelocity( 0, vx, vy, vz )