@quenty/adorneeboundingbox 8.20.2 → 8.20.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [8.20.3](https://github.com/Quenty/NevermoreEngine/compare/@quenty/adorneeboundingbox@8.20.2...@quenty/adorneeboundingbox@8.20.3) (2025-04-10)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @quenty/adorneeboundingbox
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
## [8.20.2](https://github.com/Quenty/NevermoreEngine/compare/@quenty/adorneeboundingbox@8.20.0...@quenty/adorneeboundingbox@8.20.2) (2025-04-07)
|
|
7
15
|
|
|
8
16
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/adorneeboundingbox",
|
|
3
|
-
"version": "8.20.
|
|
3
|
+
"version": "8.20.3",
|
|
4
4
|
"description": "Handles logic for reactive bounding box monitoring",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -25,20 +25,20 @@
|
|
|
25
25
|
"Quenty"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@quenty/baseobject": "^10.8.
|
|
29
|
-
"@quenty/brio": "^14.17.
|
|
30
|
-
"@quenty/draw": "^7.8.
|
|
31
|
-
"@quenty/instanceutils": "^13.17.
|
|
32
|
-
"@quenty/loader": "^10.8.
|
|
33
|
-
"@quenty/maid": "^3.4.
|
|
34
|
-
"@quenty/observablecollection": "^12.20.
|
|
35
|
-
"@quenty/rx": "^13.17.
|
|
36
|
-
"@quenty/selectionutils": "^8.17.
|
|
37
|
-
"@quenty/signal": "^7.10.
|
|
38
|
-
"@quenty/valueobject": "^13.17.
|
|
28
|
+
"@quenty/baseobject": "^10.8.3",
|
|
29
|
+
"@quenty/brio": "^14.17.3",
|
|
30
|
+
"@quenty/draw": "^7.8.4",
|
|
31
|
+
"@quenty/instanceutils": "^13.17.3",
|
|
32
|
+
"@quenty/loader": "^10.8.3",
|
|
33
|
+
"@quenty/maid": "^3.4.3",
|
|
34
|
+
"@quenty/observablecollection": "^12.20.3",
|
|
35
|
+
"@quenty/rx": "^13.17.3",
|
|
36
|
+
"@quenty/selectionutils": "^8.17.3",
|
|
37
|
+
"@quenty/signal": "^7.10.3",
|
|
38
|
+
"@quenty/valueobject": "^13.17.3"
|
|
39
39
|
},
|
|
40
40
|
"publishConfig": {
|
|
41
41
|
"access": "public"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "b06c070ae91d5dab7bd8de6e290ad2caabb15d8f"
|
|
44
44
|
}
|
|
@@ -20,9 +20,16 @@ local AdorneeBoundingBox = setmetatable({}, BaseObject)
|
|
|
20
20
|
AdorneeBoundingBox.ClassName = "AdorneeBoundingBox"
|
|
21
21
|
AdorneeBoundingBox.__index = AdorneeBoundingBox
|
|
22
22
|
|
|
23
|
-
export type AdorneeBoundingBox = typeof(setmetatable(
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
export type AdorneeBoundingBox = typeof(setmetatable(
|
|
24
|
+
{} :: {
|
|
25
|
+
_adornee: ValueObject.ValueObject<Instance?>,
|
|
26
|
+
_bbCFrame: ValueObject.ValueObject<CFrame?>,
|
|
27
|
+
_bbSize: ValueObject.ValueObject<Vector3?>,
|
|
28
|
+
},
|
|
29
|
+
{} :: typeof({ __index = AdorneeBoundingBox })
|
|
30
|
+
)) & BaseObject.BaseObject
|
|
31
|
+
|
|
32
|
+
function AdorneeBoundingBox.new(initialAdornee: Instance?): AdorneeBoundingBox
|
|
26
33
|
local self = setmetatable(BaseObject.new() :: any, AdorneeBoundingBox)
|
|
27
34
|
|
|
28
35
|
self._adornee = self._maid:Add(ValueObject.new(initialAdornee))
|
|
@@ -45,7 +52,7 @@ function AdorneeBoundingBox.new(initialAdornee: Instance): AdorneeBoundingBox
|
|
|
45
52
|
return self
|
|
46
53
|
end
|
|
47
54
|
|
|
48
|
-
function AdorneeBoundingBox
|
|
55
|
+
function AdorneeBoundingBox.SetAdornee(self: AdorneeBoundingBox, adornee: Instance?): () -> ()
|
|
49
56
|
assert(typeof(adornee) == "Instance" or adornee == nil, "Bad adornee")
|
|
50
57
|
|
|
51
58
|
self._adornee.Value = adornee
|
|
@@ -66,7 +73,7 @@ export type BoundingBoxData = {
|
|
|
66
73
|
Observes the bounding box of the adornee
|
|
67
74
|
@return Observable<BoundingBoxData>
|
|
68
75
|
]=]
|
|
69
|
-
function AdorneeBoundingBox
|
|
76
|
+
function AdorneeBoundingBox.ObserveBoundingBox(self: AdorneeBoundingBox): _Observable.Observable<BoundingBoxData>
|
|
70
77
|
return Rx.combineLatest({
|
|
71
78
|
CFrame = self:ObserveCFrame(),
|
|
72
79
|
Size = self:ObserveSize(),
|
|
@@ -81,7 +88,7 @@ end
|
|
|
81
88
|
Gets the bounding box of the adornee
|
|
82
89
|
@return BoundingBoxData?
|
|
83
90
|
]=]
|
|
84
|
-
function AdorneeBoundingBox
|
|
91
|
+
function AdorneeBoundingBox.GetBoundingBox(self: AdorneeBoundingBox): BoundingBoxData?
|
|
85
92
|
local cframe = self._bbCFrame.Value
|
|
86
93
|
local size = self._bbSize.Value
|
|
87
94
|
|
|
@@ -99,7 +106,7 @@ end
|
|
|
99
106
|
Observes the cframe of the adornee
|
|
100
107
|
@return Observable<Vector3>
|
|
101
108
|
]=]
|
|
102
|
-
function AdorneeBoundingBox
|
|
109
|
+
function AdorneeBoundingBox.ObserveCFrame(self: AdorneeBoundingBox): _Observable.Observable<CFrame?>
|
|
103
110
|
return self._bbCFrame:Observe()
|
|
104
111
|
end
|
|
105
112
|
|
|
@@ -107,7 +114,7 @@ end
|
|
|
107
114
|
Gets the CFrame of the adornee
|
|
108
115
|
@return Vector3
|
|
109
116
|
]=]
|
|
110
|
-
function AdorneeBoundingBox
|
|
117
|
+
function AdorneeBoundingBox.GetCFrame(self: AdorneeBoundingBox): CFrame?
|
|
111
118
|
return self._bbCFrame.Value
|
|
112
119
|
end
|
|
113
120
|
|
|
@@ -115,7 +122,7 @@ end
|
|
|
115
122
|
Observes the size of the adornee
|
|
116
123
|
@return Observable<Vector3>
|
|
117
124
|
]=]
|
|
118
|
-
function AdorneeBoundingBox
|
|
125
|
+
function AdorneeBoundingBox.ObserveSize(self: AdorneeBoundingBox): _Observable.Observable<Vector3?>
|
|
119
126
|
return self._bbSize:Observe()
|
|
120
127
|
end
|
|
121
128
|
|
|
@@ -123,11 +130,11 @@ end
|
|
|
123
130
|
Gets the size of the adornee
|
|
124
131
|
@return Vector3
|
|
125
132
|
]=]
|
|
126
|
-
function AdorneeBoundingBox
|
|
133
|
+
function AdorneeBoundingBox.GetSize(self: AdorneeBoundingBox): Vector3?
|
|
127
134
|
return self._bbSize.Value
|
|
128
135
|
end
|
|
129
136
|
|
|
130
|
-
function AdorneeBoundingBox
|
|
137
|
+
function AdorneeBoundingBox._setup(self: AdorneeBoundingBox, maid: Maid.Maid, adornee: Instance)
|
|
131
138
|
if adornee:IsA("BasePart") then
|
|
132
139
|
maid:GiveTask(self:_setupPart(adornee))
|
|
133
140
|
elseif adornee:IsA("Model") then
|
|
@@ -150,7 +157,7 @@ function AdorneeBoundingBox:_setup(maid: Maid.Maid, adornee: Instance)
|
|
|
150
157
|
end
|
|
151
158
|
end
|
|
152
159
|
|
|
153
|
-
function AdorneeBoundingBox
|
|
160
|
+
function AdorneeBoundingBox._setupTool(self: AdorneeBoundingBox, tool: Tool): Maid.Maid
|
|
154
161
|
assert(typeof(tool) == "Instance" and tool:IsA("Tool"), "Bad tool")
|
|
155
162
|
|
|
156
163
|
local topMaid = Maid.new()
|
|
@@ -160,17 +167,16 @@ function AdorneeBoundingBox:_setupTool(tool: Tool): Maid.Maid
|
|
|
160
167
|
return
|
|
161
168
|
end
|
|
162
169
|
|
|
163
|
-
local maid = brio:
|
|
164
|
-
local handle = brio:GetValue()
|
|
170
|
+
local maid, handle = brio:ToMaidAndValue()
|
|
165
171
|
|
|
166
172
|
-- TODO: Something smarter? But we'll need to change the AdorneeUtils contract too
|
|
167
|
-
maid:GiveTask(self:_setupPart(handle))
|
|
173
|
+
maid:GiveTask(self:_setupPart(handle :: BasePart))
|
|
168
174
|
end))
|
|
169
175
|
|
|
170
176
|
return topMaid
|
|
171
177
|
end
|
|
172
178
|
|
|
173
|
-
function AdorneeBoundingBox
|
|
179
|
+
function AdorneeBoundingBox._setupModel(self: AdorneeBoundingBox, model: Model): Maid.Maid
|
|
174
180
|
assert(typeof(model) == "Instance" and model:IsA("Model"), "Bad model")
|
|
175
181
|
|
|
176
182
|
local topMaid = Maid.new()
|
|
@@ -186,7 +192,7 @@ function AdorneeBoundingBox:_setupModel(model: Model): Maid.Maid
|
|
|
186
192
|
return topMaid
|
|
187
193
|
end
|
|
188
194
|
|
|
189
|
-
function AdorneeBoundingBox
|
|
195
|
+
function AdorneeBoundingBox._setupHumanoid(self: AdorneeBoundingBox, humanoid: Humanoid): Maid.Maid
|
|
190
196
|
assert(typeof(humanoid) == "Instance" and humanoid:IsA("Humanoid"), "Bad humanoid")
|
|
191
197
|
|
|
192
198
|
local topMaid = Maid.new()
|
|
@@ -206,7 +212,7 @@ function AdorneeBoundingBox:_setupHumanoid(humanoid: Humanoid): Maid.Maid
|
|
|
206
212
|
return topMaid
|
|
207
213
|
end
|
|
208
214
|
|
|
209
|
-
function AdorneeBoundingBox
|
|
215
|
+
function AdorneeBoundingBox._setupAttachment(self: AdorneeBoundingBox, attachment: Attachment): Maid.Maid
|
|
210
216
|
assert(typeof(attachment) == "Instance" and attachment:IsA("Attachment"), "Bad attachment")
|
|
211
217
|
|
|
212
218
|
local maid = Maid.new()
|
|
@@ -217,7 +223,7 @@ function AdorneeBoundingBox:_setupAttachment(attachment: Attachment): Maid.Maid
|
|
|
217
223
|
return parent ~= nil
|
|
218
224
|
end)
|
|
219
225
|
:Pipe({
|
|
220
|
-
RxBrioUtils.switchMapBrio(function(parent)
|
|
226
|
+
RxBrioUtils.switchMapBrio(function(parent): any
|
|
221
227
|
if parent:IsA("BasePart") then
|
|
222
228
|
return Rx.combineLatest({
|
|
223
229
|
partCFrame = RxPartBoundingBoxUtils.observePartCFrame(parent),
|
|
@@ -240,7 +246,7 @@ function AdorneeBoundingBox:_setupAttachment(attachment: Attachment): Maid.Maid
|
|
|
240
246
|
return maid
|
|
241
247
|
end
|
|
242
248
|
|
|
243
|
-
function AdorneeBoundingBox
|
|
249
|
+
function AdorneeBoundingBox._setupPart(self: AdorneeBoundingBox, part: BasePart): Maid.Maid
|
|
244
250
|
assert(typeof(part) == "Instance" and part:IsA("BasePart"), "Bad part")
|
|
245
251
|
|
|
246
252
|
local maid = Maid.new()
|
|
@@ -13,7 +13,7 @@ local RxPartBoundingBoxUtils = {}
|
|
|
13
13
|
function RxPartBoundingBoxUtils.observePartCFrame(part: BasePart): _Observable.Observable<CFrame>
|
|
14
14
|
assert(typeof(part) == "Instance" and part:IsA("BasePart"), "Bad part")
|
|
15
15
|
|
|
16
|
-
return RxInstanceUtils.observeProperty(part, "CFrame")
|
|
16
|
+
return RxInstanceUtils.observeProperty(part, "CFrame")
|
|
17
17
|
end
|
|
18
18
|
|
|
19
19
|
return RxPartBoundingBoxUtils
|