4 #include <QtGui\qmatrix4x4.h>
42 explicit Cube(
float sideLength = 1.0f);
87 QVector<QVector4D>
transform(
const QMatrix4x4& mat)
const;
100 QVector<QVector4D>
transform(
const QMatrix4x4& mat,QVector4D& minPos,QVector4D& maxPos)
const;
105 QVector<QVector3D>
transform3D(
const QMatrix4x4& mat,QVector3D& minPos,QVector3D& maxPos)
const;
135 bool LineIntersectPlane(
const QVector3D& lineStart,
const QVector3D& lineVec,
const QVector3D& planePoint,
const QVector3D& planeNormal,
float& d);
const QVector3D *const getVertices() const
Returns the 8 vertices of the cube.
Definition: geometry.cpp:52
QVector< QVector4D > transform(const QMatrix4x4 &mat) const
Multiplies the vertices with the given matrix and returns the result.
Definition: geometry.cpp:57
static const ushort triangleIndices[36]
6 * 2 * 3 = 36 indices for a triangle representation of the cube, vertices ordered CCW...
Definition: geometry.h:54
QVector3D * m_vertices
The 8 vertices of the cube, in the order defined by Corner.
Definition: geometry.h:115
static const ushort lineIndices[24]
12 * 2 = 24 indices for a line representation of the cube (edges)
Definition: geometry.h:72
Corner
Defines the 8 corner points of the cube, in XYZ format.
Definition: geometry.h:22
Describes a equilateral cube, centered on the origin.
Definition: geometry.h:15
static const ushort quadIndices[24]
6 * 4 = 24 indices for a quad representation of the cube (faces), vertices ordered CCW...
Definition: geometry.h:63
static const ushort triangleCount
Number of triangles in triangleIndices (=12)
Definition: geometry.h:58
static const ushort quadCount
Number of quads in quadIndices (=6)
Definition: geometry.h:67
Cube(float sideLength=1.0f)
Creates a cube with the specified side length.
Definition: geometry.cpp:32
float m_sidelength
The side length of the cube.
Definition: geometry.h:111
static const ushort lineCount
Number of lines in lineIndices (=12)
Definition: geometry.h:76
QVector< QVector3D > transform3D(const QMatrix4x4 &mat, QVector3D &minPos, QVector3D &maxPos) const
Same as transform, but with the w components omitted.
Definition: geometry.cpp:100