示例#1
0
文件: vector.cpp 项目: lsempe/uipg
vector4 vector4::Transform(const vector2& v, const matrix& m)
{
	vector4 result = vector4(	
						(v.x() * m(0,0)) + (v.y() * m(1,0)) + m(3,0),
						(v.x() * m(0,1)) + (v.y() * m(1,1)) + m(3,1),
						(v.x() * m(0,2)) + (v.y() * m(1,2)) + m(3,2),
						(v.x() * m(0,3)) + (v.y() * m(1,3)) + m(3,3));
	return result;
	
}
示例#2
0
文件: vector.cpp 项目: lsempe/uipg
const vector2 vector2::operator / (const vector2 &v2) const
{
	vector2 r;
	r.x() = x() / v2.x();
	r.y() = y() / v2.y();
	return r;
}
示例#3
0
static vector2 trunk(const vector2& v, number smallestVal)
{
	vector2 t;
	t.x() = smallestVal * round(v.x() / smallestVal);
	t.y() = smallestVal * round(v.y() / smallestVal);
	return t;
}
示例#4
0
文件: vector.cpp 项目: lsempe/uipg
vector2 vector2::Transform(const vector2& v, const matrix& m)
{
	vector2 result = vector2( 
								(v.x() * m(0,0)) + (v.y() * m(0,1)) + m(3,0),
								(v.x() * m(1,0)) + (v.y() * m(1,1)) + m(3,1));
	return result;
	
}
示例#5
0
bool QtWindowSystem::init(const vector2<int>& r, int /*bpp*/, bool /*fullscreen*/)
{
	if (view_ == nullptr)
	{
		// check for Qt Application class instance
		if (QApplication::instance() == nullptr)
		{
			int argc = 0;
			static QApplication application(argc, nullptr);
		}
		view_ = new QtView;
		view_->setGeometry(0, 0, r.x(), r.y());
		set_format(WindowContextFormat());
	}

	return true;
}
示例#6
0
文件: vector.cpp 项目: lsempe/uipg
// Equality operations
bool vector2::operator == (const vector2 &v) const
{
	return ((x() == v.x()) && (y() == v.y()));
}
示例#7
0
文件: vector.cpp 项目: lsempe/uipg
// Returns the dot product of two vectors
float vector2::Dot(const vector2 &v2) const
{
	return ((x() * v2.x()) + (y() * v2.y()));
}
示例#8
0
文件: vector.cpp 项目: lsempe/uipg
vector3::vector3(const vector2& source, float z)
{ 
	v[0] = source.x(), v[1] = source.y(), v[2] = z; 
}