
Security News
Rspack Introduces Rslint, a TypeScript-First Linter Written in Go
Rspack launches Rslint, a fast TypeScript-first linter built on typescript-go, joining in on the trend of toolchains creating their own linters.
@quenty/camera
Advanced tools
CameraStackService provides a camera stack of objects that can report a camera state. This allows a composable camera system for a variety of situations that arise, and lets systems interop with each other
npm install @quenty/camera --save
CameraState is an immutable camera system used for camera interpolation. Designed to make camera effects easy, it trades some efficiency and speed for making a not confusing camera system.
Camera state stores internal state of Coordinate frames as quaternions. This means that the classic lerp equation. Operations have been overridden to make this easier to work with.
Ok. It's not entirely immutable. They are kind of lazy, that is, reading data doesn't affect the state of them. There are no required update loops or anything for the most part.
Current Camera Effects have the following API available. Adding new effects means that these two should follow the same API specifications
+
operatorReturns a new Summed camera and adds the two effects together. This is used for combining effects
.CameraState
Indexing the CameraEffect should return the current camera state. This means that state is easy to index.
In previous versions, the following will also work. However, this is no longer true.
.State
.CameraState
.Camera
This will return a CameraState
!!! warning Note that eventually we plan to deprecate everything but .CameraState
This class tracks the current camera ROBLOX uses and lets it maintain how it operates using a BindToRenderStep
trick.
BindToRenderStep
during constructionThis class takes two arguments and returns the summation of the two
CameraState
or a CameraEffect, assuming the effect has a CameraState
memberThis classes allows the effects of a camera to be faded / varied based upon a spring
Here is sample usage of using just a subcomponent. Recommendation is to use full camera stack service.
local RunService = game:GetService("RunService")
local Workspace = game:GetService("Workspace")
local FadeBetweenCamera3 = require(modules.FadeBetweenCamera3)
local CustomCameraEffect = require(modules.CustomCameraEffect)
local CameraState = require(modules.CameraState)
local defaultCamera = require(modules.DefaultCamera).new()
defaultCamera:BindToRenderStep() -- capture roblox camera automatically
local targetCamera = CustomCameraEffect.new(function()
local target = CameraState.new()
target.CFrame = CFrame.new(0, 100, 0)
target.FieldOfView = 70
return target
end)
local faded = FadeBetweenCamera3.new(defaultCamera, targetCamera)
faded.Speed = 5
RunService:BindToRenderStep("CameraStackUpdateInternal", Enum.RenderPriority.Camera.Value + 75, function()
faded.CameraState:Set(Workspace.CurrentCamera)
end)
-- Input
local mouse = game.Players.LocalPlayer:GetMouse()
local visible = false
mouse.Button1Down:Connect(function()
visible = not visible
if visible then
faded.Target = 1
else
faded.Target = 0
end
end)
FAQs
Quenty's camera system for Roblox
The npm package @quenty/camera receives a total of 252 weekly downloads. As such, @quenty/camera popularity was classified as not popular.
We found that @quenty/camera demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Rspack launches Rslint, a fast TypeScript-first linter built on typescript-go, joining in on the trend of toolchains creating their own linters.
Security News
Hacker Demonstrates How Easy It Is To Steal Data From Popular Password Managers
Security News
Oxlint’s new preview brings type-aware linting powered by typescript-go, combining advanced TypeScript rules with native-speed performance.