Sfoglia il codice sorgente

Minor fixes to bv library

Daniele Bartolini 12 anni fa
parent
commit
e4299a3121

+ 6 - 6
src/core/bv/Box.h

@@ -63,22 +63,22 @@ public:
 	/// Adds @count @boxes expanding if necessay.
 	void			add_boxes(const Box* boxes, uint32_t count);
 
-	/// Returns whether point32_t "p" is contained.
+	/// Returns whether point @p is contained in the box.
 	bool			contains_point(const Vec3& p) const;
 
-	/// Returns a box's vertex.
+	/// Returns the @index -th vertex of the box.
 	Vec3			vertex(uint32_t index) const;		
 
-	/// Returns the box trasformed according to "mat" matrix.
+	/// Returns the box trasformed according to @mat matrix into @result.
 	void			transformed(const Mat4& mat, Box& result) const;	
 
-	/// Returns the eight box's vertices
+	/// Returns the eight vertices of the box.
 	void			to_vertices(Vec3 v[8]) const;	
 
-	/// Returns as a sphere						
+	/// Returns as a sphere.						
 	Sphere			to_sphere() const;										
 
-	/// Sets min and max to zero
+	/// Sets min and max to zero.
 	void			zero();													
 
 private:

+ 4 - 5
src/core/bv/Circle.h

@@ -41,22 +41,21 @@ class Circle
 {
 public:
 
-	/// Does nothing for efficiency
+	/// Does nothing for efficiency.
 					Circle();
 					
-	/// Constructs from @center and @radius
+	/// Constructs from @center and @radius.
 					Circle(const Vec2& center, real radius);	
 					Circle(const Circle& circle);				
 
 	const Vec2&		center() const;							
-	real			radius() const;				
-
+	real			radius() const;	
 	void			set_center(const Vec2& center);			
 	void			set_radius(real radius);				
 
 	real			area() const;						
 
-	/// Returns a Rect containing the circle
+	/// Returns a Rect containing the circle.
 	Rect			to_rect() const;
 
 private:

+ 0 - 6
src/core/bv/Frustum.cpp

@@ -34,12 +34,6 @@ namespace crown
 //-----------------------------------------------------------------------------
 Frustum::Frustum()
 {
-	m_planes[FP_LEFT]		= Plane::ZERO;
-	m_planes[FP_RIGHT]		= Plane::ZERO;
-	m_planes[FP_BOTTOM]		= Plane::ZERO;
-	m_planes[FP_TOP]		= Plane::ZERO;
-	m_planes[FP_NEAR]		= Plane::ZERO;
-	m_planes[FP_FAR]		= Plane::ZERO;
 }
 
 //-----------------------------------------------------------------------------

+ 5 - 4
src/core/bv/Frustum.h

@@ -49,19 +49,20 @@ class Frustum
 {
 public:
 
+	/// Does nothing for efficiency.
 				Frustum();				
 				Frustum(const Frustum& frustum);
 
-	/// Returns whether @point is contained into the frustum
+	/// Returns whether @point is contained into the frustum.
 	bool		contains_point(const Vec3& point) const;	
 
-	/// Returns one of the eight frustum's corners
+	/// Returns one of the eight frustum's corners.
 	Vec3		vertex(uint32_t index) const;			
 
-	/// Builds the view frustum according to the matrix @m
+	/// Builds the view frustum according to the matrix @m.
 	void		from_matrix(const Mat4& m);				
 
-	/// Returns a Box containing the frustum volume
+	/// Returns a Box containing the frustum volume.
 	Box			to_box() const;							
 
 private:

+ 8 - 8
src/core/bv/Rect.h

@@ -58,28 +58,28 @@ public:
 	real			radius() const;					
 	real			area() const;		
 
-	/// Returns the diagonal
+	/// Returns the diagonal of the rect.
 	Vec2			size() const;						
 
-	/// Returns whether @point is contained
+	/// Returns whether @point point is contained into the rect.
 	bool			contains_point(const Vec2& point) const;
 
-	/// Returns whether intersects @r
+	/// Returns whether the rect intersects @r.
 	bool			intersects_rect(const Rect& rect) const;	
 
-	/// Sets the Rect from a center and a width - height
+	/// Sets the Rect from a @center and a @width - @height
 	void			set_from_center_and_dimensions(Vec2 center, real width, real height);	
 
-	/// Returns the four rect's vertices
+	/// Returns the four vertices of the rect.
 	void			vertices(Vec2 v[4]) const;
 
-	/// Returns a rect's vertex
+	/// Returns the @index -th vetex of the rect.
 	Vec2			vertex(uint32_t index) const;			
 
-	/// Returns the equivalent circle
+	/// Returns the equivalent circle.
 	Circle			to_circle() const;
 
-	/// Ensures that min and max aren't swapped
+	/// Ensures that min and max aren't swapped.
 	void			fix();									
 
 private:

+ 4 - 4
src/core/bv/Sphere.h

@@ -43,7 +43,7 @@ public:
 	/// Does nothing for efficiency.
 					Sphere();
 
-	/// Constructs from center and radius.
+	/// Constructs from @center and @radius.
 					Sphere(const Vec3& center, real radius);
 					Sphere(const Sphere& a);
 
@@ -54,13 +54,13 @@ public:
 	void			set_center(const Vec3& center);
 	void			set_radius(real radius);
 
-	/// Adds a point expanding if necessary.
+	/// Adds @count @points to the sphere expanding if necessary.
 	void			add_points(const Vec3* points, uint32_t count);	
 
-	/// Adds a sphere expanding if necessary.
+	/// Adds @count @spheres expanding if necessary.
 	void			add_spheres(const Sphere* spheres, uint32_t count);	
 
-	/// Returns whether point @p is contained.
+	/// Returns whether point @p is contained into the sphere.
 	bool			contains_point(const Vec3& p) const;		
 
 private: