public void fire_Moving_Cube(XYZ_d position, XYZ size, double speed) { XYZ_d delta = new XYZ_d(rayDelta).Mul(speed); XYZ_d pointer = new XYZ_d(rayDelta).Mul(30).Add(position); Object c = new Cube(pointer, size); SetColor(c, 0, 255, 255); XYZ_d vector = new XYZ_d(-Camera.instance.GetCursorPos().y, 0, Camera.instance.GetCursorPos().x); Matrix mat = new Matrix(Spin_matrix_x) + new Matrix(Spin_matrix_z); SpinObject(c, vector, mat); DrawObject(c); mat = new Matrix(Spin_matrix_y) + new Matrix(Spin_matrix_x) + new Matrix(Spin_matrix_z); XYZ_d rotateDelta = new XYZ_d(0, 6, 0); Task.Factory.StartNew(() => { while (world.isIn(pointer)) { pointer.Add(delta); MoveObject(c, delta); vector.Add(rotateDelta); SpinObject(c, vector, mat); vector.Remain(360); Thread.Sleep(5); } DeleteObject(c); }); }
protected override void DoSomething() { modifier.SpinObject(obj, degree); modifier.MoveObject(obj, moveDelta); Thread.Sleep(10); degree.Add(rotateDelta); degree.Remain(360); }