Browse Source

Shapes: preparation for non-boolean collision queries.

pull/23/head
Vladimír Vondruš 13 years ago
parent
commit
8935d8c721
  1. 2
      Doxyfile
  2. 6
      doc/coding-style.dox
  3. 4
      src/Shapes/AxisAlignedBox.h
  4. 8
      src/Shapes/Capsule.h
  5. 8
      src/Shapes/Cylinder.h
  6. 8
      src/Shapes/Plane.h
  7. 14
      src/Shapes/Sphere.h

2
Doxyfile

@ -203,7 +203,7 @@ ALIASES = \
"debugoperator{1}=@relates \1\n@brief Debug output operator @xrefitem debugoperators \"Debug output operator\" \"Debug output operators for custom types\" Allows printing \1 with Corrade::Utility::Debug and friends." \ "debugoperator{1}=@relates \1\n@brief Debug output operator @xrefitem debugoperators \"Debug output operator\" \"Debug output operators for custom types\" Allows printing \1 with Corrade::Utility::Debug and friends." \
"configurationvalueref{1}=@see @ref configurationvalues \"Corrade::Utility::ConfigurationValue<\1>\"" \ "configurationvalueref{1}=@see @ref configurationvalues \"Corrade::Utility::ConfigurationValue<\1>\"" \
"configurationvalue{1}=@brief %Configuration value parser and writer @xrefitem configurationvalues \"Configuration value parser and writer\" \"Configuration value parsers and writers for custom types\" Allows parsing and writing \1 from and to Corrade::Utility::Configuration." \ "configurationvalue{1}=@brief %Configuration value parser and writer @xrefitem configurationvalues \"Configuration value parser and writer\" \"Configuration value parsers and writers for custom types\" Allows parsing and writing \1 from and to Corrade::Utility::Configuration." \
"collisionoperator{2}=@relates \1\n@brief Collision of %\1 and %\2\n@see \2::operator%(const \1&) const" \ "collisionoccurenceoperator{2}=@relates \1\n@brief %Collision occurence of %\1 and %\2\n@see \2::operator%(const \1&) const" \
"todoc=@xrefitem todoc \"Documentation todo\" \"Documentation-related todo list\"" \ "todoc=@xrefitem todoc \"Documentation todo\" \"Documentation-related todo list\"" \
"fn_gl{1}=<a href=\"http://www.opengl.org/sdk/docs/man4/xhtml/gl\1.xml\">gl\1()</a>" \ "fn_gl{1}=<a href=\"http://www.opengl.org/sdk/docs/man4/xhtml/gl\1.xml\">gl\1()</a>" \
"fn_gl_extension{3}=<a href=\"http://www.opengl.org/registry/specs/\2/\3.txt\">gl\1<b></b>\2()</a>" \ "fn_gl_extension{3}=<a href=\"http://www.opengl.org/registry/specs/\2/\3.txt\">gl\1<b></b>\2()</a>" \

6
doc/coding-style.dox

@ -102,10 +102,10 @@ Additionally to @c \@todoc, @c \@debugoperator @c \@configurationvalue and
@subsubsection documentation-commands-collisionoperator Shape collision operators @subsubsection documentation-commands-collisionoperator Shape collision operators
Out-of-class operators for collision in Shapes namespace should be marked with Out-of-class operators for collision occurence in Shapes namespace should be
@c \@collisionoperator, e.g.: marked with @c \@collisionoccurenceoperator, e.g.:
@code @code
// @collisionoperator{Point,Sphere} // @collisionoccurenceoperator{Point,Sphere}
inline bool operator%(const Point& a, const Sphere& b) { return b % a; } inline bool operator%(const Point& a, const Sphere& b) { return b % a; }
@endcode @endcode
They will appear as related functions within documentation of class for which They will appear as related functions within documentation of class for which

4
src/Shapes/AxisAlignedBox.h

@ -81,7 +81,7 @@ template<UnsignedInt dimensions> class MAGNUM_SHAPES_EXPORT AxisAlignedBox {
_max = max; _max = max;
} }
/** @brief Collision with point */ /** @brief %Collision occurence with point */
bool operator%(const Point<dimensions>& other) const; bool operator%(const Point<dimensions>& other) const;
private: private:
@ -94,7 +94,7 @@ typedef AxisAlignedBox<2> AxisAlignedBox2D;
/** @brief Three-dimensional axis-aligned box */ /** @brief Three-dimensional axis-aligned box */
typedef AxisAlignedBox<3> AxisAlignedBox3D; typedef AxisAlignedBox<3> AxisAlignedBox3D;
/** @collisionoperator{Point,AxisAlignedBox} */ /** @collisionoccurenceoperator{Point,AxisAlignedBox} */
template<UnsignedInt dimensions> inline bool operator%(const Point<dimensions>& a, const AxisAlignedBox<dimensions>& b) { return b % a; } template<UnsignedInt dimensions> inline bool operator%(const Point<dimensions>& a, const AxisAlignedBox<dimensions>& b) { return b % a; }
}} }}

8
src/Shapes/Capsule.h

@ -89,10 +89,10 @@ template<UnsignedInt dimensions> class MAGNUM_SHAPES_EXPORT Capsule {
/** @brief Set radius */ /** @brief Set radius */
void setRadius(Float radius) { _radius = radius; } void setRadius(Float radius) { _radius = radius; }
/** @brief Collision with point */ /** @brief %Collision occurence with point */
bool operator%(const Point<dimensions>& other) const; bool operator%(const Point<dimensions>& other) const;
/** @brief Collision with sphere */ /** @brief %Collision occurence with sphere */
bool operator%(const Sphere<dimensions>& other) const; bool operator%(const Sphere<dimensions>& other) const;
private: private:
@ -106,10 +106,10 @@ typedef Capsule<2> Capsule2D;
/** @brief Three-dimensional capsule */ /** @brief Three-dimensional capsule */
typedef Capsule<3> Capsule3D; typedef Capsule<3> Capsule3D;
/** @collisionoperator{Point,Capsule} */ /** @collisionoccurenceoperator{Point,Capsule} */
template<UnsignedInt dimensions> inline bool operator%(const Point<dimensions>& a, const Capsule<dimensions>& b) { return b % a; } template<UnsignedInt dimensions> inline bool operator%(const Point<dimensions>& a, const Capsule<dimensions>& b) { return b % a; }
/** @collisionoperator{Sphere,Capsule} */ /** @collisionoccurenceoperator{Sphere,Capsule} */
template<UnsignedInt dimensions> inline bool operator%(const Sphere<dimensions>& a, const Capsule<dimensions>& b) { return b % a; } template<UnsignedInt dimensions> inline bool operator%(const Sphere<dimensions>& a, const Capsule<dimensions>& b) { return b % a; }
}} }}

8
src/Shapes/Cylinder.h

@ -89,10 +89,10 @@ template<UnsignedInt dimensions> class MAGNUM_SHAPES_EXPORT Cylinder {
/** @brief Set radius */ /** @brief Set radius */
void setRadius(Float radius) { _radius = radius; } void setRadius(Float radius) { _radius = radius; }
/** @brief Collision with point */ /** @brief %Collision occurence with point */
bool operator%(const Point<dimensions>& other) const; bool operator%(const Point<dimensions>& other) const;
/** @brief Collision with sphere */ /** @brief %Collision occurence with sphere */
bool operator%(const Sphere<dimensions>& other) const; bool operator%(const Sphere<dimensions>& other) const;
private: private:
@ -106,10 +106,10 @@ typedef Cylinder<2> Cylinder2D;
/** @brief Infinite three-dimensional cylinder */ /** @brief Infinite three-dimensional cylinder */
typedef Cylinder<3> Cylinder3D; typedef Cylinder<3> Cylinder3D;
/** @collisionoperator{Point,Cylinder} */ /** @collisionoccurenceoperator{Point,Cylinder} */
template<UnsignedInt dimensions> inline bool operator%(const Point<dimensions>& a, const Cylinder<dimensions>& b) { return b % a; } template<UnsignedInt dimensions> inline bool operator%(const Point<dimensions>& a, const Cylinder<dimensions>& b) { return b % a; }
/** @collisionoperator{Sphere,Cylinder} */ /** @collisionoccurenceoperator{Sphere,Cylinder} */
template<UnsignedInt dimensions> inline bool operator%(const Sphere<dimensions>& a, const Cylinder<dimensions>& b) { return b % a; } template<UnsignedInt dimensions> inline bool operator%(const Sphere<dimensions>& a, const Cylinder<dimensions>& b) { return b % a; }
}} }}

8
src/Shapes/Plane.h

@ -76,20 +76,20 @@ class MAGNUM_SHAPES_EXPORT Plane {
_normal = normal; _normal = normal;
} }
/** @brief Collision with line */ /** @brief %Collision occurence with line */
bool operator%(const Line3D& other) const; bool operator%(const Line3D& other) const;
/** @brief Collision with line segment */ /** @brief %Collision occurence with line segment */
bool operator%(const LineSegment3D& other) const; bool operator%(const LineSegment3D& other) const;
private: private:
Vector3 _position, _normal; Vector3 _position, _normal;
}; };
/** @collisionoperator{Line,Plane} */ /** @collisionoccurenceoperator{Line,Plane} */
inline bool operator%(const Line3D& a, const Plane& b) { return b % a; } inline bool operator%(const Line3D& a, const Plane& b) { return b % a; }
/** @collisionoperator{LineSegment,Plane} */ /** @collisionoccurenceoperator{LineSegment,Plane} */
inline bool operator%(const LineSegment3D& a, const Plane& b) { return b % a; } inline bool operator%(const LineSegment3D& a, const Plane& b) { return b % a; }

14
src/Shapes/Sphere.h

@ -79,16 +79,16 @@ template<UnsignedInt dimensions> class MAGNUM_SHAPES_EXPORT Sphere {
/** @brief Set radius */ /** @brief Set radius */
void setRadius(Float radius) { _radius = radius; } void setRadius(Float radius) { _radius = radius; }
/** @brief Collision with point */ /** @brief %Collision occurence with point */
bool operator%(const Point<dimensions>& other) const; bool operator%(const Point<dimensions>& other) const;
/** @brief Collision with line */ /** @brief %Collision occurence with line */
bool operator%(const Line<dimensions>& other) const; bool operator%(const Line<dimensions>& other) const;
/** @brief Collision with line segment */ /** @brief %Collision occurence with line segment */
bool operator%(const LineSegment<dimensions>& other) const; bool operator%(const LineSegment<dimensions>& other) const;
/** @brief Collision with sphere */ /** @brief %Collision occurence with sphere */
bool operator%(const Sphere<dimensions>& other) const; bool operator%(const Sphere<dimensions>& other) const;
private: private:
@ -102,13 +102,13 @@ typedef Sphere<2> Sphere2D;
/** @brief Three-dimensional sphere */ /** @brief Three-dimensional sphere */
typedef Sphere<3> Sphere3D; typedef Sphere<3> Sphere3D;
/** @collisionoperator{Point,Sphere} */ /** @collisionoccurenceoperator{Point,Sphere} */
template<UnsignedInt dimensions> inline bool operator%(const Point<dimensions>& a, const Sphere<dimensions>& b) { return b % a; } template<UnsignedInt dimensions> inline bool operator%(const Point<dimensions>& a, const Sphere<dimensions>& b) { return b % a; }
/** @collisionoperator{Line,Sphere} */ /** @collisionoccurenceoperator{Line,Sphere} */
template<UnsignedInt dimensions> inline bool operator%(const Line<dimensions>& a, const Sphere<dimensions>& b) { return b % a; } template<UnsignedInt dimensions> inline bool operator%(const Line<dimensions>& a, const Sphere<dimensions>& b) { return b % a; }
/** @collisionoperator{LineSegment,Sphere} */ /** @collisionoccurenceoperator{LineSegment,Sphere} */
template<UnsignedInt dimensions> inline bool operator%(const LineSegment<dimensions>& a, const Sphere<dimensions>& b) { return b % a; } template<UnsignedInt dimensions> inline bool operator%(const LineSegment<dimensions>& a, const Sphere<dimensions>& b) { return b % a; }
}} }}

Loading…
Cancel
Save