OgrePlane.h
Go to the documentation of this file.
/*
-----------------------------------------------------------------------------
This source file is part of OGRE
(Object-oriented Graphics Rendering Engine)
For the latest info, see http://www.ogre3d.org/
Copyright (c) 2000-2013 Torus Knot Software Ltd
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-----------------------------------------------------------------------------
*/
// This file is based on material originally from:
// Geometric Tools, LLC
// Copyright (c) 1998-2010
// Distributed under the Boost Software License, Version 1.0.
// http://www.boost.org/LICENSE_1_0.txt
// http://www.geometrictools.com/License/Boost/LICENSE_1_0.txt
#ifndef __Plane_H__
#define __Plane_H__
#include "OgrePrerequisites.h"
#include "OgreVector3.h"
namespace Ogre {
class _OgreExport Plane
{
public:
Plane ();
Plane (const Plane& rhs);
Plane (const Vector3& rkNormal, Real fConstant);
Plane (Real a, Real b, Real c, Real d);
Plane (const Vector3& rkNormal, const Vector3& rkPoint);
Plane (const Vector3& rkPoint0, const Vector3& rkPoint1,
const Vector3& rkPoint2);
enum Side
{
NO_SIDE,
POSITIVE_SIDE,
NEGATIVE_SIDE,
BOTH_SIDE
};
Side getSide (const Vector3& rkPoint) const;
Side getSide (const AxisAlignedBox& rkBox) const;
Side getSide (const Vector3& centre, const Vector3& halfSize) const;
Real getDistance (const Vector3& rkPoint) const;
void redefine(const Vector3& rkPoint0, const Vector3& rkPoint1,
const Vector3& rkPoint2);
void redefine(const Vector3& rkNormal, const Vector3& rkPoint);
Vector3 projectVector(const Vector3& v) const;
Real normalise(void);
Vector3 normal;
Real d;
bool operator==(const Plane& rhs) const
{
return (rhs.d == d && rhs.normal == normal);
}
bool operator!=(const Plane& rhs) const
{
return (rhs.d != d || rhs.normal != normal);
}
_OgreExport friend std::ostream& operator<< (std::ostream& o, const Plane& p);
};
typedef vector<Plane>::type PlaneList;
} // namespace Ogre
#endif
Ogre::PlaneList
vector< Plane >::type PlaneList
Definition: OgrePlane.h:160
OgreVector3.h
_OgreExport
#define _OgreExport
Definition: OgrePlatform.h:257
Ogre::Real
float Real
Software floating point type.
Definition: OgrePrerequisites.h:70
Ogre::Plane::normal
Vector3 normal
Definition: OgrePlane.h:144
Ogre::Plane
Defines a plane in 3D space.
Definition: OgrePlane.h:61
Ogre::Plane::d
Real d
Definition: OgrePlane.h:145
Ogre::Vector3
Standard 3-dimensional vector.
Definition: OgreVector3.h:51
Ogre::Plane::Side
Side
The "positive side" of the plane is the half space to which the plane normal points.
Definition: OgrePlane.h:80
OgrePrerequisites.h
Ogre::operator<<
std::ostream & operator<<(std::ostream &o, const TRect< T > &r)
Definition: OgreCommon.h:636
Ogre::Plane::operator==
bool operator==(const Plane &rhs) const
Comparison operator.
Definition: OgrePlane.h:148
Ogre
Definition: OgreAndroidLogListener.h:34
Ogre::Plane::POSITIVE_SIDE
Definition: OgrePlane.h:83
Ogre::vector
Definition: OgrePrerequisites.h:491
Ogre::Plane::NEGATIVE_SIDE
Definition: OgrePlane.h:84
Ogre::Plane::operator!=
bool operator!=(const Plane &rhs) const
Definition: OgrePlane.h:152
Ogre::AxisAlignedBox
A 3D box aligned with the x/y/z axes.
Definition: OgreAxisAlignedBox.h:54
Ogre::Plane::NO_SIDE
Definition: OgrePlane.h:82

Copyright © 2012 Torus Knot Software Ltd
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.