Ignore:
Timestamp:
Apr 11, 2013, 12:26:04 PM (11 years ago)
Author:
ldelgass
Message:

Some cleanups in vrmath lib, e.g. add copy/assignment ops

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/vizservers/nanovis/vrmath/include/vrmath/BBox.h

    r3494 r3628  
    3535    BBox(const Vector3f& min, const Vector3f& max);
    3636
     37    BBox& operator=(const BBox& other)
     38    {
     39        if (&other != this) {
     40            min = other.min;
     41            max = other.max;
     42        }
     43        return *this;
     44    }
     45
    3746    /**
    3847     * @brief make an empty bounding box
     
    5160     */
    5261    bool isEmpty();
     62    bool isEmptyX();
     63    bool isEmptyY();
     64    bool isEmptyZ();
    5365
    5466    /**
     
    6375
    6476    /**
    65      * @brief transform a bounding box with an matrix and set the bounding box
     77     * @brief transform a bounding box with a matrix and set the bounding box
    6678     */
    6779    void transform(const BBox& box, const Matrix4x4d& mat);
     
    7385
    7486    /**
    75      * @brief check if the bounding box intersect with a point
     87     * @brief check if the bounding box contains a point
    7688     */
    77     bool intersect(const Vector3f& point);
     89    bool contains(const Vector3f& point);
    7890
    7991    float getRadius() const;
     
    93105{
    94106    Vector3f temp;
    95     temp.x = (max.x+ min.x) * 0.5f;
     107    temp.x = (max.x + min.x) * 0.5f;
    96108    temp.y = (max.y + min.y) * 0.5f;
    97109    temp.z = (max.z + min.z) * 0.5f;
Note: See TracChangeset for help on using the changeset viewer.