@quenty/camera 14.18.3-canary.534.e0a44d2.0 → 14.19.0-canary.70d42ea.0
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 +1 -12
- package/package.json +2 -2
- package/src/Client/Effects/DefaultCamera.lua +1 -37
package/CHANGELOG.md
CHANGED
|
@@ -3,18 +3,7 @@
|
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
### Features
|
|
10
|
-
|
|
11
|
-
* Add FirstPerson detection to the DefaultCamera in the camera stack, to query Roblox state ([aa97281](https://github.com/Quenty/NevermoreEngine/commit/aa97281208a51dd5141938fca3ec92db1247081c))
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
## [14.18.2](https://github.com/Quenty/NevermoreEngine/compare/@quenty/camera@14.18.1...@quenty/camera@14.18.2) (2025-01-22)
|
|
6
|
+
# [14.19.0-canary.70d42ea.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/camera@14.18.1...@quenty/camera@14.19.0-canary.70d42ea.0) (2025-01-24)
|
|
18
7
|
|
|
19
8
|
**Note:** Version bump only for package @quenty/camera
|
|
20
9
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/camera",
|
|
3
|
-
"version": "14.
|
|
3
|
+
"version": "14.19.0-canary.70d42ea.0",
|
|
4
4
|
"description": "Quenty's camera system for Roblox",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"publishConfig": {
|
|
47
47
|
"access": "public"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "70d42eaa8c916e90ed1eb86aa3861c2fc847682e"
|
|
50
50
|
}
|
|
@@ -17,7 +17,6 @@ local SummedCamera = require("SummedCamera")
|
|
|
17
17
|
local Maid = require("Maid")
|
|
18
18
|
local CFrameUtils = require("CFrameUtils")
|
|
19
19
|
local CameraFrame = require("CameraFrame")
|
|
20
|
-
local ValueObject = require("ValueObject")
|
|
21
20
|
|
|
22
21
|
local EPSILON = 0.001
|
|
23
22
|
|
|
@@ -36,8 +35,6 @@ function DefaultCamera.new()
|
|
|
36
35
|
self._maid = Maid.new()
|
|
37
36
|
self._cameraState = CameraState.new(Workspace.CurrentCamera)
|
|
38
37
|
|
|
39
|
-
self._isFirstPerson = self._maid:Add(ValueObject.new(false, "boolean"))
|
|
40
|
-
|
|
41
38
|
return self
|
|
42
39
|
end
|
|
43
40
|
|
|
@@ -95,32 +92,6 @@ function DefaultCamera:SetLastSetCameraFrame(cameraFrame)
|
|
|
95
92
|
self._lastCameraFrame = CameraFrame.new(cameraFrame.QFrame, cameraFrame.FieldOfView)
|
|
96
93
|
end
|
|
97
94
|
|
|
98
|
-
--[=[
|
|
99
|
-
Gets whether the Roblox camera is in first person
|
|
100
|
-
]=]
|
|
101
|
-
function DefaultCamera:IsFirstPerson(): boolean
|
|
102
|
-
return self._isFirstPerson.Value
|
|
103
|
-
end
|
|
104
|
-
|
|
105
|
-
--[=[
|
|
106
|
-
Gets whether the Roblox camera is in first person
|
|
107
|
-
|
|
108
|
-
@return Observable<boolean>
|
|
109
|
-
]=]
|
|
110
|
-
function DefaultCamera:ObserveIsFirstPerson()
|
|
111
|
-
return self._isFirstPerson:Observe()
|
|
112
|
-
end
|
|
113
|
-
|
|
114
|
-
--[=[
|
|
115
|
-
Gets whether the Roblox camera is in first person
|
|
116
|
-
|
|
117
|
-
@param predicate ((inFirstPerson: boolean) -> boolean)?
|
|
118
|
-
@return Observable<Brio<boolean>>
|
|
119
|
-
]=]
|
|
120
|
-
function DefaultCamera:ObserveIsFirstPersonBrio(predicate)
|
|
121
|
-
return self._isFirstPerson:Observe(predicate)
|
|
122
|
-
end
|
|
123
|
-
|
|
124
95
|
--[=[
|
|
125
96
|
Binds the camera to RunService RenderStepped event.
|
|
126
97
|
|
|
@@ -154,18 +125,11 @@ function DefaultCamera:BindToRenderStep()
|
|
|
154
125
|
end)
|
|
155
126
|
|
|
156
127
|
RunService:BindToRenderStep("DefaultCamera_PostUpdate" .. self._key, Enum.RenderPriority.Camera.Value+2, function()
|
|
157
|
-
local camera = Workspace.CurrentCamera
|
|
158
|
-
|
|
159
|
-
-- Based upon Roblox's camera scripts
|
|
160
|
-
local distance = (camera.CFrame.Position - camera.Focus.Position).magnitude
|
|
161
|
-
self._isFirstPerson.Value = distance <= 0.75
|
|
162
|
-
|
|
163
128
|
-- Capture
|
|
164
|
-
self._cameraState = CameraState.new(
|
|
129
|
+
self._cameraState = CameraState.new(Workspace.CurrentCamera)
|
|
165
130
|
end)
|
|
166
131
|
|
|
167
132
|
maid:GiveTask(function()
|
|
168
|
-
self._isFirstPerson.Value = false
|
|
169
133
|
RunService:UnbindFromRenderStep("DefaultCamera_Preupdate" .. self._key)
|
|
170
134
|
RunService:UnbindFromRenderStep("DefaultCamera_PostUpdate" .. self._key)
|
|
171
135
|
end)
|