Visualization Library

A lightweight C++ OpenGL middleware for 2D/3D graphics
[Home] [Tutorials] [All Classes] [Grouped Classes]
Public Member Functions | Protected Attributes

vl::Plane Class Reference

The Plane class defines a plane using a normal and an origin. More...

#include <Plane.hpp>

Inheritance diagram for vl::Plane:
vl::Object

List of all members.

Public Member Functions

 Plane (real o=0.0f, vec3 n=vec3(0, 0, 0))
 Plane (const vec3 &o, const vec3 &n)
real distance (const vec3 &v) const
int classify (const AABB &) const
 returns 0 if the AABB intersects the plane, 1 if it's in the positive side, -1 if it's in the negative side.
bool isOutside (const AABB &) const
const vec3normal () const
real origin () const
void setNormal (const vec3 &normal)
void setOrigin (real origin)

Protected Attributes

vec3 mNormal
real mOrigin

Detailed Description

The Plane class defines a plane using a normal and an origin.

Definition at line 49 of file Plane.hpp.


Constructor & Destructor Documentation

vl::Plane::Plane ( real  o = 0.0f,
vec3  n = vec3(0,0,0) 
) [inline]

Definition at line 54 of file Plane.hpp.

References VL_DEBUG_SET_OBJECT_NAME.

vl::Plane::Plane ( const vec3 o,
const vec3 n 
) [inline]

Definition at line 59 of file Plane.hpp.

References vl::dot(), and VL_DEBUG_SET_OBJECT_NAME.


Member Function Documentation

real Plane::distance ( const vec3 v) const

Definition at line 40 of file Plane.cpp.

References vl::dot(), mNormal, and mOrigin.

Referenced by classify(), vl::Frustum::cull(), and isOutside().

int Plane::classify ( const AABB aabb) const

returns 0 if the AABB intersects the plane, 1 if it's in the positive side, -1 if it's in the negative side.

Definition at line 54 of file Plane.cpp.

References distance(), vl::AABB::maxCorner(), vl::AABB::minCorner(), vl::Vector3< T_Scalar >::x(), vl::Vector3< T_Scalar >::y(), and vl::Vector3< T_Scalar >::z().

Referenced by vl::ActorKdTree::insertActor().

bool Plane::isOutside ( const AABB aabb) const
const vec3& vl::Plane::normal ( ) const [inline]
real vl::Plane::origin ( ) const [inline]
void vl::Plane::setNormal ( const vec3 normal) [inline]
void vl::Plane::setOrigin ( real  origin) [inline]

Member Data Documentation

vec3 vl::Plane::mNormal [protected]

Definition at line 83 of file Plane.hpp.

Referenced by distance(), and isOutside().

real vl::Plane::mOrigin [protected]

Definition at line 84 of file Plane.hpp.

Referenced by distance().


The documentation for this class was generated from the following files:

Visualization Library 2011.09.1160 Reference Documentation
Copyright 2005-2011 Michele Bosi. All rights reserved.
Updated on Thu May 2 2013 13:41:14.
Permission is granted to use this page to write and publish articles regarding Visualization Library.