Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Classes principales  ·  Annotées  ·  Classes groupées  ·  Modules  ·  Fonctions  · 

QPlane3D Class

The QPlane3D class models the mathematics of planes in 3D space. More...

 #include <QPlane3D>

This class was introduced in Qt 4.8.

Public Functions

QPlane3D()
QPlane3D(const QVector3D & point, const QVector3D & normal)
QPlane3D(const QVector3D & p, const QVector3D & q, const QVector3D & r)
bool contains(const QVector3D & point) const
bool contains(const QRay3D & ray) const
qreal distanceTo(const QVector3D & point) const
qreal intersection(const QRay3D & ray) const
bool intersects(const QRay3D & ray) const
QVector3D normal() const
QVector3D origin() const
void setNormal(const QVector3D & value)
void setOrigin(const QVector3D & value)
void transform(const QMatrix4x4 & matrix)
QPlane3D transformed(const QMatrix4x4 & matrix) const
bool operator!=(const QPlane3D & other)
bool operator==(const QPlane3D & other)

Related Non-Members

bool qFuzzyCompare(const QPlane3D & plane1, const QPlane3D & plane2)

Detailed Description

The QPlane3D class models the mathematics of planes in 3D space.

A plane is defined by an origin() point lying on the plane, and a normal() vector, which is perpendicular to the surface of the plane. The normal() vector does not need to be normalized. QPlane3D is an infinite surface, from which the normal() vector points out perpendicular from the origin() point.

See also QRay3D.

Member Function Documentation

QPlane3D::QPlane3D()

Constructs a default plane object. The defining origin() of the plane is set to (0, 0, 0) and the normal() vector is to (1, 0, 0).

QPlane3D::QPlane3D(const QVector3D & point, const QVector3D & normal)

Constructs a new plane, where point lies on the plane, and normal is perpendicular to it. The normal does not have to be normalized. If normal is zero, the behavior of the plane is undefined.

QPlane3D::QPlane3D(const QVector3D & p, const QVector3D & q, const QVector3D & r)

Constructs a new plane defined by the three points p, q, and r. The point p is used as the plane's origin() point, and a normal() is constructed from the cross-product of q - p and r - q.

bool QPlane3D::contains(const QVector3D & point) const

Returns true if point lies in this plane; false otherwise.

bool QPlane3D::contains(const QRay3D & ray) const

Returns true if all of the points on ray lie in this plane; false otherwise.

qreal QPlane3D::distanceTo(const QVector3D & point) const

Returns the distance from this plane to point. The value will be positive if point is above the plane in the direction of normal(), and negative if point is below the plane.

qreal QPlane3D::intersection(const QRay3D & ray) const

Returns the t value at which ray intersects this plane, or not-a-number if there is no intersection.

When the ray intersects this plane, the return value is a parametric value that can be passed to QRay3D::point() to determine the actual intersection point, as shown in the following example:

 qreal t = plane.intersection(ray);
 QVector3D pt;
 if (qIsNaN(t)) {
     qWarning("no intersection occurred");
 else
     pt = ray.point(t);

If the return value is positive, then the QRay3D::origin() of ray begins below the plane and then extends through it. If the return value is negative, then the origin begins above the plane.

There are two failure cases where no single intersection point exists:

  • when the ray is parallel to the plane (but does not lie on it)
  • the ray lies entirely in the plane (thus every point "intersects")

This method does not distinguish between these two failure cases and simply returns not-a-number for both.

See also intersects().

bool QPlane3D::intersects(const QRay3D & ray) const

Returns true if an intersection of ray with this plane exists; false otherwise.

See also intersection().

QVector3D QPlane3D::normal() const

Returns this plane's normal vector. The default value is (1, 0, 0).

See also setNormal() and origin().

QVector3D QPlane3D::origin() const

Returns this plane's defining origin point. The default value is (0, 0, 0).

See also setOrigin() and normal().

void QPlane3D::setNormal(const QVector3D & value)

Set this plane's normal vector to value. The value does not have to be normalized. If value is zero, the behavior of the plane is undefined.

See also normal() and setOrigin().

void QPlane3D::setOrigin(const QVector3D & value)

Set this plane's defining origin point to value.

See also origin() and setNormal().

void QPlane3D::transform(const QMatrix4x4 & matrix)

Transforms this plane using matrix, replacing origin() and normal() with the transformed versions.

See also transformed().

QPlane3D QPlane3D::transformed(const QMatrix4x4 & matrix) const

Returns a new plane that is formed by transforming origin() and normal() using matrix.

See also transform().

bool QPlane3D::operator!=(const QPlane3D & other)

Returns true if this plane is not the same as other; false otherwise.

See also operator==().

bool QPlane3D::operator==(const QPlane3D & other)

Returns true if this plane is the same as other; false otherwise.

See also operator!=().

Related Non-Members

bool qFuzzyCompare(const QPlane3D & plane1, const QPlane3D & plane2)

Returns true if plane1 and plane2 are almost equal; false otherwise.

Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt 5.0-snapshot
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web