//GetAxis
		Vector3 JointSlider::GetAxis(void)
		{
			Vector3 retVal;
			dVector3 temp;
			dJointGetSliderAxis(this->_id, temp);
			retVal.x = temp[0];
			retVal.y = temp[1];
			retVal.z = temp[2];
			return retVal;
		}
Exemple #2
0
static void get_phys_joint_axis_1(dJointID j, float *v)
{
    dVector3 V = { 0, 0, 0 };

    switch (dJointGetType(j))
    {
    case dJointTypeHinge:     dJointGetHingeAxis     (j, V); break;
    case dJointTypeSlider:    dJointGetSliderAxis    (j, V); break;
    case dJointTypeHinge2:    dJointGetHinge2Axis1   (j, V); break;
    case dJointTypeUniversal: dJointGetUniversalAxis1(j, V); break;
    default: break;
    }

    v[0] = (float) V[0];
    v[1] = (float) V[1];
    v[2] = (float) V[2];
}
Exemple #3
0
/**
*@brief 位置更新の関数
*/
void ODEJointObj::UpdateJointPosition()
{
	ms->mu->lock();
	if(JointType == 0)
	{
		dVector3 P;
		dJointGetSliderAxis(joint, P);

	}
	else if(JointType == 2)
	{
		dVector3 P;
		dJointGetHingeAnchor(joint, P);
		SetPosition(bscale_x*P[0] + offx, bscale_y*P[1] + offy, bscale_z*P[2] + offz);
		dJointGetHingeAxis(joint, P);

	}
	ms->mu->unlock();
}
Exemple #4
0
soyatomsAxis* soy_joints_slider_get_axis (soyjointsSlider* self) {
	soyatomsAxis* result;
	dxVector3* _tmp0_;
	dxVector3* v;
	struct dxJoint* _tmp1_;
	dxVector3* _tmp2_;
	soyatomsAxis* _tmp3_;
	soyatomsAxis* _tmp4_;
	soyatomsAxis* value;
	gboolean _tmp5_ = FALSE;
	gboolean _tmp6_ = FALSE;
	gboolean _tmp7_ = FALSE;
	soyatomsAxis* _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;
	dJointGetSliderAxis ((struct dxJoint*) _tmp1_, _tmp2_);
	_tmp3_ = self->priv->_axis_obj;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	value = _tmp4_;
	_tmp8_ = value;
	if (_tmp8_ == NULL) {
		_tmp7_ = TRUE;
	} else {
		dxVector3* _tmp9_;
		dReal _tmp10_;
		soyatomsAxis* _tmp11_;
		gfloat _tmp12_;
		gfloat _tmp13_;
		_tmp9_ = v;
		_tmp10_ = _tmp9_->x;
		_tmp11_ = value;
		_tmp12_ = soy_atoms_axis_get_x (_tmp11_);
		_tmp13_ = _tmp12_;
		_tmp7_ = ((gfloat) _tmp10_) != _tmp13_;
	}
	_tmp14_ = _tmp7_;
	if (_tmp14_) {
		_tmp6_ = TRUE;
	} else {
		dxVector3* _tmp15_;
		dReal _tmp16_;
		soyatomsAxis* _tmp17_;
		gfloat _tmp18_;
		gfloat _tmp19_;
		_tmp15_ = v;
		_tmp16_ = _tmp15_->y;
		_tmp17_ = value;
		_tmp18_ = soy_atoms_axis_get_y (_tmp17_);
		_tmp19_ = _tmp18_;
		_tmp6_ = ((gfloat) _tmp16_) != _tmp19_;
	}
	_tmp20_ = _tmp6_;
	if (_tmp20_) {
		_tmp5_ = TRUE;
	} else {
		dxVector3* _tmp21_;
		dReal _tmp22_;
		soyatomsAxis* _tmp23_;
		gfloat _tmp24_;
		gfloat _tmp25_;
		_tmp21_ = v;
		_tmp22_ = _tmp21_->z;
		_tmp23_ = value;
		_tmp24_ = soy_atoms_axis_get_z (_tmp23_);
		_tmp25_ = _tmp24_;
		_tmp5_ = ((gfloat) _tmp22_) != _tmp25_;
	}
	_tmp26_ = _tmp5_;
	if (_tmp26_) {
		soyatomsAxis* _tmp27_;
		dxVector3* _tmp31_;
		dReal _tmp32_;
		dxVector3* _tmp33_;
		dReal _tmp34_;
		dxVector3* _tmp35_;
		dReal _tmp36_;
		soyatomsAxis* _tmp37_;
		soyatomsAxis* _tmp38_;
		soyatomsAxis* _tmp39_;
		soyatomsAxis* _tmp40_;
		_tmp27_ = value;
		if (_tmp27_ != NULL) {
			soyatomsAxis* _tmp28_;
			guint _tmp29_ = 0U;
			soyatomsAxis* _tmp30_;
			_tmp28_ = self->priv->_axis_obj;
			g_signal_parse_name ("on-set", SOY_ATOMS_TYPE_AXIS, &_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_slider_axis_set_soy_atoms_axis_on_set, self);
			_tmp30_ = self->priv->_axis_obj;
			g_object_weak_unref ((GObject*) _tmp30_, __soy_joints_slider_axis_weak_gweak_notify, self);
		}
		_tmp31_ = v;
		_tmp32_ = _tmp31_->x;
		_tmp33_ = v;
		_tmp34_ = _tmp33_->y;
		_tmp35_ = v;
		_tmp36_ = _tmp35_->z;
		_tmp37_ = soy_atoms_axis_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_slider_axis_set_soy_atoms_axis_on_set, self, 0);
		_tmp39_ = value;
		g_object_weak_ref ((GObject*) _tmp39_, __soy_joints_slider_axis_weak_gweak_notify, self);
		_tmp40_ = value;
		self->priv->_axis_obj = _tmp40_;
	}
	result = value;
	_dvector3_free0 (v);
	return result;
}