Exemplo n.º 1
0
GLC_Plane::GLC_Plane(const GLC_Vector3d& normal, const GLC_Point3d& point)
{
	m_Eq[0]= normal.x();
	m_Eq[1]= normal.y();
	m_Eq[2]= normal.z();
	m_Eq[3]= -normal * point;
}
Exemplo n.º 2
0
GLC_Plane::GLC_Plane(const GLC_Vector3d& normal, double d)
{
	m_Eq[0]= normal.x();
	m_Eq[1]= normal.y();
	m_Eq[2]= normal.z();
	m_Eq[3]= d;
}
Exemplo n.º 3
0
GLC_Plane::GLC_Plane(const GLC_Point3d& p1, const GLC_Point3d& p2, const GLC_Point3d& p3)
{
	const GLC_Vector3d v1(p2 - p1);
	const GLC_Vector3d v2(p3 - p1);
	const GLC_Vector3d normal((v1 ^ v2).normalize());
	m_Eq[0]= normal.x();
	m_Eq[1]= normal.y();
	m_Eq[2]= normal.z();
	m_Eq[3]= -normal * p1;
}
Exemplo n.º 4
0
bool GLC_Interpolator::CalcInterpolLineaireMat(void)
{

	const GLC_Vector3d VectTrans= (m_EndPoint - m_StartPoint) * (1.0 / m_StepCount);
	if(VectTrans.isNull())
	{
		m_InterpolMat.setToIdentity();
		return false;
	}
	else
	{
		m_InterpolMat.setMatTranslate(VectTrans);
		return true;
	}
}
Exemplo n.º 5
0
// Calcul la matrice d'interpolation linéaire
bool GLC_Interpolator::CalcInterpolLineaireMat(void)
{

	// Calcul la matrice de translation
	const GLC_Vector3d VectTrans= (m_VectArrive - m_VectDepart) * (1.0 / m_nNbrPas);
	if(VectTrans.isNull())
	{
		//TRACE("GLC_Interpolator::CalcInterpolLineaireMat -> Translation NULL\n");
		m_InterpolMat.setToIdentity();
		return false;
	}
	else
	{
		m_InterpolMat.setMatTranslate(VectTrans);
		return true;
	}
}
Exemplo n.º 6
0
bool glc::compare(const GLC_Vector3d& v1, const GLC_Vector3d& v2, double accuracy)
{
    bool compareResult= (qAbs(v1.x() - v2.x()) <= accuracy);
    compareResult= compareResult && (qAbs(v1.y() - v2.y()) <= accuracy);
    compareResult= compareResult && (qAbs(v1.z() - v2.z()) <= accuracy);

    return compareResult;
}
Exemplo n.º 7
0
bool glc::compare(const GLC_Vector3d& v1, const GLC_Vector3d& v2)
{
	bool compareResult= (qAbs(v1.x() - v2.x()) <= comparedPrecision);
	compareResult= compareResult && (qAbs(v1.y() - v2.y()) <= comparedPrecision);
	compareResult= compareResult && (qAbs(v1.z() - v2.z()) <= comparedPrecision);

	return compareResult;
}
Exemplo n.º 8
0
GLC_Vector3d round(const GLC_Vector3d& vector, double accuracy)
{
    GLC_Vector3d subject(glc::round(vector.x(), accuracy), glc::round(vector.y(), accuracy), glc::round(vector.z(), accuracy));

    return subject;
}
Exemplo n.º 9
0
GLC_Vector3d round(const GLC_Vector3d& vector)
{
	GLC_Vector3d subject(glc::round(vector.x()), glc::round(vector.y()), glc::round(vector.z()));

	return subject;
}