Isle
Loading...
Searching...
No Matches
legoweedge.cpp
Go to the documentation of this file.
1#include "legoweedge.h"
2
4
6
7// FUNCTION: LEGO1 0x1009a550
9{
10 m_edges = NULL;
11 m_numEdges = 0;
12}
13
14// FUNCTION: LEGO1 0x1009a590
16{
17 if (m_edges) {
18 delete m_edges;
19 }
20}
21
22// FUNCTION: LEGO1 0x1009a5b0
24{
25 for (LegoS32 i = 0; i < m_numEdges; i++) {
27 LegoUnknown100db7f4* e2 = (m_numEdges - i) == 1 ? m_edges[0] : m_edges[i + 1];
28
29 if (e2->m_pointA == e1->m_pointA) {
30 e1->m_faceA = this;
31 e2->m_faceB = this;
32 e1->m_ccwA = e2;
33 e2->m_cwB = e1;
34 }
35 else if (e2->m_pointB == e1->m_pointA) {
36 e1->m_faceA = this;
37 e2->m_faceA = this;
38 e1->m_ccwA = e2;
39 e2->m_cwA = e1;
40 }
41 else if (e1->m_pointB == e2->m_pointA) {
42 e1->m_faceB = this;
43 e2->m_faceB = this;
44 e1->m_ccwB = e2;
45 e2->m_cwB = e1;
46 }
47 else {
48 e1->m_faceB = this;
49 e2->m_faceA = this;
50 e1->m_ccwB = e2;
51 e2->m_cwA = e1;
52 }
53 }
54
55 return 0;
56}
[AI] Represents a face (polygon) composed of a list of edges in the LEGO Island world engine.
Definition: legoweedge.h:17
virtual LegoS32 VTable0x04()
[AI] Connects and links the associated edge objects to set up adjacency across the face.
Definition: legoweedge.cpp:23
LegoU8 m_numEdges
[AI] Number of edge elements in m_edges; number of sides of the polygon. [AI]
Definition: legoweedge.h:74
LegoUnknown100db7f4 ** m_edges
[AI] Array of pointers to edge objects (LegoUnknown100db7f4) comprising this face....
Definition: legoweedge.h:75
virtual ~LegoWEEdge()
[AI] Destroys the LegoWEEdge object, releasing memory used by its edge list.
Definition: legoweedge.cpp:15
#define DECOMP_SIZE_ASSERT(T, S)
Definition: decomp.h:19
#define NULL
[AI] Null pointer value (C/C++ semantics).
Definition: legotypes.h:26
long LegoS32
[AI] Signed 32-bit integer type for cross-platform compatibility.
Definition: legotypes.h:65
LegoEdge * m_ccwB
[AI] Next edge (counterclockwise) around face B.
Definition: legoedge.h:118
LegoWEEdge * m_faceA
[AI] Pointer to the first face sharing this edge.
Definition: legoedge.h:97
LegoEdge * m_cwB
[AI] Next edge (clockwise) around face B.
Definition: legoedge.h:123
LegoWEEdge * m_faceB
[AI] Pointer to the second face sharing this edge.
Definition: legoedge.h:103
Vector3 * m_pointB
[AI] The second endpoint of the edge.
Definition: legoedge.h:133
LegoEdge * m_ccwA
[AI] Next edge (counterclockwise) around face A.
Definition: legoedge.h:108
LegoEdge * m_cwA
[AI] Next edge (clockwise) around face A.
Definition: legoedge.h:113
Vector3 * m_pointA
[AI] The first endpoint of the edge.
Definition: legoedge.h:128
[AI] Represents an advanced edge in the LEGO Island geometry system, with direction,...