#include "../h/rccl.h"

extern int completed;

pumatask()
{
	TRSF_PTR z, e, conv, tilt, or, fl;
	POS_PTR  pm1, pm2, pf;
	int convfn(), tiltfn();
	int i;

	conv = newtrans("CONV", convfn);
	tilt = newtrans("TILT", tiltfn);
	z = gentr_rot("Z",  0.,  0., 864., zunit, 0.); /* at the base */
	e = gentr_eul("E" , 0. , 0. , 170. , 0. , 0.,  0.);
	or = gentr_eul("OR", 000. ,  600., 700.,    0., 0., 90.);
	fl = gentr_rot("FL", 0. , 0., 0., yunit, 180.);

	pm1 = makeposition("PM1" , z, t6, e, EQ, tilt, or, conv, fl, TL, e);
	pm2 = makeposition("PM2" , z, t6, e, EQ, conv, or, tilt, fl, TL, e);
	pf = makeposition("PF" , z, t6, e, EQ, or, fl, TL, e);

	movecart(pf, 300, 1500);
	movecart(pm1, 300, 2600);
	movecart(pf, 300, 1500);
	movecart(pm2, 300, 2600);
	movecart(park, 300, 1500);
}



convfn(t)
TRSF_PTR t;
{
	double radius = 50.;
	t->p.y = radius * sin(2. * goalpos->scal * PIT2);
	t->p.z = radius * cos(2. * goalpos->scal * PIT2);
}


tiltfn(t)
TRSF_PTR t;
{
	VECT k;

	k.x = sin(1. * goalpos->scal * PIT2);
	k.y = cos(1. * goalpos->scal * PIT2);
	k.z = 0.;
	rot(t, &k, 10.);
}
