Ejemplo n.º 1
0
// HACK: this is probably a slow implementation
Vector RenderObject::getForward()
{
	Vector v = getWorldCollidePosition(Vector(0,-1, 0));
	Vector r = v - getWorldCollidePosition();
	r.normalize2D();

	/*
	std::ostringstream os;
	os << "forward v(" << v.x << ", " << v.y << ") ";
	os << "r(" << r.x << ", " << r.y << ") ";
	debugLog(os.str());
	*/
	return r;
}
Ejemplo n.º 2
0
Vector RenderObject::getWorldPositionAndRotation()
{
	Vector up = getWorldCollidePosition(Vector(0,1));
	Vector orig = getWorldPosition();
	MathFunctions::calculateAngleBetweenVectorsInDegrees(orig, up, orig.z);
	return orig;
}
Ejemplo n.º 3
0
float RenderObject::getWorldRotation()
{
	Vector up = getWorldCollidePosition(Vector(0,1));
	Vector orig = getWorldPosition();
	float rot = 0;
	MathFunctions::calculateAngleBetweenVectorsInDegrees(orig, up, rot);
	return rot;
}
Ejemplo n.º 4
0
Vector RenderObject::getWorldPosition()
{
	return getWorldCollidePosition();
}