secondlife / jira-archive

2 stars 0 forks source link

[BUG-229796] Add lag parameters for locked pos and focus in function llSetCameraParams() #7600

Open sl-service-account opened 3 years ago

sl-service-account commented 3 years ago

How would you like the feature to work?

When a script takes camera controls and set the camera to be locked on a position and/or locked focus, we should be able to add a lag to the camera movements. To do this we should set two new parameters value: FOLLOWCAM_LAG_POSITION_LOCKED FOLLOWCAM_LAG_FOCUS_LOCKED both are boleans, default value FALSE

I had compiled my own viewer in april 2019, sent suggestion and updated files to opensource-dev@lists.secondlife.com but never received any answer. I tryed to suggest this on Firestorm JIRA too with no success even with sending a patch file. Here the 4 files I have updated, I join:

indra/newview/llfollowcam.cpp indra/newview/llfollowcam.h indra/newview/llviewermessage.cpp indra/llmessage/llfollowcamparams.h

Everything is set up to receive and use these two parameters, except server side, I cannot use them in a script, that's why at this time I used FOLLOWCAM_BEHINDNESS_LAG value to set these two new parameters to true or false (true when FOLLOWCAM_BEHINDNESS_LAG == 0.295f)

FOLLOWCAM_BEHINDNESS_LAG is named CAMERA_BEHINDNESS_LAG in the LSL function

Of course you can define other names in the LSL function for FOLLOWCAM_LAG_POSITION_LOCKED  and FOLLOWCAM_LAG_FOCUS_LOCKED 

And, sure, you can use my work as you wish, I give LLab fullperms on it ... joking. Do whatever you want with it, no need to ask me any permission, no need to add my name anywhere, just add this feature please. Thanks

Why is this feature important to you? How would it benefit the community?

This allows coders to make a script able to switch camera position smoothly, and more important, a script able to make the camera follow smoothly an object or a path.

 

Update: I redo all changes on new files (from LLab viewer source pages january 5th 2021) and replaced old ones here.

Remember: If you add server side variables, you can remove behindnesslag value check from llfollowcam.cpp (in function setBehindnessLag) because scripts will no longer need to use this workaround:

 

    if (mBehindnessLag == 0.295f) {
        mLagPositionLocked = true;
        mLagFocusLocked = true;
    }
    else {
        mLagPositionLocked = false;
        mLagFocusLocked = false;
    }

 

Attachments

Original Jira Fields | Field | Value | | ------------- | ------------- | | Issue | BUG-229796 | | Summary | Add lag parameters for locked pos and focus in function llSetCameraParams() | | Type | New Feature Request | | Priority | Unset | | Status | Accepted | | Resolution | Accepted | | Reporter | Rohacan Hirons (rohacan.hirons) | | Created at | 2020-12-06T13:59:11Z | | Updated at | 2021-01-23T13:28:31Z | ``` { 'Build Id': 'unset', 'Business Unit': ['Platform'], 'How would you like the feature to work?': "When a script takes camera controls and set the camera to be locked on a position and/or locked focus, we should be able to add a lag to the camera movements. To do this we should set two new parameters value:\r\nFOLLOWCAM_LAG_POSITION_LOCKED \r\nFOLLOWCAM_LAG_FOCUS_LOCKED\r\nboth are boleans, default value FALSE\r\n\r\nI had compiled my own viewer in april 2019, sent suggestion and updated files to opensource-dev@lists.secondlife.com but never received any answer. I tryed to suggest this on Firestorm JIRA too with no success even with sending a patch file. Here the 4 files I have updated, I join:\r\n\r\nindra/newview/llfollowcam.cpp\r\nindra/newview/llfollowcam.h\r\nindra/newview/llviewermessage.cpp\r\nindra/llmessage/llfollowcamparams.h \r\n\r\nEverything is set up to receive and use these two parameters, except server side, I cannot use them in a script, that's why at this time I used FOLLOWCAM_BEHINDNESS_LAG value to set these two new parameters to true or false (true when FOLLOWCAM_BEHINDNESS_LAG == 0.295f)\r\n\r\nAs said, I made this in april 2019. Maybe these 4 files have be updated since and I don't want to lose time again on my side thinking you may not use my work, then, for nothing. I don't think these files changed, or probably not a lot, you should be able to easily rewrite my changes on new files.", 'Original Reporter': 'Rohacan Hirons (rohacan.hirons)', 'ReOpened Count': 0.0, 'Severity': 'Unset', 'Target Viewer Version': 'viewer-development', 'Why is this feature important to you? How would it benefit the community?': 'This allows coders to make a script able to switch camera position smoothly, and more important, a script able to make the camera follow smoothly an object!', } ```
sl-service-account commented 3 years ago

Rohacan Hirons commented at 2020-12-06T15:12:37Z, updated at 2020-12-06T17:48:08Z

Here is the sample script

sl-service-account commented 3 years ago

Rohacan Hirons commented at 2021-01-23T13:28:31Z

Hi, as suggested in another feature request I made, I filled the contributor agreement, then fill FREE TO USE THIS CODE too, thanks.