Esempio n. 1
0
void Tank::deathEffects(){
	Teline3List *tell = w->getTeline3d();

	Vec3d gravity = w->accel(this->pos, this->velo);
	if(tell){
		int j;
		for(j = 0; j < 20; j++){
			Vec3d velo(
				150. * (w->rs.nextd() - .5),
				150. * (w->rs.nextd() - .5),
				150. * (w->rs.nextd() - .5));
			AddTeline3D(tell, this->pos, velo, .0025, quat_u, vec3_000, gravity,
				j % 2 ? COLOR32RGBA(255,255,255,255) : COLOR32RGBA(255,191,63,255), TEL3_HEADFORWARD | TEL3_FADEEND | TEL3_REFLECT, 1. + .5 * w->rs.nextd());
		}
/*			for(j = 0; j < 10; j++){
			double velo[3];
			velo[0] = .025 * (drseq(&gsrs) - .5);
			velo[1] = .025 * (drseq(&gsrs));
			velo[2] = .025 * (drseq(&gsrs) - .5);
			AddTefpol3D(w->tepl, pt->pos, velo, gravity, &cs_firetrail,
				TEP3_REFLECT | TEP_THICK | TEP_ROUGH, 3. + 1.5 * drseq(&gsrs));
		}*/

		{/* explode shockwave thingie */
			AddTeline3D(tell, this->pos, vec3_000, 100., Quatd::rotation(M_PI * 0.5, 1, 0, 0), vec3_000, vec3_000, COLOR32RGBA(255,191,63,255), TEL3_EXPANDISK/*/TEL3_EXPANDTORUS*/ | TEL3_NOLINE, 1.);
#if 0 // Scorch mark should be rendered in ground's rendering pass.
			if(pt->pos[1] <= 0.) /* no scorch in midair */
				AddTeline3D(tell, pt->pos, NULL, .01, pyr, NULL, NULL, COLOR32RGBA(0,0,0,255), TEL3_STATICDISK | TEL3_NOLINE, 20.);
#endif
		}

		WarSpace *ws = *w;
		if(ws->gibs && model){
			int m = model->n;
			int n = m <= TANK_MAX_GIBS ? m : TANK_MAX_GIBS;
			int base = m <= TANK_MAX_GIBS ? 0 : w->rs.next() % m;
			for(int i = 0; i < n; i++){
				j = (base + i) % m;
				Vec3d velo(
					this->velo[0] + (w->rs.nextd() - .5) * 100.,
					this->velo[1] + (w->rs.nextd() - .5) * 100.,
					this->velo[2] + (w->rs.nextd() - .5) * 100.);
				Vec3d omg(
					3. * 2 * M_PI * (w->rs.nextd() - .5),
					3. * 2 * M_PI * (w->rs.nextd() - .5),
					3. * 2 * M_PI * (w->rs.nextd() - .5));
				AddTelineCallback3D(ws->gibs, this->pos, velo, 10., quat_u, omg, gravity, gib_draw, (void*)j, TEL3_NOLINE | TEL3_REFLECT, 1.5 + w->rs.nextd());
			}
		}
	}
}
Esempio n. 2
0
void			resolve(t_list *list, int ant)
{
	int			value;
	t_list		*l;

	l = list;
	value = 1;
	init_dist(list);
	valid_start(list);
	((t_salle*)list->content)->dist = 0;
	give_value((t_salle*)list->content);
	while (l != NULL)
	{
		if (((t_salle *)l->content)->name[0] == 'L')
			ft_error();
		l = l->next;
	}
	if (ant <= 0)
		ft_error();
	omg(list, value, ant);
}
void dNewtonBody::SetOmega(dFloat x, dFloat y, dFloat z)
{
	dVector omg(x, y, z);
	NewtonBodySetOmega(m_body, &omg.m_x);
}