Exemplo n.º 1
0
static PyObject*
nb_multiply (PyObject* o1, PyObject* o2) {
    double o1x, o1y, o1z = 0;
    double o2x, o2y, o2z = 0;
    PyObject *args, *result;
    PySoy_atoms_Position_Object *so1, *so2;

    // parse object 1
    if (PyLong_Check(o1)) {
        o1x = o1y = o1z = PyLong_AsDouble(o1);
    } else if (PyFloat_Check(o1)) {
        o1x = o1y = o1z = PyFloat_AsDouble(o1);
    } else if (PySoy_atoms_Position_Check(o1)) {
        so1 = (PySoy_atoms_Position_Object*)o1;
        o1x = soy_atoms_position_get_x(so1->g);
        o1y = soy_atoms_position_get_y(so1->g);
        o1z = soy_atoms_position_get_z(so1->g);
    } else {
        PyErr_SetString(PyExc_TypeError, "unsupported operand type(s)");
        return NULL;
    }

    // parse object 2
    if (PyLong_Check(o2)) {
        o2x = o2y = o2z = PyLong_AsDouble(o2);
    } else if (PyFloat_Check(o2)) {
        o2x = o2y = o2z = PyFloat_AsDouble(o2);
    } else if (PySoy_atoms_Position_Check(o2) && !PySoy_atoms_Position_Check(o1)) {
        so2 = (PySoy_atoms_Position_Object*)o2;
        o2x = soy_atoms_position_get_x(so2->g);
        o2y = soy_atoms_position_get_y(so2->g);
        o2z = soy_atoms_position_get_z(so2->g);
    } else {
        PyErr_SetString(PyExc_TypeError, "unsupported operand type(s)");
        return NULL;
    }

    // build args with calculated values
    args = Py_BuildValue("((fff))", o1x * o2x, o1y * o2y, o1z * o2z);

    // create result object
    result = tp_new(&PySoy_atoms_Position_Type, args, NULL);

    // decref args tuple
    Py_DECREF(args);

    // return calculated result
    return result;
}
Exemplo n.º 2
0
static void _soy_joints_universal_anchor_set (soyjointsUniversal* self, soyatomsPosition* anchor) {
	soyscenesScene* _tmp0_;
	struct dxJoint* _tmp1_;
	soyatomsPosition* _tmp2_;
	gfloat _tmp3_;
	gfloat _tmp4_;
	soyatomsPosition* _tmp5_;
	gfloat _tmp6_;
	gfloat _tmp7_;
	soyatomsPosition* _tmp8_;
	gfloat _tmp9_;
	gfloat _tmp10_;
	soyscenesScene* _tmp11_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (anchor != NULL);
	_tmp0_ = ((soyjointsJoint*) self)->scene;
	g_rw_lock_writer_lock (&_tmp0_->stepLock);
	_tmp1_ = ((soyjointsJoint*) self)->joint;
	_tmp2_ = anchor;
	_tmp3_ = soy_atoms_position_get_x (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = anchor;
	_tmp6_ = soy_atoms_position_get_y (_tmp5_);
	_tmp7_ = _tmp6_;
	_tmp8_ = anchor;
	_tmp9_ = soy_atoms_position_get_z (_tmp8_);
	_tmp10_ = _tmp9_;
	dJointSetUniversalAnchor ((struct dxJoint*) _tmp1_, (dReal) _tmp4_, (dReal) _tmp7_, (dReal) _tmp10_);
	_tmp11_ = ((soyjointsJoint*) self)->scene;
	g_rw_lock_writer_unlock (&_tmp11_->stepLock);
}
Exemplo n.º 3
0
static void _soy_joints_hinge_anchor_set (soyjointsHinge* self, soyatomsPosition* anchor) {
	struct dxJoint* _tmp0_;
	soyatomsPosition* _tmp1_;
	gfloat _tmp2_;
	gfloat _tmp3_;
	soyatomsPosition* _tmp4_;
	gfloat _tmp5_;
	gfloat _tmp6_;
	soyatomsPosition* _tmp7_;
	gfloat _tmp8_;
	gfloat _tmp9_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (anchor != NULL);
	g_rw_lock_writer_lock (&soy_scenes__stepLock);
	_tmp0_ = ((soyjointsJoint*) self)->joint;
	_tmp1_ = anchor;
	_tmp2_ = soy_atoms_position_get_x (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = anchor;
	_tmp5_ = soy_atoms_position_get_y (_tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = anchor;
	_tmp8_ = soy_atoms_position_get_z (_tmp7_);
	_tmp9_ = _tmp8_;
	dJointSetHingeAnchor ((struct dxJoint*) _tmp0_, (dReal) _tmp3_, (dReal) _tmp6_, (dReal) _tmp9_);
	g_rw_lock_writer_unlock (&soy_scenes__stepLock);
}
Exemplo n.º 4
0
static PyObject*
tp_str (SELF self) {
    char* str;
    PyObject* ret;

    // We can't use PyUnicode_FromFormat because it doesn't support floats
    str = g_strdup_printf("(%f, %f, %f)",
                          soy_atoms_position_get_x(self->g),
                          soy_atoms_position_get_y(self->g),
                          soy_atoms_position_get_z(self->g));
    ret = PyUnicode_FromString(str);

    // Free str and return
    g_free(str);
    return ret;
}
Exemplo n.º 5
0
static PyObject*
tp_str (SELF self) {
    char* str;
    PyObject* ret;

    str = g_strdup_printf("<Vertex at (%f, %f, %f)>",
                            soy_atoms_position_get_x(
                                soy_atoms_vertex_get_position(self->g)),
                            soy_atoms_position_get_y(
                                soy_atoms_vertex_get_position(self->g)),
                            soy_atoms_position_get_z(
                                soy_atoms_vertex_get_position(self->g)));
    ret = PyUnicode_FromString(str);

    g_free(str);
    return ret;
}
Exemplo n.º 6
0
static void soy_joints_hinge_real_setup (soyjointsJoint* base, soyatomsPosition* anchor, soyatomsAxis* axis1, soyatomsAxis* axis2) {
	soyjointsHinge * self;
	struct dxJoint* _tmp0_;
	soyatomsPosition* _tmp1_;
	gfloat _tmp2_;
	gfloat _tmp3_;
	soyatomsPosition* _tmp4_;
	gfloat _tmp5_;
	gfloat _tmp6_;
	soyatomsPosition* _tmp7_;
	gfloat _tmp8_;
	gfloat _tmp9_;
	struct dxJoint* _tmp10_;
	soyatomsAxis* _tmp11_;
	gfloat _tmp12_;
	gfloat _tmp13_;
	soyatomsAxis* _tmp14_;
	gfloat _tmp15_;
	gfloat _tmp16_;
	soyatomsAxis* _tmp17_;
	gfloat _tmp18_;
	gfloat _tmp19_;
	self = (soyjointsHinge*) base;
	_tmp0_ = ((soyjointsJoint*) self)->joint;
	_tmp1_ = anchor;
	_tmp2_ = soy_atoms_position_get_x (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = anchor;
	_tmp5_ = soy_atoms_position_get_y (_tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = anchor;
	_tmp8_ = soy_atoms_position_get_z (_tmp7_);
	_tmp9_ = _tmp8_;
	dJointSetHingeAnchor ((struct dxJoint*) _tmp0_, (dReal) _tmp3_, (dReal) _tmp6_, (dReal) _tmp9_);
	_tmp10_ = ((soyjointsJoint*) self)->joint;
	_tmp11_ = axis1;
	_tmp12_ = soy_atoms_axis_get_x (_tmp11_);
	_tmp13_ = _tmp12_;
	_tmp14_ = axis1;
	_tmp15_ = soy_atoms_axis_get_y (_tmp14_);
	_tmp16_ = _tmp15_;
	_tmp17_ = axis1;
	_tmp18_ = soy_atoms_axis_get_z (_tmp17_);
	_tmp19_ = _tmp18_;
	dJointSetHingeAxis ((struct dxJoint*) _tmp10_, (dReal) _tmp13_, (dReal) _tmp16_, (dReal) _tmp19_);
}
Exemplo n.º 7
0
static void _soy_joints_hinge_anchor_set (soyjointsHinge* self, soyatomsPosition* anchor) {
	struct dxJoint* _tmp0_ = NULL;
	soyatomsPosition* _tmp1_ = NULL;
	gfloat _tmp2_ = 0.0F;
	gfloat _tmp3_ = 0.0F;
	soyatomsPosition* _tmp4_ = NULL;
	gfloat _tmp5_ = 0.0F;
	gfloat _tmp6_ = 0.0F;
	soyatomsPosition* _tmp7_ = NULL;
	gfloat _tmp8_ = 0.0F;
	gfloat _tmp9_ = 0.0F;
#line 51 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	g_return_if_fail (self != NULL);
#line 51 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	g_return_if_fail (anchor != NULL);
#line 52 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	g_rw_lock_writer_lock (&soy_scenes__stepLock);
#line 53 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	_tmp0_ = ((soyjointsJoint*) self)->joint;
#line 53 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	_tmp1_ = anchor;
#line 53 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	_tmp2_ = soy_atoms_position_get_x (_tmp1_);
#line 53 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	_tmp3_ = _tmp2_;
#line 53 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	_tmp4_ = anchor;
#line 53 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	_tmp5_ = soy_atoms_position_get_y (_tmp4_);
#line 53 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	_tmp6_ = _tmp5_;
#line 53 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	_tmp7_ = anchor;
#line 53 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	_tmp8_ = soy_atoms_position_get_z (_tmp7_);
#line 53 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	_tmp9_ = _tmp8_;
#line 53 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	dJointSetHingeAnchor ((struct dxJoint*) _tmp0_, (dReal) _tmp3_, (dReal) _tmp6_, (dReal) _tmp9_);
#line 56 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	g_rw_lock_writer_unlock (&soy_scenes__stepLock);
#line 379 "Hinge.c"
}
Exemplo n.º 8
0
soyatomsPosition* soy_joints_universal_get_anchor (soyjointsUniversal* self) {
	soyatomsPosition* result;
	dxVector3* _tmp0_;
	dxVector3* v;
	struct dxJoint* _tmp1_;
	dxVector3* _tmp2_;
	soyatomsPosition* _tmp3_;
	soyatomsPosition* _tmp4_;
	soyatomsPosition* value;
	gboolean _tmp5_ = FALSE;
	gboolean _tmp6_ = FALSE;
	gboolean _tmp7_ = FALSE;
	soyatomsPosition* _tmp8_;
	gboolean _tmp14_;
	gboolean _tmp20_;
	gboolean _tmp26_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = dvector3_new ();
	v = _tmp0_;
	_tmp1_ = ((soyjointsJoint*) self)->joint;
	_tmp2_ = v;
	dJointGetUniversalAnchor ((struct dxJoint*) _tmp1_, _tmp2_);
	_tmp3_ = self->priv->_anchor_obj;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	value = _tmp4_;
	_tmp8_ = value;
	if (_tmp8_ == NULL) {
		_tmp7_ = TRUE;
	} else {
		dxVector3* _tmp9_;
		dReal _tmp10_;
		soyatomsPosition* _tmp11_;
		gfloat _tmp12_;
		gfloat _tmp13_;
		_tmp9_ = v;
		_tmp10_ = _tmp9_->x;
		_tmp11_ = value;
		_tmp12_ = soy_atoms_position_get_x (_tmp11_);
		_tmp13_ = _tmp12_;
		_tmp7_ = ((gfloat) _tmp10_) != _tmp13_;
	}
	_tmp14_ = _tmp7_;
	if (_tmp14_) {
		_tmp6_ = TRUE;
	} else {
		dxVector3* _tmp15_;
		dReal _tmp16_;
		soyatomsPosition* _tmp17_;
		gfloat _tmp18_;
		gfloat _tmp19_;
		_tmp15_ = v;
		_tmp16_ = _tmp15_->y;
		_tmp17_ = value;
		_tmp18_ = soy_atoms_position_get_y (_tmp17_);
		_tmp19_ = _tmp18_;
		_tmp6_ = ((gfloat) _tmp16_) != _tmp19_;
	}
	_tmp20_ = _tmp6_;
	if (_tmp20_) {
		_tmp5_ = TRUE;
	} else {
		dxVector3* _tmp21_;
		dReal _tmp22_;
		soyatomsPosition* _tmp23_;
		gfloat _tmp24_;
		gfloat _tmp25_;
		_tmp21_ = v;
		_tmp22_ = _tmp21_->z;
		_tmp23_ = value;
		_tmp24_ = soy_atoms_position_get_z (_tmp23_);
		_tmp25_ = _tmp24_;
		_tmp5_ = ((gfloat) _tmp22_) != _tmp25_;
	}
	_tmp26_ = _tmp5_;
	if (_tmp26_) {
		soyatomsPosition* _tmp27_;
		dxVector3* _tmp31_;
		dReal _tmp32_;
		dxVector3* _tmp33_;
		dReal _tmp34_;
		dxVector3* _tmp35_;
		dReal _tmp36_;
		soyatomsPosition* _tmp37_;
		soyatomsPosition* _tmp38_;
		soyatomsPosition* _tmp39_;
		soyatomsPosition* _tmp40_;
		_tmp27_ = value;
		if (_tmp27_ != NULL) {
			soyatomsPosition* _tmp28_;
			guint _tmp29_ = 0U;
			soyatomsPosition* _tmp30_;
			_tmp28_ = self->priv->_anchor_obj;
			g_signal_parse_name ("on-set", SOY_ATOMS_TYPE_POSITION, &_tmp29_, NULL, FALSE);
			g_signal_handlers_disconnect_matched (_tmp28_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp29_, 0, NULL, (GCallback) __soy_joints_universal_anchor_set_soy_atoms_position_on_set, self);
			_tmp30_ = self->priv->_anchor_obj;
			g_object_weak_unref ((GObject*) _tmp30_, __soy_joints_universal_anchor_weak_gweak_notify, self);
		}
		_tmp31_ = v;
		_tmp32_ = _tmp31_->x;
		_tmp33_ = v;
		_tmp34_ = _tmp33_->y;
		_tmp35_ = v;
		_tmp36_ = _tmp35_->z;
		_tmp37_ = soy_atoms_position_new ((gfloat) _tmp32_, (gfloat) _tmp34_, (gfloat) _tmp36_);
		_g_object_unref0 (value);
		value = _tmp37_;
		_tmp38_ = value;
		g_signal_connect_object (_tmp38_, "on-set", (GCallback) __soy_joints_universal_anchor_set_soy_atoms_position_on_set, self, 0);
		_tmp39_ = value;
		g_object_weak_ref ((GObject*) _tmp39_, __soy_joints_universal_anchor_weak_gweak_notify, self);
		_tmp40_ = value;
		self->priv->_anchor_obj = _tmp40_;
	}
	result = value;
	_dvector3_free0 (v);
	return result;
}
Exemplo n.º 9
0
static void soy_joints_universal_real_setup (soyjointsJoint* base, soyatomsPosition* anchor, soyatomsAxis* axis1, soyatomsAxis* axis2) {
	soyjointsUniversal * self;
	struct dxJoint* _tmp0_;
	soyatomsPosition* _tmp1_;
	gfloat _tmp2_;
	gfloat _tmp3_;
	soyatomsPosition* _tmp4_;
	gfloat _tmp5_;
	gfloat _tmp6_;
	soyatomsPosition* _tmp7_;
	gfloat _tmp8_;
	gfloat _tmp9_;
	struct dxJoint* _tmp10_;
	soyatomsAxis* _tmp11_;
	gfloat _tmp12_;
	gfloat _tmp13_;
	soyatomsAxis* _tmp14_;
	gfloat _tmp15_;
	gfloat _tmp16_;
	soyatomsAxis* _tmp17_;
	gfloat _tmp18_;
	gfloat _tmp19_;
	struct dxJoint* _tmp20_;
	soyatomsAxis* _tmp21_;
	gfloat _tmp22_;
	gfloat _tmp23_;
	soyatomsAxis* _tmp24_;
	gfloat _tmp25_;
	gfloat _tmp26_;
	soyatomsAxis* _tmp27_;
	gfloat _tmp28_;
	gfloat _tmp29_;
	self = (soyjointsUniversal*) base;
	_tmp0_ = ((soyjointsJoint*) self)->joint;
	_tmp1_ = anchor;
	_tmp2_ = soy_atoms_position_get_x (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = anchor;
	_tmp5_ = soy_atoms_position_get_y (_tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = anchor;
	_tmp8_ = soy_atoms_position_get_z (_tmp7_);
	_tmp9_ = _tmp8_;
	dJointSetUniversalAnchor ((struct dxJoint*) _tmp0_, (dReal) _tmp3_, (dReal) _tmp6_, (dReal) _tmp9_);
	_tmp10_ = ((soyjointsJoint*) self)->joint;
	_tmp11_ = axis1;
	_tmp12_ = soy_atoms_axis_get_x (_tmp11_);
	_tmp13_ = _tmp12_;
	_tmp14_ = axis1;
	_tmp15_ = soy_atoms_axis_get_y (_tmp14_);
	_tmp16_ = _tmp15_;
	_tmp17_ = axis1;
	_tmp18_ = soy_atoms_axis_get_z (_tmp17_);
	_tmp19_ = _tmp18_;
	dJointSetUniversalAxis1 ((struct dxJoint*) _tmp10_, (dReal) _tmp13_, (dReal) _tmp16_, (dReal) _tmp19_);
	_tmp20_ = ((soyjointsJoint*) self)->joint;
	_tmp21_ = axis2;
	_tmp22_ = soy_atoms_axis_get_x (_tmp21_);
	_tmp23_ = _tmp22_;
	_tmp24_ = axis2;
	_tmp25_ = soy_atoms_axis_get_y (_tmp24_);
	_tmp26_ = _tmp25_;
	_tmp27_ = axis2;
	_tmp28_ = soy_atoms_axis_get_z (_tmp27_);
	_tmp29_ = _tmp28_;
	dJointSetUniversalAxis2 ((struct dxJoint*) _tmp20_, (dReal) _tmp23_, (dReal) _tmp26_, (dReal) _tmp29_);
}
Exemplo n.º 10
0
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;
}
Exemplo n.º 11
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"
}
Exemplo n.º 12
0
soyatomsPosition* soy_joints_hinge_get_anchor (soyjointsHinge* self) {
	soyatomsPosition* result;
	dxVector3* v = NULL;
	dxVector3* _tmp0_ = NULL;
	struct dxJoint* _tmp1_ = NULL;
	dxVector3* _tmp2_ = NULL;
	soyatomsPosition* value = NULL;
	soyatomsPosition* _tmp3_ = NULL;
	soyatomsPosition* _tmp4_ = NULL;
	gboolean _tmp5_ = FALSE;
	gboolean _tmp6_ = FALSE;
	gboolean _tmp7_ = FALSE;
	soyatomsPosition* _tmp8_ = NULL;
	gboolean _tmp14_ = FALSE;
	gboolean _tmp20_ = FALSE;
	gboolean _tmp26_ = FALSE;
#line 62 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	g_return_val_if_fail (self != NULL, NULL);
#line 63 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	_tmp0_ = dvector3_new ();
#line 63 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	v = _tmp0_;
#line 64 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	_tmp1_ = ((soyjointsJoint*) self)->joint;
#line 64 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	_tmp2_ = v;
#line 64 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	dJointGetHingeAnchor ((struct dxJoint*) _tmp1_, _tmp2_);
#line 65 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	_tmp3_ = self->priv->_anchor_obj;
#line 65 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	_tmp4_ = _g_object_ref0 (_tmp3_);
#line 65 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	value = _tmp4_;
#line 66 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	_tmp8_ = value;
#line 66 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	if (_tmp8_ == NULL) {
#line 66 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
		_tmp7_ = TRUE;
#line 513 "Hinge.c"
	} else {
		dxVector3* _tmp9_ = NULL;
		dReal _tmp10_ = 0.0;
		soyatomsPosition* _tmp11_ = NULL;
		gfloat _tmp12_ = 0.0F;
		gfloat _tmp13_ = 0.0F;
#line 66 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
		_tmp9_ = v;
#line 66 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
		_tmp10_ = _tmp9_->x;
#line 66 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
		_tmp11_ = value;
#line 66 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
		_tmp12_ = soy_atoms_position_get_x (_tmp11_);
#line 66 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
		_tmp13_ = _tmp12_;
#line 66 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
		_tmp7_ = ((gfloat) _tmp10_) != _tmp13_;
#line 532 "Hinge.c"
	}
#line 66 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	_tmp14_ = _tmp7_;
#line 66 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	if (_tmp14_) {
#line 66 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
		_tmp6_ = TRUE;
#line 540 "Hinge.c"
	} else {
		dxVector3* _tmp15_ = NULL;
		dReal _tmp16_ = 0.0;
		soyatomsPosition* _tmp17_ = NULL;
		gfloat _tmp18_ = 0.0F;
		gfloat _tmp19_ = 0.0F;
#line 67 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
		_tmp15_ = v;
#line 67 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
		_tmp16_ = _tmp15_->y;
#line 67 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
		_tmp17_ = value;
#line 67 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
		_tmp18_ = soy_atoms_position_get_y (_tmp17_);
#line 67 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
		_tmp19_ = _tmp18_;
#line 67 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
		_tmp6_ = ((gfloat) _tmp16_) != _tmp19_;
#line 559 "Hinge.c"
	}
#line 66 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	_tmp20_ = _tmp6_;
#line 66 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	if (_tmp20_) {
#line 66 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
		_tmp5_ = TRUE;
#line 567 "Hinge.c"
	} else {
		dxVector3* _tmp21_ = NULL;
		dReal _tmp22_ = 0.0;
		soyatomsPosition* _tmp23_ = NULL;
		gfloat _tmp24_ = 0.0F;
		gfloat _tmp25_ = 0.0F;
#line 67 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
		_tmp21_ = v;
#line 67 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
		_tmp22_ = _tmp21_->z;
#line 67 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
		_tmp23_ = value;
#line 67 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
		_tmp24_ = soy_atoms_position_get_z (_tmp23_);
#line 67 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
		_tmp25_ = _tmp24_;
#line 67 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
		_tmp5_ = ((gfloat) _tmp22_) != _tmp25_;
#line 586 "Hinge.c"
	}
#line 66 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	_tmp26_ = _tmp5_;
#line 66 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	if (_tmp26_) {
#line 592 "Hinge.c"
		soyatomsPosition* _tmp27_ = NULL;
		dxVector3* _tmp31_ = NULL;
		dReal _tmp32_ = 0.0;
		dxVector3* _tmp33_ = NULL;
		dReal _tmp34_ = 0.0;
		dxVector3* _tmp35_ = NULL;
		dReal _tmp36_ = 0.0;
		soyatomsPosition* _tmp37_ = NULL;
		soyatomsPosition* _tmp38_ = NULL;
		soyatomsPosition* _tmp39_ = NULL;
		soyatomsPosition* _tmp40_ = NULL;
#line 68 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
		_tmp27_ = value;
#line 68 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
		if (_tmp27_ != NULL) {
#line 608 "Hinge.c"
			soyatomsPosition* _tmp28_ = NULL;
			guint _tmp29_ = 0U;
			soyatomsPosition* _tmp30_ = NULL;
#line 69 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
			_tmp28_ = self->priv->_anchor_obj;
#line 69 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
			g_signal_parse_name ("on-set", SOY_ATOMS_TYPE_POSITION, &_tmp29_, NULL, FALSE);
#line 69 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
			g_signal_handlers_disconnect_matched (_tmp28_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp29_, 0, NULL, (GCallback) __soy_joints_hinge_anchor_set_soy_atoms_position_on_set, self);
#line 70 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
			_tmp30_ = self->priv->_anchor_obj;
#line 70 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
			g_object_weak_unref ((GObject*) _tmp30_, __soy_joints_hinge_anchor_weak_gweak_notify, self);
#line 622 "Hinge.c"
		}
#line 71 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
		_tmp31_ = v;
#line 71 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
		_tmp32_ = _tmp31_->x;
#line 71 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
		_tmp33_ = v;
#line 71 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
		_tmp34_ = _tmp33_->y;
#line 71 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
		_tmp35_ = v;
#line 71 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
		_tmp36_ = _tmp35_->z;
#line 71 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
		_tmp37_ = soy_atoms_position_new ((gfloat) _tmp32_, (gfloat) _tmp34_, (gfloat) _tmp36_);
#line 71 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
		_g_object_unref0 (value);
#line 71 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
		value = _tmp37_;
#line 74 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
		_tmp38_ = value;
#line 74 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
		g_signal_connect_object (_tmp38_, "on-set", (GCallback) __soy_joints_hinge_anchor_set_soy_atoms_position_on_set, self, 0);
#line 75 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
		_tmp39_ = value;
#line 75 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
		g_object_weak_ref ((GObject*) _tmp39_, __soy_joints_hinge_anchor_weak_gweak_notify, self);
#line 76 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
		_tmp40_ = value;
#line 76 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
		self->priv->_anchor_obj = _tmp40_;
#line 654 "Hinge.c"
	}
#line 77 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	result = value;
#line 77 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	_dvector3_free0 (v);
#line 77 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	return result;
#line 662 "Hinge.c"
}
Exemplo n.º 13
0
static void soy_joints_hinge_real_setup (soyjointsJoint* base, soyatomsPosition* anchor, soyatomsAxis* axis1, soyatomsAxis* axis2) {
	soyjointsHinge * self;
	struct dxJoint* _tmp0_ = NULL;
	soyatomsPosition* _tmp1_ = NULL;
	gfloat _tmp2_ = 0.0F;
	gfloat _tmp3_ = 0.0F;
	soyatomsPosition* _tmp4_ = NULL;
	gfloat _tmp5_ = 0.0F;
	gfloat _tmp6_ = 0.0F;
	soyatomsPosition* _tmp7_ = NULL;
	gfloat _tmp8_ = 0.0F;
	gfloat _tmp9_ = 0.0F;
	struct dxJoint* _tmp10_ = NULL;
	soyatomsAxis* _tmp11_ = NULL;
	gfloat _tmp12_ = 0.0F;
	gfloat _tmp13_ = 0.0F;
	soyatomsAxis* _tmp14_ = NULL;
	gfloat _tmp15_ = 0.0F;
	gfloat _tmp16_ = 0.0F;
	soyatomsAxis* _tmp17_ = NULL;
	gfloat _tmp18_ = 0.0F;
	gfloat _tmp19_ = 0.0F;
#line 33 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	self = (soyjointsHinge*) base;
#line 35 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	_tmp0_ = ((soyjointsJoint*) self)->joint;
#line 35 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	_tmp1_ = anchor;
#line 35 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	_tmp2_ = soy_atoms_position_get_x (_tmp1_);
#line 35 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	_tmp3_ = _tmp2_;
#line 35 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	_tmp4_ = anchor;
#line 35 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	_tmp5_ = soy_atoms_position_get_y (_tmp4_);
#line 35 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	_tmp6_ = _tmp5_;
#line 35 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	_tmp7_ = anchor;
#line 35 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	_tmp8_ = soy_atoms_position_get_z (_tmp7_);
#line 35 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	_tmp9_ = _tmp8_;
#line 35 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	dJointSetHingeAnchor ((struct dxJoint*) _tmp0_, (dReal) _tmp3_, (dReal) _tmp6_, (dReal) _tmp9_);
#line 38 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	_tmp10_ = ((soyjointsJoint*) self)->joint;
#line 38 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	_tmp11_ = axis1;
#line 38 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	_tmp12_ = soy_atoms_axis_get_x (_tmp11_);
#line 38 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	_tmp13_ = _tmp12_;
#line 38 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	_tmp14_ = axis1;
#line 38 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	_tmp15_ = soy_atoms_axis_get_y (_tmp14_);
#line 38 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	_tmp16_ = _tmp15_;
#line 38 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	_tmp17_ = axis1;
#line 38 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	_tmp18_ = soy_atoms_axis_get_z (_tmp17_);
#line 38 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	_tmp19_ = _tmp18_;
#line 38 "/home/jeff/Documents/libraries/libsoy/src/joints/Hinge.gs"
	dJointSetHingeAxis ((struct dxJoint*) _tmp10_, (dReal) _tmp13_, (dReal) _tmp16_, (dReal) _tmp19_);
#line 319 "Hinge.c"
}
Exemplo n.º 14
0
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_);
}