Feat: Add camera vehicle view offset - #5260
Open
PrimelPrime wants to merge 2 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds three new clientside functions that let you offset the vehicle follow camera.
Each of the six view modes in eVehicleCamMode keeps its own offset once set.
1-4can currently be offset.BUMPERandCINEMATICare processed by differentCCamfunctions and never reachCCam::Process_FollowCar_SAwhere the offset is applied thus currently resulting in no-ops -> Returningfalsefor them instead would also be an option.resetCameraVehicleViewOffset()without an argument clears every view mode.Camera.setVehicleViewOffset,Camera.getVehicleViewOffset,Camera.resetVehicleViewOffset.Motivation
Currently trying to change the camera for the vehicle is only really possible by completely rebuilding it using
setCameraMatrixon every frame. That loses SAs own camera behaviour and is a complex task by itself recreating said camera in Lua. To add to that trying to raise the camera for specific models on the z-axis is only possible by manipulating the model in certain ways (which may affect vehicle physics) but that way it can simply be handled via a simple single function call.Test plan
setCameraVehicleViewOffset(2, 0, 0, 2)on any view mode with any settings (max +-20) -> Cycle through againgetCameraVehicleViewOffset(2)-> returns three floats: i.e.0, 0, 2resetCameraVehicleViewOffset(2)-> Cycle through once againChecklist