
object Vector
{
	var x, y, z;
	
	method operator_add(a, b) {
		return new Vector(a.x .+ b.x, a.y .+ b.y, a.z .+ b.z);
	}
	
	method operator_sub(a, b) {
		return new Vector(a.x .- b.x, a.y .- b.y, a.z .- b.z);
	}
	
	method init(_x, _y, _z) {
		x = _x;
		y = _y;
		z = _z;
		return this;
	}
}

object QCO
{
	var id, ref;
	
	method getattr(@args)
	{
		return $getAttribute(ref, @args);
	}
	
	method getpos()
	{
		return new Vector($getPositionX(ref), $getPositionY(ref), $getPositionZ(ref));
	}

	method getrot()
	{
		return new Vector($getPositionH(ref), $getPositionP(ref), $getPositionR(ref));
	}
	
	method setpos(v)
	{
		return $setPosition(ref, v.x, v.y, v.z, $getPositionH(ref), $getPositionP(ref), $getPositionR(ref));
	}
	
	method setrot(r)
	{
		return $setPosition(ref, $getPositionX(ref), $getPositionY(ref), $getPositionZ(ref), r.x, r.y, r.z);
	}

	method rotate(r)
	{
		return $Rotate(ref, r.x, r.y, r.z);
	}

	method move(v)
	{
		return setpos(getpos() (+) v);
	}

	method getpos_x() { return $getPositionX(ref); }
	method getpos_y() { return $getPositionY(ref); }
	method getpos_z() { return $getPositionZ(ref); }

	method getrot_h() { return $getPositionH(ref); }
	method getrot_p() { return $getPositionP(ref); }
	method getrot_r() { return $getPositionR(ref); }

	method setsequence(s,m)
	{
		return $setSequence(ref, s, m);
	}

	method Ref()
	{
		return ref;
	}

	method init(_id)
	{
		id = _id;
		ref = getRef(id);
		return this;
	}
}

