//User-defined procedures
static void shoot (float myState[12], float target[3], unsigned int fire)
{
//BEGIN::PROC::shoot
float direction[3];

mathVecSubtract(direction, target, myState, 3);
mathVecNormalize(direction, 3);

ZRSetAttitudeTarget(direction);

if (fire && (acos(mathVecInner(&myState[6], direction, 3) / mathVecMagnitude(&myState[6], 3)) < (0.1)))
    Plaser();
//END::PROC::shoot
}
Exemple #2
0
static void meltIce (float state[12], float other[12], float time)
{
//BEGIN::PROC::meltIce
/*
 * meltIce melts the
 * ice sheet on Opulens
 * (no shit!)
 */
float x[3]={0,-0.35,-0.2};
if (PiceHits()+PotherIceHits()>18 || time<47) {
	revolve (x,state,other);
}
else {
	ZRSetPositionTarget (state);
	mathVecSubtract(x,x,state,3);
	ZRSetAttitudeTarget(x);
	
}
if (time>59)
	Plaser();
//END::PROC::meltIce
}