示例#1
0
文件: Wind.c 项目: couchjd/playground
static gboolean soy_fields_wind_real_exert (soyfieldsField* base, soybodiesBody* other) {
	soyfieldsWind * self;
	gboolean result = FALSE;
	soybodiesBody* _tmp0_ = NULL;
	GeeHashMap* _tmp1_ = NULL;
	GeeHashMap* _tmp2_ = NULL;
	GeeHashMap* _tmp3_ = NULL;
	gboolean _tmp4_ = FALSE;
	gboolean _tmp5_ = FALSE;
#line 38 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
	self = (soyfieldsWind*) base;
#line 38 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
	g_return_val_if_fail (other != NULL, FALSE);
#line 39 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
	_tmp0_ = other;
#line 39 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
	_tmp1_ = soy_bodies_body_get_tags (_tmp0_);
#line 39 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
	_tmp2_ = _tmp1_;
#line 39 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
	_tmp3_ = _tmp2_;
#line 39 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
	_tmp4_ = gee_abstract_map_has_key ((GeeAbstractMap*) _tmp3_, "cd");
#line 39 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
	_tmp5_ = _tmp4_;
#line 39 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
	_g_object_unref0 (_tmp3_);
#line 39 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
	if (_tmp5_) {
#line 223 "Wind.c"
		gfloat dx = 0.0F;
		soyatomsVector* _tmp6_ = NULL;
		soyatomsVector* _tmp7_ = NULL;
		soyatomsVector* _tmp8_ = NULL;
		gfloat _tmp9_ = 0.0F;
		gfloat _tmp10_ = 0.0F;
		soybodiesBody* _tmp11_ = NULL;
		soyatomsVector* _tmp12_ = NULL;
		soyatomsVector* _tmp13_ = NULL;
		soyatomsVector* _tmp14_ = NULL;
		gfloat _tmp15_ = 0.0F;
		gfloat _tmp16_ = 0.0F;
		gfloat _tmp17_ = 0.0F;
		gfloat dy = 0.0F;
		soyatomsVector* _tmp18_ = NULL;
		soyatomsVector* _tmp19_ = NULL;
		soyatomsVector* _tmp20_ = NULL;
		gfloat _tmp21_ = 0.0F;
		gfloat _tmp22_ = 0.0F;
		soybodiesBody* _tmp23_ = NULL;
		soyatomsVector* _tmp24_ = NULL;
		soyatomsVector* _tmp25_ = NULL;
		soyatomsVector* _tmp26_ = NULL;
		gfloat _tmp27_ = 0.0F;
		gfloat _tmp28_ = 0.0F;
		gfloat _tmp29_ = 0.0F;
		gfloat dz = 0.0F;
		soyatomsVector* _tmp30_ = NULL;
		soyatomsVector* _tmp31_ = NULL;
		soyatomsVector* _tmp32_ = NULL;
		gfloat _tmp33_ = 0.0F;
		gfloat _tmp34_ = 0.0F;
		soybodiesBody* _tmp35_ = NULL;
		soyatomsVector* _tmp36_ = NULL;
		soyatomsVector* _tmp37_ = NULL;
		soyatomsVector* _tmp38_ = NULL;
		gfloat _tmp39_ = 0.0F;
		gfloat _tmp40_ = 0.0F;
		gfloat _tmp41_ = 0.0F;
		gfloat d2 = 0.0F;
		gfloat _tmp42_ = 0.0F;
		gfloat _tmp43_ = 0.0F;
		gfloat _tmp44_ = 0.0F;
		gfloat _tmp45_ = 0.0F;
		gfloat _tmp46_ = 0.0F;
		gfloat _tmp47_ = 0.0F;
		gfloat _tmp48_ = 0.0F;
#line 40 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
		_tmp6_ = soy_fields_wind_get_wind (self);
#line 40 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
		_tmp7_ = _tmp6_;
#line 40 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
		_tmp8_ = _tmp7_;
#line 40 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
		_tmp9_ = soy_atoms_vector_get_x (_tmp8_);
#line 40 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
		_tmp10_ = _tmp9_;
#line 40 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
		_tmp11_ = other;
#line 40 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
		_tmp12_ = soy_bodies_body_get_velocity (_tmp11_);
#line 40 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
		_tmp13_ = _tmp12_;
#line 40 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
		_tmp14_ = _tmp13_;
#line 40 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
		_tmp15_ = soy_atoms_vector_get_x (_tmp14_);
#line 40 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
		_tmp16_ = _tmp15_;
#line 40 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
		_tmp17_ = _tmp10_ - _tmp16_;
#line 40 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
		_g_object_unref0 (_tmp14_);
#line 40 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
		_g_object_unref0 (_tmp8_);
#line 40 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
		dx = _tmp17_;
#line 41 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
		_tmp18_ = soy_fields_wind_get_wind (self);
#line 41 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
		_tmp19_ = _tmp18_;
#line 41 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
		_tmp20_ = _tmp19_;
#line 41 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
		_tmp21_ = soy_atoms_vector_get_y (_tmp20_);
#line 41 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
		_tmp22_ = _tmp21_;
#line 41 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
		_tmp23_ = other;
#line 41 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
		_tmp24_ = soy_bodies_body_get_velocity (_tmp23_);
#line 41 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
		_tmp25_ = _tmp24_;
#line 41 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
		_tmp26_ = _tmp25_;
#line 41 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
		_tmp27_ = soy_atoms_vector_get_y (_tmp26_);
#line 41 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
		_tmp28_ = _tmp27_;
#line 41 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
		_tmp29_ = _tmp22_ - _tmp28_;
#line 41 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
		_g_object_unref0 (_tmp26_);
#line 41 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
		_g_object_unref0 (_tmp20_);
#line 41 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
		dy = _tmp29_;
#line 42 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
		_tmp30_ = soy_fields_wind_get_wind (self);
#line 42 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
		_tmp31_ = _tmp30_;
#line 42 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
		_tmp32_ = _tmp31_;
#line 42 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
		_tmp33_ = soy_atoms_vector_get_z (_tmp32_);
#line 42 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
		_tmp34_ = _tmp33_;
#line 42 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
		_tmp35_ = other;
#line 42 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
		_tmp36_ = soy_bodies_body_get_velocity (_tmp35_);
#line 42 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
		_tmp37_ = _tmp36_;
#line 42 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
		_tmp38_ = _tmp37_;
#line 42 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
		_tmp39_ = soy_atoms_vector_get_z (_tmp38_);
#line 42 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
		_tmp40_ = _tmp39_;
#line 42 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
		_tmp41_ = _tmp34_ - _tmp40_;
#line 42 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
		_g_object_unref0 (_tmp38_);
#line 42 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
		_g_object_unref0 (_tmp32_);
#line 42 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
		dz = _tmp41_;
#line 43 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
		_tmp42_ = dx;
#line 43 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
		_tmp43_ = dx;
#line 43 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
		_tmp44_ = dy;
#line 43 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
		_tmp45_ = dy;
#line 43 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
		_tmp46_ = dz;
#line 43 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
		_tmp47_ = dz;
#line 43 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
		d2 = ((_tmp42_ * _tmp43_) + (_tmp44_ * _tmp45_)) + (_tmp46_ * _tmp47_);
#line 44 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
		_tmp48_ = d2;
#line 44 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
		if (_tmp48_ != ((gfloat) 0)) {
#line 379 "Wind.c"
			gfloat f = 0.0F;
			gfloat _tmp49_ = 0.0F;
			gfloat _tmp50_ = 0.0F;
			soybodiesBody* _tmp51_ = NULL;
			GeeHashMap* _tmp52_ = NULL;
			GeeHashMap* _tmp53_ = NULL;
			GeeHashMap* _tmp54_ = NULL;
			gpointer _tmp55_ = NULL;
			gfloat _tmp56_ = 0.0F;
			gfloat r = 0.0F;
			gfloat _tmp57_ = 0.0F;
			gfloat _tmp58_ = 0.0F;
			gfloat _tmp59_ = 0.0F;
			gboolean _tmp60_ = FALSE;
			gboolean _tmp61_ = FALSE;
			soybodiesBody* _tmp62_ = NULL;
			GeeHashMap* _tmp63_ = NULL;
			GeeHashMap* _tmp64_ = NULL;
			GeeHashMap* _tmp65_ = NULL;
			gboolean _tmp66_ = FALSE;
			gboolean _tmp67_ = FALSE;
			gboolean _tmp73_ = FALSE;
			gboolean _tmp79_ = FALSE;
#line 45 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
			_tmp49_ = self->priv->_viscosity;
#line 45 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
			_tmp50_ = d2;
#line 45 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
			_tmp51_ = other;
#line 45 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
			_tmp52_ = soy_bodies_body_get_tags (_tmp51_);
#line 45 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
			_tmp53_ = _tmp52_;
#line 45 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
			_tmp54_ = _tmp53_;
#line 45 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
			_tmp55_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp54_, "cd");
#line 45 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
			_tmp56_ = ((0.5f * _tmp49_) * _tmp50_) * ((gfloat) (*((gfloat*) _tmp55_)));
#line 45 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
			_g_object_unref0 (_tmp54_);
#line 45 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
			f = _tmp56_;
#line 46 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
			_tmp57_ = f;
#line 46 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
			_tmp58_ = d2;
#line 46 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
			_tmp59_ = sqrtf (_tmp58_);
#line 46 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
			r = _tmp57_ / _tmp59_;
#line 47 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
			_tmp62_ = other;
#line 47 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
			_tmp63_ = soy_bodies_body_get_tags (_tmp62_);
#line 47 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
			_tmp64_ = _tmp63_;
#line 47 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
			_tmp65_ = _tmp64_;
#line 47 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
			_tmp66_ = gee_abstract_map_has_key ((GeeAbstractMap*) _tmp65_, "cpx");
#line 47 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
			_tmp67_ = _tmp66_;
#line 47 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
			_g_object_unref0 (_tmp65_);
#line 47 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
			if (_tmp67_) {
#line 447 "Wind.c"
				soybodiesBody* _tmp68_ = NULL;
				GeeHashMap* _tmp69_ = NULL;
				GeeHashMap* _tmp70_ = NULL;
				GeeHashMap* _tmp71_ = NULL;
				gboolean _tmp72_ = FALSE;
#line 47 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
				_tmp68_ = other;
#line 47 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
				_tmp69_ = soy_bodies_body_get_tags (_tmp68_);
#line 47 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
				_tmp70_ = _tmp69_;
#line 47 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
				_tmp71_ = _tmp70_;
#line 47 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
				_tmp72_ = gee_abstract_map_has_key ((GeeAbstractMap*) _tmp71_, "cpy");
#line 47 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
				_tmp61_ = _tmp72_;
#line 47 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
				_g_object_unref0 (_tmp71_);
#line 467 "Wind.c"
			} else {
#line 47 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
				_tmp61_ = FALSE;
#line 471 "Wind.c"
			}
#line 47 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
			_tmp73_ = _tmp61_;
#line 47 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
			if (_tmp73_) {
#line 477 "Wind.c"
				soybodiesBody* _tmp74_ = NULL;
				GeeHashMap* _tmp75_ = NULL;
				GeeHashMap* _tmp76_ = NULL;
				GeeHashMap* _tmp77_ = NULL;
				gboolean _tmp78_ = FALSE;
#line 47 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
				_tmp74_ = other;
#line 47 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
				_tmp75_ = soy_bodies_body_get_tags (_tmp74_);
#line 47 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
				_tmp76_ = _tmp75_;
#line 47 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
				_tmp77_ = _tmp76_;
#line 47 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
				_tmp78_ = gee_abstract_map_has_key ((GeeAbstractMap*) _tmp77_, "cpz");
#line 47 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
				_tmp60_ = _tmp78_;
#line 47 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
				_g_object_unref0 (_tmp77_);
#line 497 "Wind.c"
			} else {
#line 47 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
				_tmp60_ = FALSE;
#line 501 "Wind.c"
			}
#line 47 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
			_tmp79_ = _tmp60_;
#line 47 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
			if (_tmp79_) {
#line 507 "Wind.c"
				soybodiesBody* _tmp80_ = NULL;
				gfloat _tmp81_ = 0.0F;
				gfloat _tmp82_ = 0.0F;
				gfloat _tmp83_ = 0.0F;
				gfloat _tmp84_ = 0.0F;
				gfloat _tmp85_ = 0.0F;
				gfloat _tmp86_ = 0.0F;
#line 48 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
				_tmp80_ = other;
#line 48 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
				_tmp81_ = r;
#line 48 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
				_tmp82_ = dx;
#line 48 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
				_tmp83_ = r;
#line 48 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
				_tmp84_ = dy;
#line 48 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
				_tmp85_ = r;
#line 48 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
				_tmp86_ = dz;
#line 48 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
				soy_bodies_body_addForce (_tmp80_, (dReal) (_tmp81_ * _tmp82_), (dReal) (_tmp83_ * _tmp84_), (dReal) (_tmp85_ * _tmp86_));
#line 531 "Wind.c"
			}
		}
	}
#line 49 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
	result = TRUE;
#line 49 "/home/jeff/Documents/libraries/libsoy/src/fields/Wind.gs"
	return result;
#line 539 "Wind.c"
}
示例#2
0
static void soy_fields_monopole_real_commit (soyfieldsField* base) {
	soyfieldsMonopole * self;
	GeeArrayList* _tmp90_ = NULL;
#line 51 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
	self = (soyfieldsMonopole*) base;
#line 227 "Monopole.c"
	{
		GeeArrayList* _other_list = NULL;
		GeeArrayList* _tmp0_ = NULL;
		GeeArrayList* _tmp1_ = NULL;
		gint _other_size = 0;
		GeeArrayList* _tmp2_ = NULL;
		gint _tmp3_ = 0;
		gint _tmp4_ = 0;
		gint _other_index = 0;
#line 52 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
		_tmp0_ = self->priv->_affected;
#line 52 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
		_tmp1_ = _g_object_ref0 (_tmp0_);
#line 52 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
		_other_list = _tmp1_;
#line 52 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
		_tmp2_ = _other_list;
#line 52 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
		_tmp3_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp2_);
#line 52 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
		_tmp4_ = _tmp3_;
#line 52 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
		_other_size = _tmp4_;
#line 52 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
		_other_index = -1;
#line 52 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
		while (TRUE) {
#line 255 "Monopole.c"
			gint _tmp5_ = 0;
			gint _tmp6_ = 0;
			gint _tmp7_ = 0;
			soybodiesBody* other = NULL;
			GeeArrayList* _tmp8_ = NULL;
			gint _tmp9_ = 0;
			gpointer _tmp10_ = NULL;
			gfloat xd = 0.0F;
			soybodiesBody* _tmp11_ = NULL;
			soyatomsPosition* _tmp12_ = NULL;
			soyatomsPosition* _tmp13_ = NULL;
			soyatomsPosition* _tmp14_ = NULL;
			gfloat _tmp15_ = 0.0F;
			gfloat _tmp16_ = 0.0F;
			soyatomsPosition* _tmp17_ = NULL;
			soyatomsPosition* _tmp18_ = NULL;
			soyatomsPosition* _tmp19_ = NULL;
			gfloat _tmp20_ = 0.0F;
			gfloat _tmp21_ = 0.0F;
			gfloat _tmp22_ = 0.0F;
			gfloat yd = 0.0F;
			soybodiesBody* _tmp23_ = NULL;
			soyatomsPosition* _tmp24_ = NULL;
			soyatomsPosition* _tmp25_ = NULL;
			soyatomsPosition* _tmp26_ = NULL;
			gfloat _tmp27_ = 0.0F;
			gfloat _tmp28_ = 0.0F;
			soyatomsPosition* _tmp29_ = NULL;
			soyatomsPosition* _tmp30_ = NULL;
			soyatomsPosition* _tmp31_ = NULL;
			gfloat _tmp32_ = 0.0F;
			gfloat _tmp33_ = 0.0F;
			gfloat _tmp34_ = 0.0F;
			gfloat zd = 0.0F;
			soybodiesBody* _tmp35_ = NULL;
			soyatomsPosition* _tmp36_ = NULL;
			soyatomsPosition* _tmp37_ = NULL;
			soyatomsPosition* _tmp38_ = NULL;
			gfloat _tmp39_ = 0.0F;
			gfloat _tmp40_ = 0.0F;
			soyatomsPosition* _tmp41_ = NULL;
			soyatomsPosition* _tmp42_ = NULL;
			soyatomsPosition* _tmp43_ = NULL;
			gfloat _tmp44_ = 0.0F;
			gfloat _tmp45_ = 0.0F;
			gfloat _tmp46_ = 0.0F;
			gfloat d2 = 0.0F;
			gfloat _tmp47_ = 0.0F;
			gfloat _tmp48_ = 0.0F;
			gfloat _tmp49_ = 0.0F;
			gfloat _tmp50_ = 0.0F;
			gfloat _tmp51_ = 0.0F;
			gfloat _tmp52_ = 0.0F;
			gfloat _tmp53_ = 0.0F;
#line 52 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp5_ = _other_index;
#line 52 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_other_index = _tmp5_ + 1;
#line 52 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp6_ = _other_index;
#line 52 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp7_ = _other_size;
#line 52 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			if (!(_tmp6_ < _tmp7_)) {
#line 52 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
				break;
#line 322 "Monopole.c"
			}
#line 52 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp8_ = _other_list;
#line 52 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp9_ = _other_index;
#line 52 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp10_ = gee_abstract_list_get ((GeeAbstractList*) _tmp8_, _tmp9_);
#line 52 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			other = (soybodiesBody*) _tmp10_;
#line 53 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp11_ = other;
#line 53 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp12_ = soy_bodies_body_get_position (_tmp11_);
#line 53 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp13_ = _tmp12_;
#line 53 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp14_ = _tmp13_;
#line 53 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp15_ = soy_atoms_position_get_x (_tmp14_);
#line 53 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp16_ = _tmp15_;
#line 53 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp17_ = soy_bodies_body_get_position ((soybodiesBody*) self);
#line 53 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp18_ = _tmp17_;
#line 53 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp19_ = _tmp18_;
#line 53 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp20_ = soy_atoms_position_get_x (_tmp19_);
#line 53 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp21_ = _tmp20_;
#line 53 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp22_ = _tmp16_ - _tmp21_;
#line 53 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_g_object_unref0 (_tmp19_);
#line 53 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_g_object_unref0 (_tmp14_);
#line 53 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			xd = _tmp22_;
#line 54 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp23_ = other;
#line 54 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp24_ = soy_bodies_body_get_position (_tmp23_);
#line 54 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp25_ = _tmp24_;
#line 54 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp26_ = _tmp25_;
#line 54 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp27_ = soy_atoms_position_get_y (_tmp26_);
#line 54 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp28_ = _tmp27_;
#line 54 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp29_ = soy_bodies_body_get_position ((soybodiesBody*) self);
#line 54 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp30_ = _tmp29_;
#line 54 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp31_ = _tmp30_;
#line 54 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp32_ = soy_atoms_position_get_y (_tmp31_);
#line 54 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp33_ = _tmp32_;
#line 54 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp34_ = _tmp28_ - _tmp33_;
#line 54 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_g_object_unref0 (_tmp31_);
#line 54 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_g_object_unref0 (_tmp26_);
#line 54 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			yd = _tmp34_;
#line 55 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp35_ = other;
#line 55 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp36_ = soy_bodies_body_get_position (_tmp35_);
#line 55 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp37_ = _tmp36_;
#line 55 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp38_ = _tmp37_;
#line 55 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp39_ = soy_atoms_position_get_z (_tmp38_);
#line 55 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp40_ = _tmp39_;
#line 55 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp41_ = soy_bodies_body_get_position ((soybodiesBody*) self);
#line 55 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp42_ = _tmp41_;
#line 55 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp43_ = _tmp42_;
#line 55 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp44_ = soy_atoms_position_get_z (_tmp43_);
#line 55 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp45_ = _tmp44_;
#line 55 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp46_ = _tmp40_ - _tmp45_;
#line 55 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_g_object_unref0 (_tmp43_);
#line 55 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_g_object_unref0 (_tmp38_);
#line 55 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			zd = _tmp46_;
#line 58 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp47_ = xd;
#line 58 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp48_ = xd;
#line 58 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp49_ = yd;
#line 58 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp50_ = yd;
#line 58 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp51_ = zd;
#line 58 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp52_ = zd;
#line 58 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			d2 = ((_tmp47_ * _tmp48_) + (_tmp49_ * _tmp50_)) + (_tmp51_ * _tmp52_);
#line 59 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_tmp53_ = d2;
#line 59 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			if (_tmp53_ != ((gfloat) 0)) {
#line 440 "Monopole.c"
				gfloat d = 0.0F;
				gfloat _tmp54_ = 0.0F;
				gfloat _tmp55_ = 0.0F;
				gfloat mm2 = 0.0F;
				soybodiesBody* _tmp56_ = NULL;
				gfloat _tmp57_ = 0.0F;
				gfloat _tmp58_ = 0.0F;
				soybodiesBody* _tmp59_ = NULL;
				gfloat _tmp60_ = 0.0F;
				soybodiesBody* _tmp61_ = NULL;
				GeeHashMap* _tmp62_ = NULL;
				GeeHashMap* _tmp63_ = NULL;
				GeeHashMap* _tmp64_ = NULL;
				gboolean _tmp65_ = FALSE;
				gboolean _tmp66_ = FALSE;
				gfloat f = 0.0F;
				gfloat _tmp73_ = 0.0F;
				gfloat _tmp74_ = 0.0F;
				gfloat _tmp75_ = 0.0F;
				gfloat _tmp76_ = 0.0F;
				gfloat _tmp77_ = 0.0F;
				gfloat _tmp78_ = 0.0F;
				gfloat _tmp79_ = 0.0F;
				soybodiesBody* _tmp80_ = NULL;
				gfloat _tmp81_ = 0.0F;
				gfloat _tmp82_ = 0.0F;
				gfloat _tmp83_ = 0.0F;
				gfloat _tmp84_ = 0.0F;
				gfloat _tmp85_ = 0.0F;
				gfloat _tmp86_ = 0.0F;
				gfloat _tmp87_ = 0.0F;
				gfloat _tmp88_ = 0.0F;
				gfloat _tmp89_ = 0.0F;
#line 60 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
				_tmp54_ = d2;
#line 60 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
				_tmp55_ = sqrtf (_tmp54_);
#line 60 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
				d = _tmp55_;
#line 62 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
				_tmp56_ = other;
#line 62 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
				_tmp57_ = soy_bodies_body_get_density (_tmp56_);
#line 62 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
				_tmp58_ = _tmp57_;
#line 62 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
				_tmp59_ = other;
#line 62 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
				_tmp60_ = soy_bodies_body_volume (_tmp59_);
#line 62 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
				mm2 = _tmp58_ * _tmp60_;
#line 63 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
				_tmp61_ = other;
#line 63 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
				_tmp62_ = soy_bodies_body_get_tags (_tmp61_);
#line 63 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
				_tmp63_ = _tmp62_;
#line 63 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
				_tmp64_ = _tmp63_;
#line 63 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
				_tmp65_ = gee_abstract_map_has_key ((GeeAbstractMap*) _tmp64_, "bmass");
#line 63 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
				_tmp66_ = _tmp65_;
#line 63 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
				_g_object_unref0 (_tmp64_);
#line 63 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
				if (_tmp66_) {
#line 508 "Monopole.c"
					soybodiesBody* _tmp67_ = NULL;
					GeeHashMap* _tmp68_ = NULL;
					GeeHashMap* _tmp69_ = NULL;
					GeeHashMap* _tmp70_ = NULL;
					gpointer _tmp71_ = NULL;
					gfloat* _tmp72_ = NULL;
#line 64 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
					_tmp67_ = other;
#line 64 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
					_tmp68_ = soy_bodies_body_get_tags (_tmp67_);
#line 64 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
					_tmp69_ = _tmp68_;
#line 64 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
					_tmp70_ = _tmp69_;
#line 64 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
					_tmp71_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp70_, "bmass");
#line 64 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
					_tmp72_ = (gfloat*) _tmp71_;
#line 64 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
					mm2 = *_tmp72_;
#line 64 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
					_g_free0 (_tmp72_);
#line 64 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
					_g_object_unref0 (_tmp70_);
#line 533 "Monopole.c"
				}
#line 66 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
				_tmp73_ = soy_fields_monopole_get_multiplier (self);
#line 66 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
				_tmp74_ = _tmp73_;
#line 66 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
				_tmp75_ = soy_bodies_body_get_density ((soybodiesBody*) self);
#line 66 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
				_tmp76_ = _tmp75_;
#line 66 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
				_tmp77_ = soy_bodies_body_volume ((soybodiesBody*) self);
#line 66 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
				_tmp78_ = mm2;
#line 66 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
				_tmp79_ = d2;
#line 66 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
				f = (((_tmp74_ * _tmp76_) * _tmp77_) * _tmp78_) / _tmp79_;
#line 68 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
				_tmp80_ = other;
#line 68 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
				_tmp81_ = f;
#line 68 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
				_tmp82_ = xd;
#line 68 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
				_tmp83_ = d;
#line 68 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
				_tmp84_ = f;
#line 68 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
				_tmp85_ = yd;
#line 68 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
				_tmp86_ = d;
#line 68 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
				_tmp87_ = f;
#line 68 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
				_tmp88_ = zd;
#line 68 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
				_tmp89_ = d;
#line 68 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
				soy_bodies_body_addForce (_tmp80_, (dReal) ((_tmp81_ * _tmp82_) / _tmp83_), (dReal) ((_tmp84_ * _tmp85_) / _tmp86_), (dReal) ((_tmp87_ * _tmp88_) / _tmp89_));
#line 573 "Monopole.c"
			}
#line 52 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
			_g_object_unref0 (other);
#line 577 "Monopole.c"
		}
#line 52 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
		_g_object_unref0 (_other_list);
#line 581 "Monopole.c"
	}
#line 69 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
	_tmp90_ = self->priv->_affected;
#line 69 "/home/jeff/Documents/libraries/libsoy/src/fields/Monopole.gs"
	gee_abstract_collection_clear ((GeeAbstractCollection*) _tmp90_);
#line 587 "Monopole.c"
}
示例#3
0
文件: Shockwave.c 项目: RONNCC/pysoy
static gboolean soy_fields_shockwave_real_exert (soyfieldsField* base, soybodiesBody* other) {
	soyfieldsShockwave * self;
	gboolean result = FALSE;
	gfloat depth = 0.0F;
	gfloat force = 0.0F;
	gfloat dx = 0.0F;
	gfloat dy = 0.0F;
	gfloat dz = 0.0F;
	gfloat d = 0.0F;
	soybodiesBody* _tmp0_;
	soyatomsPosition* _tmp1_;
	soyatomsPosition* _tmp2_;
	soyatomsPosition* _tmp3_;
	gfloat _tmp4_;
	gfloat _tmp5_;
	soybodiesBody* _tmp6_;
	soyatomsPosition* _tmp7_;
	soyatomsPosition* _tmp8_;
	soyatomsPosition* _tmp9_;
	gfloat _tmp10_;
	gfloat _tmp11_;
	soybodiesBody* _tmp12_;
	soyatomsPosition* _tmp13_;
	soyatomsPosition* _tmp14_;
	soyatomsPosition* _tmp15_;
	gfloat _tmp16_;
	gfloat _tmp17_;
	gfloat _tmp18_ = 0.0F;
	gboolean _tmp19_ = FALSE;
	gfloat _tmp20_;
	gboolean _tmp24_;
	self = (soyfieldsShockwave*) base;
	g_return_val_if_fail (other != NULL, FALSE);
	_tmp0_ = other;
	_tmp1_ = soy_bodies_body_get_position (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = _tmp2_;
	_tmp4_ = soy_atoms_position_get_x (_tmp3_);
	_tmp5_ = _tmp4_;
	_tmp6_ = other;
	_tmp7_ = soy_bodies_body_get_position (_tmp6_);
	_tmp8_ = _tmp7_;
	_tmp9_ = _tmp8_;
	_tmp10_ = soy_atoms_position_get_y (_tmp9_);
	_tmp11_ = _tmp10_;
	_tmp12_ = other;
	_tmp13_ = soy_bodies_body_get_position (_tmp12_);
	_tmp14_ = _tmp13_;
	_tmp15_ = _tmp14_;
	_tmp16_ = soy_atoms_position_get_z (_tmp15_);
	_tmp17_ = _tmp16_;
	_tmp18_ = soy_bodies_body_pointDepth ((soybodiesBody*) self, _tmp5_, _tmp11_, _tmp17_);
	depth = _tmp18_;
	_g_object_unref0 (_tmp15_);
	_g_object_unref0 (_tmp9_);
	_g_object_unref0 (_tmp3_);
	_tmp20_ = depth;
	if (_tmp20_ > ((gfloat) 0)) {
		gfloat _tmp21_;
		gfloat _tmp22_;
		gfloat _tmp23_;
		_tmp21_ = depth;
		_tmp22_ = soy_fields_shockwave_get_length (self);
		_tmp23_ = _tmp22_;
		_tmp19_ = _tmp21_ < _tmp23_;
	} else {
		_tmp19_ = FALSE;
	}
	_tmp24_ = _tmp19_;
	if (_tmp24_) {
		gfloat _tmp25_;
		gfloat _tmp26_;
		gfloat _tmp27_;
		gfloat _tmp28_;
		gfloat _tmp29_ = 0.0F;
		soybodiesBody* _tmp30_;
		soyatomsPosition* _tmp31_;
		soyatomsPosition* _tmp32_;
		soyatomsPosition* _tmp33_;
		gfloat _tmp34_;
		gfloat _tmp35_;
		soyatomsPosition* _tmp36_;
		soyatomsPosition* _tmp37_;
		soyatomsPosition* _tmp38_;
		gfloat _tmp39_;
		gfloat _tmp40_;
		soybodiesBody* _tmp41_;
		soyatomsPosition* _tmp42_;
		soyatomsPosition* _tmp43_;
		soyatomsPosition* _tmp44_;
		gfloat _tmp45_;
		gfloat _tmp46_;
		soyatomsPosition* _tmp47_;
		soyatomsPosition* _tmp48_;
		soyatomsPosition* _tmp49_;
		gfloat _tmp50_;
		gfloat _tmp51_;
		soybodiesBody* _tmp52_;
		soyatomsPosition* _tmp53_;
		soyatomsPosition* _tmp54_;
		soyatomsPosition* _tmp55_;
		gfloat _tmp56_;
		gfloat _tmp57_;
		soyatomsPosition* _tmp58_;
		soyatomsPosition* _tmp59_;
		soyatomsPosition* _tmp60_;
		gfloat _tmp61_;
		gfloat _tmp62_;
		gfloat _tmp63_;
		gfloat _tmp64_ = 0.0F;
		gfloat _tmp65_;
		gfloat _tmp66_ = 0.0F;
		gfloat _tmp67_;
		gfloat _tmp68_ = 0.0F;
		gfloat _tmp69_ = 0.0F;
		gfloat _tmp70_;
		gfloat _tmp71_;
		gfloat _tmp72_;
		gfloat _tmp73_;
		gfloat _tmp74_;
		gfloat _tmp75_;
		gfloat _tmp76_;
		gfloat _tmp77_;
		gfloat _tmp78_;
		gboolean _tmp79_ = FALSE;
		gboolean _tmp80_ = FALSE;
		soybodiesBody* _tmp81_;
		GeeHashMap* _tmp82_;
		GeeHashMap* _tmp83_;
		GeeHashMap* _tmp84_;
		gboolean _tmp85_ = FALSE;
		gboolean _tmp86_;
		gboolean _tmp92_;
		gboolean _tmp98_;
		_tmp25_ = self->priv->_outer;
		_tmp26_ = soy_fields_shockwave_get_swvel (self);
		_tmp27_ = _tmp26_;
		_tmp28_ = depth;
		_tmp29_ = powf ((((gfloat) _tmp25_) * _tmp27_) - _tmp28_, (gfloat) 2);
		force = 1 / (12.56637061f * _tmp29_);
		_tmp30_ = other;
		_tmp31_ = soy_bodies_body_get_position (_tmp30_);
		_tmp32_ = _tmp31_;
		_tmp33_ = _tmp32_;
		_tmp34_ = soy_atoms_position_get_x (_tmp33_);
		_tmp35_ = _tmp34_;
		_tmp36_ = soy_bodies_body_get_position ((soybodiesBody*) self);
		_tmp37_ = _tmp36_;
		_tmp38_ = _tmp37_;
		_tmp39_ = soy_atoms_position_get_x (_tmp38_);
		_tmp40_ = _tmp39_;
		dx = _tmp35_ - _tmp40_;
		_g_object_unref0 (_tmp38_);
		_g_object_unref0 (_tmp33_);
		_tmp41_ = other;
		_tmp42_ = soy_bodies_body_get_position (_tmp41_);
		_tmp43_ = _tmp42_;
		_tmp44_ = _tmp43_;
		_tmp45_ = soy_atoms_position_get_y (_tmp44_);
		_tmp46_ = _tmp45_;
		_tmp47_ = soy_bodies_body_get_position ((soybodiesBody*) self);
		_tmp48_ = _tmp47_;
		_tmp49_ = _tmp48_;
		_tmp50_ = soy_atoms_position_get_y (_tmp49_);
		_tmp51_ = _tmp50_;
		dy = _tmp46_ - _tmp51_;
		_g_object_unref0 (_tmp49_);
		_g_object_unref0 (_tmp44_);
		_tmp52_ = other;
		_tmp53_ = soy_bodies_body_get_position (_tmp52_);
		_tmp54_ = _tmp53_;
		_tmp55_ = _tmp54_;
		_tmp56_ = soy_atoms_position_get_z (_tmp55_);
		_tmp57_ = _tmp56_;
		_tmp58_ = soy_bodies_body_get_position ((soybodiesBody*) self);
		_tmp59_ = _tmp58_;
		_tmp60_ = _tmp59_;
		_tmp61_ = soy_atoms_position_get_z (_tmp60_);
		_tmp62_ = _tmp61_;
		dz = _tmp57_ - _tmp62_;
		_g_object_unref0 (_tmp60_);
		_g_object_unref0 (_tmp55_);
		_tmp63_ = dx;
		_tmp64_ = powf (_tmp63_, (gfloat) 2);
		_tmp65_ = dy;
		_tmp66_ = powf (_tmp65_, (gfloat) 2);
		_tmp67_ = dz;
		_tmp68_ = powf (_tmp67_, (gfloat) 2);
		_tmp69_ = sqrtf ((_tmp64_ + _tmp66_) + _tmp68_);
		d = _tmp69_;
		_tmp70_ = force;
		_tmp71_ = dx;
		_tmp72_ = d;
		dx = (_tmp70_ * _tmp71_) / _tmp72_;
		_tmp73_ = force;
		_tmp74_ = dy;
		_tmp75_ = d;
		dy = (_tmp73_ * _tmp74_) / _tmp75_;
		_tmp76_ = force;
		_tmp77_ = dz;
		_tmp78_ = d;
		dz = (_tmp76_ * _tmp77_) / _tmp78_;
		_tmp81_ = other;
		_tmp82_ = soy_bodies_body_get_tags (_tmp81_);
		_tmp83_ = _tmp82_;
		_tmp84_ = _tmp83_;
		_tmp85_ = gee_abstract_map_has_key ((GeeAbstractMap*) _tmp84_, "cpx");
		_tmp86_ = _tmp85_;
		_g_object_unref0 (_tmp84_);
		if (_tmp86_) {
			soybodiesBody* _tmp87_;
			GeeHashMap* _tmp88_;
			GeeHashMap* _tmp89_;
			GeeHashMap* _tmp90_;
			gboolean _tmp91_ = FALSE;
			_tmp87_ = other;
			_tmp88_ = soy_bodies_body_get_tags (_tmp87_);
			_tmp89_ = _tmp88_;
			_tmp90_ = _tmp89_;
			_tmp91_ = gee_abstract_map_has_key ((GeeAbstractMap*) _tmp90_, "cpy");
			_tmp80_ = _tmp91_;
			_g_object_unref0 (_tmp90_);
		} else {
			_tmp80_ = FALSE;
		}
		_tmp92_ = _tmp80_;
		if (_tmp92_) {
			soybodiesBody* _tmp93_;
			GeeHashMap* _tmp94_;
			GeeHashMap* _tmp95_;
			GeeHashMap* _tmp96_;
			gboolean _tmp97_ = FALSE;
			_tmp93_ = other;
			_tmp94_ = soy_bodies_body_get_tags (_tmp93_);
			_tmp95_ = _tmp94_;
			_tmp96_ = _tmp95_;
			_tmp97_ = gee_abstract_map_has_key ((GeeAbstractMap*) _tmp96_, "cpz");
			_tmp79_ = _tmp97_;
			_g_object_unref0 (_tmp96_);
		} else {
			_tmp79_ = FALSE;
		}
		_tmp98_ = _tmp79_;
		if (_tmp98_) {
			soybodiesBody* _tmp99_;
			gfloat _tmp100_;
			gfloat _tmp101_;
			gfloat _tmp102_;
			soybodiesBody* _tmp103_;
			GeeHashMap* _tmp104_;
			GeeHashMap* _tmp105_;
			GeeHashMap* _tmp106_;
			gpointer _tmp107_ = NULL;
			gfloat* _tmp108_;
			soybodiesBody* _tmp109_;
			GeeHashMap* _tmp110_;
			GeeHashMap* _tmp111_;
			GeeHashMap* _tmp112_;
			gpointer _tmp113_ = NULL;
			gfloat* _tmp114_;
			soybodiesBody* _tmp115_;
			GeeHashMap* _tmp116_;
			GeeHashMap* _tmp117_;
			GeeHashMap* _tmp118_;
			gpointer _tmp119_ = NULL;
			gfloat* _tmp120_;
			_tmp99_ = other;
			_tmp100_ = dx;
			_tmp101_ = dy;
			_tmp102_ = dz;
			_tmp103_ = other;
			_tmp104_ = soy_bodies_body_get_tags (_tmp103_);
			_tmp105_ = _tmp104_;
			_tmp106_ = _tmp105_;
			_tmp107_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp106_, "cpx");
			_tmp108_ = (gfloat*) _tmp107_;
			_tmp109_ = other;
			_tmp110_ = soy_bodies_body_get_tags (_tmp109_);
			_tmp111_ = _tmp110_;
			_tmp112_ = _tmp111_;
			_tmp113_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp112_, "cpy");
			_tmp114_ = (gfloat*) _tmp113_;
			_tmp115_ = other;
			_tmp116_ = soy_bodies_body_get_tags (_tmp115_);
			_tmp117_ = _tmp116_;
			_tmp118_ = _tmp117_;
			_tmp119_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp118_, "cpz");
			_tmp120_ = (gfloat*) _tmp119_;
			soy_bodies_body_addForceAtRelPos (_tmp99_, (dReal) _tmp100_, (dReal) _tmp101_, (dReal) _tmp102_, *_tmp108_, *_tmp114_, *_tmp120_);
			_g_free0 (_tmp120_);
			_g_object_unref0 (_tmp118_);
			_g_free0 (_tmp114_);
			_g_object_unref0 (_tmp112_);
			_g_free0 (_tmp108_);
			_g_object_unref0 (_tmp106_);
		} else {
			soybodiesBody* _tmp121_;
			gfloat _tmp122_;
			gfloat _tmp123_;
			gfloat _tmp124_;
			_tmp121_ = other;
			_tmp122_ = dx;
			_tmp123_ = dy;
			_tmp124_ = dz;
			soy_bodies_body_addForce (_tmp121_, (dReal) _tmp122_, (dReal) _tmp123_, (dReal) _tmp124_);
		}
	}
	result = TRUE;
	return result;
}
示例#4
0
文件: Monopole.c 项目: RONNCC/pysoy
static void soy_fields_monopole_real_commit (soyfieldsField* base) {
	soyfieldsMonopole * self;
	GeeArrayList* _tmp91_;
	self = (soyfieldsMonopole*) base;
	{
		GeeArrayList* _tmp0_;
		GeeArrayList* _tmp1_;
		GeeArrayList* _other_list;
		GeeArrayList* _tmp2_;
		gint _tmp3_;
		gint _tmp4_;
		gint _other_size;
		gint _other_index;
		_tmp0_ = self->priv->_affected;
		_tmp1_ = _g_object_ref0 (_tmp0_);
		_other_list = _tmp1_;
		_tmp2_ = _other_list;
		_tmp3_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp2_);
		_tmp4_ = _tmp3_;
		_other_size = _tmp4_;
		_other_index = -1;
		while (TRUE) {
			gint _tmp5_;
			gint _tmp6_;
			gint _tmp7_;
			GeeArrayList* _tmp8_;
			gint _tmp9_;
			gpointer _tmp10_ = NULL;
			soybodiesBody* other;
			soybodiesBody* _tmp11_;
			soyatomsPosition* _tmp12_;
			soyatomsPosition* _tmp13_;
			soyatomsPosition* _tmp14_;
			gfloat _tmp15_;
			gfloat _tmp16_;
			soyatomsPosition* _tmp17_;
			soyatomsPosition* _tmp18_;
			soyatomsPosition* _tmp19_;
			gfloat _tmp20_;
			gfloat _tmp21_;
			gfloat _tmp22_;
			gfloat xd;
			soybodiesBody* _tmp23_;
			soyatomsPosition* _tmp24_;
			soyatomsPosition* _tmp25_;
			soyatomsPosition* _tmp26_;
			gfloat _tmp27_;
			gfloat _tmp28_;
			soyatomsPosition* _tmp29_;
			soyatomsPosition* _tmp30_;
			soyatomsPosition* _tmp31_;
			gfloat _tmp32_;
			gfloat _tmp33_;
			gfloat _tmp34_;
			gfloat yd;
			soybodiesBody* _tmp35_;
			soyatomsPosition* _tmp36_;
			soyatomsPosition* _tmp37_;
			soyatomsPosition* _tmp38_;
			gfloat _tmp39_;
			gfloat _tmp40_;
			soyatomsPosition* _tmp41_;
			soyatomsPosition* _tmp42_;
			soyatomsPosition* _tmp43_;
			gfloat _tmp44_;
			gfloat _tmp45_;
			gfloat _tmp46_;
			gfloat zd;
			gfloat _tmp47_;
			gfloat _tmp48_;
			gfloat _tmp49_;
			gfloat _tmp50_;
			gfloat _tmp51_;
			gfloat _tmp52_;
			gfloat d2;
			gfloat _tmp53_;
			_tmp5_ = _other_index;
			_other_index = _tmp5_ + 1;
			_tmp6_ = _other_index;
			_tmp7_ = _other_size;
			if (!(_tmp6_ < _tmp7_)) {
				break;
			}
			_tmp8_ = _other_list;
			_tmp9_ = _other_index;
			_tmp10_ = gee_abstract_list_get ((GeeAbstractList*) _tmp8_, _tmp9_);
			other = (soybodiesBody*) _tmp10_;
			_tmp11_ = other;
			_tmp12_ = soy_bodies_body_get_position (_tmp11_);
			_tmp13_ = _tmp12_;
			_tmp14_ = _tmp13_;
			_tmp15_ = soy_atoms_position_get_x (_tmp14_);
			_tmp16_ = _tmp15_;
			_tmp17_ = soy_bodies_body_get_position ((soybodiesBody*) self);
			_tmp18_ = _tmp17_;
			_tmp19_ = _tmp18_;
			_tmp20_ = soy_atoms_position_get_x (_tmp19_);
			_tmp21_ = _tmp20_;
			_tmp22_ = _tmp16_ - _tmp21_;
			_g_object_unref0 (_tmp19_);
			_g_object_unref0 (_tmp14_);
			xd = _tmp22_;
			_tmp23_ = other;
			_tmp24_ = soy_bodies_body_get_position (_tmp23_);
			_tmp25_ = _tmp24_;
			_tmp26_ = _tmp25_;
			_tmp27_ = soy_atoms_position_get_y (_tmp26_);
			_tmp28_ = _tmp27_;
			_tmp29_ = soy_bodies_body_get_position ((soybodiesBody*) self);
			_tmp30_ = _tmp29_;
			_tmp31_ = _tmp30_;
			_tmp32_ = soy_atoms_position_get_y (_tmp31_);
			_tmp33_ = _tmp32_;
			_tmp34_ = _tmp28_ - _tmp33_;
			_g_object_unref0 (_tmp31_);
			_g_object_unref0 (_tmp26_);
			yd = _tmp34_;
			_tmp35_ = other;
			_tmp36_ = soy_bodies_body_get_position (_tmp35_);
			_tmp37_ = _tmp36_;
			_tmp38_ = _tmp37_;
			_tmp39_ = soy_atoms_position_get_z (_tmp38_);
			_tmp40_ = _tmp39_;
			_tmp41_ = soy_bodies_body_get_position ((soybodiesBody*) self);
			_tmp42_ = _tmp41_;
			_tmp43_ = _tmp42_;
			_tmp44_ = soy_atoms_position_get_z (_tmp43_);
			_tmp45_ = _tmp44_;
			_tmp46_ = _tmp40_ - _tmp45_;
			_g_object_unref0 (_tmp43_);
			_g_object_unref0 (_tmp38_);
			zd = _tmp46_;
			_tmp47_ = xd;
			_tmp48_ = xd;
			_tmp49_ = yd;
			_tmp50_ = yd;
			_tmp51_ = zd;
			_tmp52_ = zd;
			d2 = ((_tmp47_ * _tmp48_) + (_tmp49_ * _tmp50_)) + (_tmp51_ * _tmp52_);
			_tmp53_ = d2;
			if (_tmp53_ != ((gfloat) 0)) {
				gfloat _tmp54_;
				gfloat _tmp55_ = 0.0F;
				gfloat d;
				soybodiesBody* _tmp56_;
				soyMass* _tmp57_;
				soyMass* _tmp58_;
				gfloat _tmp59_;
				gfloat _tmp60_;
				gfloat mm2;
				soybodiesBody* _tmp61_;
				GeeHashMap* _tmp62_;
				GeeHashMap* _tmp63_;
				GeeHashMap* _tmp64_;
				gboolean _tmp65_ = FALSE;
				gboolean _tmp66_;
				gfloat _tmp73_;
				gfloat _tmp74_;
				soyMass* _tmp75_;
				soyMass* _tmp76_;
				gfloat _tmp77_;
				gfloat _tmp78_;
				gfloat _tmp79_;
				gfloat _tmp80_;
				gfloat f;
				soybodiesBody* _tmp81_;
				gfloat _tmp82_;
				gfloat _tmp83_;
				gfloat _tmp84_;
				gfloat _tmp85_;
				gfloat _tmp86_;
				gfloat _tmp87_;
				gfloat _tmp88_;
				gfloat _tmp89_;
				gfloat _tmp90_;
				_tmp54_ = d2;
				_tmp55_ = sqrtf (_tmp54_);
				d = _tmp55_;
				_tmp56_ = other;
				_tmp57_ = soy_bodies_body_get_mass (_tmp56_);
				_tmp58_ = _tmp57_;
				_tmp59_ = soy_mass_get_mass (_tmp58_);
				_tmp60_ = _tmp59_;
				mm2 = _tmp60_;
				_tmp61_ = other;
				_tmp62_ = soy_bodies_body_get_tags (_tmp61_);
				_tmp63_ = _tmp62_;
				_tmp64_ = _tmp63_;
				_tmp65_ = gee_abstract_map_has_key ((GeeAbstractMap*) _tmp64_, "bmass");
				_tmp66_ = _tmp65_;
				_g_object_unref0 (_tmp64_);
				if (_tmp66_) {
					soybodiesBody* _tmp67_;
					GeeHashMap* _tmp68_;
					GeeHashMap* _tmp69_;
					GeeHashMap* _tmp70_;
					gpointer _tmp71_ = NULL;
					gfloat* _tmp72_;
					_tmp67_ = other;
					_tmp68_ = soy_bodies_body_get_tags (_tmp67_);
					_tmp69_ = _tmp68_;
					_tmp70_ = _tmp69_;
					_tmp71_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp70_, "bmass");
					_tmp72_ = (gfloat*) _tmp71_;
					mm2 = *_tmp72_;
					_g_free0 (_tmp72_);
					_g_object_unref0 (_tmp70_);
				}
				_tmp73_ = soy_fields_monopole_get_multiplier (self);
				_tmp74_ = _tmp73_;
				_tmp75_ = soy_bodies_body_get_mass ((soybodiesBody*) self);
				_tmp76_ = _tmp75_;
				_tmp77_ = soy_mass_get_mass (_tmp76_);
				_tmp78_ = _tmp77_;
				_tmp79_ = mm2;
				_tmp80_ = d2;
				f = ((_tmp74_ * _tmp78_) * _tmp79_) / _tmp80_;
				_tmp81_ = other;
				_tmp82_ = f;
				_tmp83_ = xd;
				_tmp84_ = d;
				_tmp85_ = f;
				_tmp86_ = yd;
				_tmp87_ = d;
				_tmp88_ = f;
				_tmp89_ = zd;
				_tmp90_ = d;
				soy_bodies_body_addForce (_tmp81_, (dReal) ((_tmp82_ * _tmp83_) / _tmp84_), (dReal) ((_tmp85_ * _tmp86_) / _tmp87_), (dReal) ((_tmp88_ * _tmp89_) / _tmp90_));
			}
			_g_object_unref0 (other);
		}
		_g_object_unref0 (_other_list);
	}
	_tmp91_ = self->priv->_affected;
	gee_abstract_collection_clear ((GeeAbstractCollection*) _tmp91_);
}