Esempio n. 1
0
	static vec3_t RotateZ(K rot_sin, K rot_cos, const vec3_t& v) {
		return vec3_t {
			rot_cos*v.x() - rot_sin*v.y(),
			rot_sin*v.x() + rot_cos*v.y(),
			v.z()
		};
	}
Esempio n. 2
0
	vec2_t projectCameraOnRetina(const vec3_t& x_cam) const {
		const float q = retina_proj_param_ / x_cam.z();
		return q * vec2_t(x_cam.x(), x_cam.y());
	}
Esempio n. 3
0
	/** Checks if a point in camera coordinates is visible by the retina */
	bool isVisible(const vec3_t& pos) const {
		const int ix = static_cast<int>(pos.x() / pos.z() * retina_proj_param_);
		const int iy = static_cast<int>(pos.y() / pos.z() * retina_proj_param_);
		return -RETINA_SIZE/2 <= ix && ix <= RETINA_SIZE/2
			&& -RETINA_SIZE/2 <= iy && iy <= RETINA_SIZE/2;
	}