Exclusive OR boolean operator for two shapes. More...
#include <BooleanXor.hpp>
Public Member Functions | |
| BooleanXor (const Tag &tag) | |
| virtual void | draw () const |
| virtual string | toString () const |
Static Public Member Functions | |
| static ShapeTraits | getTraits () |
Protected Member Functions | |
| void | addPiece (list< Extent > &pieces, const Extent &piece) |
| virtual void | calculate () |
| virtual void | calculateTangible () |
| void | drawWhenNotOverlapped (Matrix &rotation) const |
| void | drawWhenOverlapped (Matrix &rotation) const |
| void | explode (const Extent &piece, int d, list< Extent > &pieces) |
| pair< Extent, Extent > | knife (const Extent &extent, float at, int on) |
| bool | isDrawn (float aDepth, float bDepth) const |
| virtual void | updateBufferPoints () |
| virtual void | updateBufferNormals () |
| virtual void | updateBufferCoords () |
Private Types | |
| enum | { ALL, BEHIND, FORWARD } |
Private Attributes | |
| GLfloat | points [BOOLEAN_XOR_COUNT][3] |
| GLfloat | coords [BOOLEAN_XOR_COUNT][3] |
| int | only |
| list< Extent > | pieces |
Exclusive OR boolean operator for two shapes.
Vertex Attributes
| BooleanXor | ( | const Tag & | tag | ) |
Sets the only attribute.
| void addPiece | ( | list< Extent > & | pieces, | |
| const Extent & | piece | |||
| ) | [protected] |
Adds piece to pieces only if it's substantial.
| void calculate | ( | ) | [protected, virtual] |
Creates the pieces by knifing at the intersection point of each axis.
Reimplemented from Boolean.
| void calculateTangible | ( | ) | [inline, protected, virtual] |
Assumed to be always visible (for now).
Implements Boolean.
| void draw | ( | ) | const [virtual] |
Draw the pieces or one of the shapes according to overlap and depth.
Reimplemented from Boolean.
| void drawWhenNotOverlapped | ( | Matrix & | rotation | ) | const [protected] |
Draws one of the shapes according to depth.
| void drawWhenOverlapped | ( | Matrix & | rotation | ) | const [protected] |
Draw some of the pieces according to depth.
| void explode | ( | const Extent & | piece, | |
| int | d, | |||
| list< Extent > & | pieces | |||
| ) | [protected] |
Recursively splits a piece.
| ShapeTraits getTraits | ( | ) | [static] |
Reimplemented from Hexahedron.
| bool isDrawn | ( | float | aDepth, | |
| float | bDepth | |||
| ) | const [protected] |
| pair< Extent, Extent > knife | ( | const Extent & | extent, | |
| float | at, | |||
| int | on | |||
| ) | [protected] |
| string toString | ( | ) | const [virtual] |
Reimplemented from Boolean.
| void updateBufferNormals | ( | ) | [protected, virtual] |
Initializes the normals in the vertex buffer.
Reimplemented from Hexahedron.
| void updateBufferPoints | ( | ) | [protected, virtual] |
Initializes the points in the vertex buffer.
6-------7
/| /|
2-------3 |
| 4-----|-5
|/ |/
0-------1
Reimplemented from Hexahedron.
1.6.3