Isle
Loading...
Searching...
No Matches
legounkown100db7f4.h
Go to the documentation of this file.
1#ifndef __LEGOUNKNOWN100DB7F4_H
2#define __LEGOUNKNOWN100DB7F4_H
3
4#include "legoedge.h"
5#include "legowegedge.h"
7
8#include <assert.h>
9
10// VTABLE: LEGO1 0x100db7f4
11// SIZE 0x40
12
18public:
20 enum {
21 c_bit1 = 0x01,
22 c_bit2 = 0x02,
23 c_bit3 = 0x04,
24 c_bit4 = 0x08
25 };
26
31
40
48
56
64
72
80
86
91 void SetFlags(LegoU16 p_flags);
92
99 inline LegoU32 FUN_10048c40(const Vector3& p_position);
100
101 // SYNTHETIC: LEGO1 0x1009a6c0
102 // LegoUnknown100db7f4::`scalar deleting destructor'
103
109
116
121 float m_unk0x3c; // 0x3c
122};
123
124// FUNCTION: LEGO1 0x10048c40
125// FUNCTION: BETA10 0x1001cc90
127{
128 LegoFloat localc, local10;
129 LegoU32 result = FALSE;
130
131 if (m_unk0x28[0] > 0.001 || m_unk0x28[0] < -0.001) {
132 localc = (p_position[0] - (*m_pointA)[0]) / m_unk0x28[0];
133
134 if (localc < 0 || localc > 1) {
135 return FALSE;
136 }
137
138 result = TRUE;
139 }
140 else {
141 if (p_position[0] > (*m_pointA)[0] + 0.001 || p_position[0] < (*m_pointA)[0] - 0.001) {
142 return FALSE;
143 }
144 }
145
146 if (m_unk0x28[1] > 0.001 || m_unk0x28[1] < -0.001) {
147 local10 = (p_position[1] - (*m_pointA)[1]) / m_unk0x28[1];
148
149 if (result) {
150 if (localc > local10 + 0.001 || localc < local10 - 0.001) {
151 return FALSE;
152 }
153 }
154 else {
155 result = TRUE;
156 localc = local10;
157 }
158 }
159 else {
160 if (p_position[1] > (*m_pointA)[1] + 0.001 || p_position[1] < (*m_pointA)[1] - 0.001) {
161 return FALSE;
162 }
163 }
164
165 if (m_unk0x28[2] > 0.001 || m_unk0x28[2] < -0.001) {
166 local10 = (p_position[2] - (*m_pointA)[2]) / m_unk0x28[2];
167
168 if (result) {
169 if (localc > local10 + 0.001 || localc < local10 - 0.001) {
170 return FALSE;
171 }
172 }
173 else {
174 return TRUE;
175 }
176 }
177 else {
178 if (p_position[2] > (*m_pointA)[2] + 0.001 || p_position[2] < (*m_pointA)[2] - 0.001) {
179 return FALSE;
180 }
181 }
182
183 return TRUE;
184}
185
186#endif // __LEGOUNKNOWN100DB7F4_H
[AI] Represents a face (polygon) composed of a list of edges in the LEGO Island world engine.
Definition: legoweedge.h:17
[AI] Represents a "geometry edge" in the LEGO Island world polygon/path system.
Definition: legowegedge.h:31
[AI] Represents a 3D point with floating-point precision, inheriting from Vector3.
Definition: mxgeometry3d.h:14
[AI] 3D vector class, providing vector and cross-product operations in 3D space.
Definition: vector.h:249
#define TRUE
Definition: d3drmdef.h:28
#define FALSE
Definition: d3drmdef.h:27
unsigned long LegoU32
[AI] Unsigned 32-bit integer type for cross-platform compatibility.
Definition: legotypes.h:71
unsigned char LegoU8
[AI] Unsigned 8-bit integer type used throughout LEGO Island.
Definition: legotypes.h:47
LegoS32 LegoResult
[AI] Function result type (return code): typically SUCCESS (0) or FAILURE (-1).
Definition: legotypes.h:101
unsigned short LegoU16
[AI] Unsigned 16-bit integer type for cross-platform compatibility.
Definition: legotypes.h:59
float LegoFloat
[AI] Floating point type used throughout LEGO Island.
Definition: legotypes.h:77
[AI] Represents an edge in the LEGO world geometry graph.
Definition: legoedge.h:16
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,...
LegoU32 GetMask0x03()
[AI] Returns a mask of flags relevant to the two faces (bits 0 and 1: c_bit1, c_bit2).
@ c_bit2
[AI] Bit flag 2 for face A connection/properties
@ c_bit4
[AI] Bit flag 4 (purpose unknown)
@ c_bit3
[AI] Bit flag 3 (purpose unknown)
@ c_bit1
[AI] Bit flag 1 for face B connection/properties
float m_unk0x3c
[AI] Unknown float; likely represents additional metric (possibly precomputed distance/weight).
LegoU32 FUN_10048c40(const Vector3 &p_position)
[AI] Tests if a position is on this edge based on its direction and points, within a precision thresh...
LegoFloat DistanceBetweenMidpoints(const LegoUnknown100db7f4 &p_other)
[AI] Returns the Euclidean distance between the midpoints of this edge and another edge.
Mx3DPointFloat m_unk0x28
[AI] Represents the edge's direction/normal vector or outward face normal.
LegoFloat DistanceToMidpoint(const Vector3 &p_vec)
[AI] Calculates linear distance from a vector position to the 3D midpoint of the edge.
LegoU32 BETA_1004a830(LegoWEGEdge &p_face, LegoU8 p_mask)
[AI] Tests whether a WEG-edge meets complex mask and flag criteria for this edge, depending on mask a...
LegoU16 m_flags
[AI] Internal flags controlling per-face properties and connection status.
LegoWEEdge * OtherFace(LegoWEEdge *p_other)
[AI] Returns the opposite face pointer to the one passed in.
LegoUnknown100db7f4()
[AI] Constructs a new edge object with zero-initialized per-face flags and direction/normal vector.
LegoU32 BETA_100b53b0(LegoWEGEdge &p_face)
[AI] Checks if a WEG-edge is connected to this edge with proper flagging for its side.
LegoResult FUN_1002ddc0(LegoWEEdge &p_f, Vector3 &p_point) const
[AI] Calculates the edge normal for use from the given face, negating it if called from faceA.
void SetFlags(LegoU16 p_flags)
[AI] Directly sets the internal flags value.