include/shapes.h
branchpyrit
changeset 84 6f7fe14782c2
parent 82 930a2d3ecaed
child 85 907a634e5c02
--- a/include/shapes.h	Thu Apr 24 18:12:32 2008 +0200
+++ b/include/shapes.h	Sun Apr 27 09:44:49 2008 +0200
@@ -55,6 +55,14 @@
 	// first intersection point
 	virtual bool intersect(const Ray &ray, Float &dist) const = 0;
 
+	virtual void intersect_packet(const RayPacket &rays, __m128 &dists, bool *results)
+	{
+		results[0] = intersect(rays[0], ((float*)&dists)[0]);
+		results[1] = intersect(rays[1], ((float*)&dists)[1]);
+		results[2] = intersect(rays[2], ((float*)&dists)[2]);
+		results[3] = intersect(rays[3], ((float*)&dists)[3]);
+	};
+
 	// all intersections (only for CSG)
 	virtual bool intersect_all(const Ray &ray, Float dist, vector<Float> &allts) const = 0;
 
@@ -95,7 +103,7 @@
 	const Vector3 normal(const Vector3 &P) const { return (P - center) * inv_radius; };
 	BBox get_bbox() const;
 	const Vector3 getCenter() const { return center; };
-	const Float getRadius() const { return radius; };
+	Float getRadius() const { return radius; };
 	ostream & dump(ostream &st) const;
 };