@quenty/camera 4.3.1 → 4.4.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 +11 -0
- package/LICENSE.md +1 -1
- package/README.md +43 -0
- package/package.json +5 -5
- package/src/Client/Utility/CameraFrame.story.lua +5 -5
- package/test/default.project.json +2 -10
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
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
|
+
# [4.4.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/camera@4.3.1...@quenty/camera@4.4.0) (2021-12-18)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* Better camera explainability ([4fd9016](https://github.com/Quenty/NevermoreEngine/commit/4fd9016f6914bf181e421753cbaca555394537d8))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## [4.3.1](https://github.com/Quenty/NevermoreEngine/compare/@quenty/camera@4.3.0...@quenty/camera@4.3.1) (2021-12-04)
|
|
7
18
|
|
|
8
19
|
**Note:** Version bump only for package @quenty/camera
|
package/LICENSE.md
CHANGED
package/README.md
CHANGED
|
@@ -69,3 +69,46 @@ This class takes two arguments and returns the summation of the two
|
|
|
69
69
|
This classes allows the effects of a camera to be faded / varied based upon a spring
|
|
70
70
|
|
|
71
71
|
* Starts at 0 percent effect
|
|
72
|
+
|
|
73
|
+
## Usage
|
|
74
|
+
Here is sample usage of using just a subcomponent. Recommendation is to use full camera stack service.
|
|
75
|
+
|
|
76
|
+
```lua
|
|
77
|
+
local RunService = game:GetService("RunService")
|
|
78
|
+
local Workspace = game:GetService("Workspace")
|
|
79
|
+
|
|
80
|
+
local FadeBetweenCamera3 = require(modules.FadeBetweenCamera3)
|
|
81
|
+
local CustomCameraEffect = require(modules.CustomCameraEffect)
|
|
82
|
+
local CameraState = require(modules.CameraState)
|
|
83
|
+
|
|
84
|
+
local defaultCamera = require(modules.DefaultCamera).new()
|
|
85
|
+
defaultCamera:BindToRenderStep() -- capture roblox camera automatically
|
|
86
|
+
|
|
87
|
+
local targetCamera = CustomCameraEffect.new(function()
|
|
88
|
+
local target = CameraState.new()
|
|
89
|
+
target.CFrame = CFrame.new(0, 100, 0)
|
|
90
|
+
target.FieldOfView = 70
|
|
91
|
+
|
|
92
|
+
return target
|
|
93
|
+
end)
|
|
94
|
+
|
|
95
|
+
local faded = FadeBetweenCamera3.new(defaultCamera, targetCamera)
|
|
96
|
+
faded.Speed = 5
|
|
97
|
+
|
|
98
|
+
RunService:BindToRenderStep("CameraStackUpdateInternal", Enum.RenderPriority.Camera.Value + 75, function()
|
|
99
|
+
faded.CameraState:Set(Workspace.CurrentCamera)
|
|
100
|
+
end)
|
|
101
|
+
|
|
102
|
+
-- Input
|
|
103
|
+
local mouse = game.Players.LocalPlayer:GetMouse()
|
|
104
|
+
local visible = false
|
|
105
|
+
mouse.Button1Down:Connect(function()
|
|
106
|
+
visible = not visible
|
|
107
|
+
if visible then
|
|
108
|
+
faded.Target = 1
|
|
109
|
+
else
|
|
110
|
+
faded.Target = 0
|
|
111
|
+
end
|
|
112
|
+
end)
|
|
113
|
+
|
|
114
|
+
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/camera",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.4.0",
|
|
4
4
|
"description": "Quenty's camera system for Roblox",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -33,15 +33,15 @@
|
|
|
33
33
|
"@quenty/loader": "^3.1.1",
|
|
34
34
|
"@quenty/maid": "^2.0.1",
|
|
35
35
|
"@quenty/math": "^2.0.0",
|
|
36
|
-
"@quenty/qframe": "^3.
|
|
36
|
+
"@quenty/qframe": "^3.3.0",
|
|
37
37
|
"@quenty/servicebag": "^3.2.1",
|
|
38
|
-
"@quenty/spring": "^2.
|
|
38
|
+
"@quenty/spring": "^2.2.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@quenty/camerastoryutils": "^3.
|
|
41
|
+
"@quenty/camerastoryutils": "^3.3.0"
|
|
42
42
|
},
|
|
43
43
|
"publishConfig": {
|
|
44
44
|
"access": "public"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "6eb398e9fb81191f0815885f807ab0cb3bb9bad1"
|
|
47
47
|
}
|
|
@@ -17,10 +17,10 @@ return function(target)
|
|
|
17
17
|
|
|
18
18
|
local cameraCFrame = workspace.CurrentCamera.CFrame
|
|
19
19
|
local a = CameraFrame.new(QFrame.fromCFrameClosestTo(
|
|
20
|
-
CFrame.new(cameraCFrame.Position + cameraCFrame.lookVector*25),
|
|
20
|
+
CFrame.new(cameraCFrame.Position + cameraCFrame.lookVector*25 - 20*cameraCFrame.RightVector),
|
|
21
21
|
QFrame.new()), 70)
|
|
22
22
|
local b = CameraFrame.new(QFrame.fromCFrameClosestTo(
|
|
23
|
-
CFrame.new(cameraCFrame.Position + cameraCFrame.lookVector*30 +
|
|
23
|
+
CFrame.new(cameraCFrame.Position + cameraCFrame.lookVector*30 + 20*cameraCFrame.RightVector)
|
|
24
24
|
* CFrame.Angles(math.pi/3, 2*math.pi/3, 0),
|
|
25
25
|
QFrame.new()), 70)
|
|
26
26
|
|
|
@@ -38,12 +38,12 @@ return function(target)
|
|
|
38
38
|
|
|
39
39
|
setup(function(t)
|
|
40
40
|
return CameraFrame.new((1 - t)*a.QFrame + t*b.QFrame, a.FieldOfView + (b.FieldOfView - a.FieldOfView)*t)
|
|
41
|
-
end, Color3.new(0.25, 0.25, 0.25))
|
|
41
|
+
end, Color3.new(0.25, 0.25, 0.25), "Linear", Vector2.new(80, 0))
|
|
42
42
|
|
|
43
43
|
setup(function(t)
|
|
44
44
|
local result = ((b.QFrame*(a.QFrame^-1))^t)*a.QFrame
|
|
45
45
|
return CameraFrame.new(result, a.FieldOfView + (b.FieldOfView - a.FieldOfView)*t)
|
|
46
|
-
end, Color3.new(0.5, 0.5, 1))
|
|
46
|
+
end, Color3.new(0.5, 0.5, 1), "Quaternion", Vector2.new(0, -80))
|
|
47
47
|
|
|
48
48
|
setup(function(t)
|
|
49
49
|
local node0 = CubicSplineUtils.newSplineNode(0, a, CameraFrame.new())
|
|
@@ -57,7 +57,7 @@ return function(target)
|
|
|
57
57
|
|
|
58
58
|
local newNode = CubicSplineUtils.tweenSplineNodes(node0, node1, t)
|
|
59
59
|
return newNode.p
|
|
60
|
-
end, Color3.new(0.5, 1, 1))
|
|
60
|
+
end, Color3.new(0.5, 1, 1), "Cubic spline", Vector2.new(0, 40))
|
|
61
61
|
return function()
|
|
62
62
|
maid:DoCleaning()
|
|
63
63
|
end
|
|
@@ -2,17 +2,9 @@
|
|
|
2
2
|
"name": "cameratest",
|
|
3
3
|
"tree": {
|
|
4
4
|
"$className": "DataModel",
|
|
5
|
-
"ReplicatedStorage": {
|
|
6
|
-
"Nevermore": {
|
|
7
|
-
"$path": "../node_modules/@quenty/loader"
|
|
8
|
-
}
|
|
9
|
-
},
|
|
10
5
|
"ServerScriptService": {
|
|
11
|
-
"
|
|
12
|
-
"$
|
|
13
|
-
"Camera": {
|
|
14
|
-
"$path": ".."
|
|
15
|
-
}
|
|
6
|
+
"camera": {
|
|
7
|
+
"$path": ".."
|
|
16
8
|
}
|
|
17
9
|
}
|
|
18
10
|
}
|