当前位置:网站首页>Unity skframework framework (XVII), freecameracontroller God view / free view camera control script
Unity skframework framework (XVII), freecameracontroller God view / free view camera control script
2022-07-02 13:07:00 【CoderZ1010】
Catalog
1. Keyboard control translation
4. Rotate around the center of view
7. Rotate around the center of view when idle
One 、 brief introduction
FreeCameraController It's for God's perspective 、 Camera control script with free view , Support at the same time Input System Package(New) and Input Manager(Old) new 、 The old two input systems .

The tool has been uploaded to my framework SKFramework Development toolbox in , As shown in the figure .


The framework is already in Github Open source , Address :https://github.com/136512892/SKFramework

Two 、 function
1. Keyboard control translation
Via keyboard W、S、A、D、E、Q Press the key to move forward 、 after 、 Left 、 Right 、 On 、 Translation in the down direction :

2. Mouse control translation
Pan by holding down the left mouse button and dragging :

3. Zoom in and out
Through the scrolling of the mouse wheel, the angle of view is shortened or widened :

4. Rotate around the center of view
By holding down the right mouse button and dragging, the viewing angle rotates around the center :

5. Perspective focus
By calling Focus Function to realize the focus of perspective :
/// <summary>
/// focusing
/// </summary>
/// <param name="position"> Target location </param>
/// <param name="rotation"> Target rotation </param>
/// <param name="duration"> Duration </param>
public void Focus(Vector3 position, Vector3 rotation, float duration);
6. Activity area restrictions
By enabling IsRangeClamped To limit the scope of activities :

By setting xMinValue...zMaxValue Adjust the range of activities , As shown in the figure , The area formed by the green line is the range of activities , The camera will not move beyond this area :

7. Rotate around the center of view when idle
When the user does not operate for a certain period of time , Go idle , The camera automatically rotates around the center of view , This function is enabled by enableAutoIdle Realization :


3、 ... and 、 Core variables

toggle: Switch of control system
isRangeClamped: Whether to enable active area restriction
xMinValue、xMaxValue: stay x Range of active areas on the axis , When isRangeClamped by true It works
yMinValue、yMaxValue: stay y Range of active areas on the axis , When isRangeClamped by true It works
zMinValue、zMaxValue: stay z Range of active areas on the axis , When isRangeClamped by true It works
translateSpeed: Translation speed
boost: Acceleration factor , When pressing... On the left of the keyboard Shift Key will accelerate the movement
positionLerpTime: The time required for coordinate interpolation to the target value
rotationLerpTime: The time required to rotate the interpolation to the target value
mouseMovementSensitivity: The sensitivity of dragging and moving with the left mouse button
mouseRotationSensitivityCurve: Right mouse button drag rotation sensitivity
mouseScrollMoveSpeed: The speed at which the viewing angle gets closer and farther when the mouse wheel rolls
invertScrollDirection: Whether to reverse the direction in which the viewing angle is closer and farther when the mouse wheel is scrolled
enableAutoIdle: Whether to enable automatic idle
idleWaitTime: When the user has no operation within this period , Go idle , The camera automatically rotates around the center of view , When enableAutoIdle by true It works
idleRotateSpeed: When idle , The speed of rotation around the center of view
边栏推荐
- Jerry's watch stops ringing [article]
- ADB basic commands
- net share
- js1day(輸入輸出語法,數據類型,數據類型轉換,var和let區別)
- Linear DP acwing 896 Longest ascending subsequence II
- How to get the operating system running PHP- How to get the OS on which PHP is running?
- 难忘阿里,4面技术5面HR附加笔试面,走的真艰难真心酸
- 上手报告|今天聊聊腾讯目前在用的微服务架构
- 国产免费数据仓库ETL调度自动化运维专家—TASKCTL
- Jerry's watch ringtone audition [article]
猜你喜欢

Hash table acwing 840 Simulated hash table

Counting class DP acwing 900 Integer partition
![[opencv] [image gradient]](/img/37/1f366501e2b4e70ecee6365088167c.jpg)
[opencv] [image gradient]

Js4day (DOM start: get DOM element content, modify element style, modify form element attributes, setinterval timer, carousel Map Case)

Dijkstra AcWing 850. Dijkstra finding the shortest circuit II

Unity skframework framework (XX), VFX lab special effects library

Unity SKFramework框架(十三)、Question 问题模块

阿里初面被两道编程题给干掉,再次内推终上岸(已拿电子offer)

Unity skframework framework (XIV), extension extension function

NTMFS4C05NT1G N-CH 30V 11.9A MOS管,PDF
随机推荐
完全自主可控三维云CAD:CrownCAD便捷的命令搜索,快速定位所需命令具体位置。
NTMFS4C05NT1G N-CH 30V 11.9A MOS管,PDF
绕过ObRegisterCallbacks需要驱动签名方法
Jerry's watch gets the default ringtone selection list [article]
嵌入式软件开发
国内首款、完全自主、基于云架构的三维CAD平台——CrownCAD(皇冠CAD)
West digital decided to raise the price of flash memory products immediately after the factory was polluted by materials
Unity skframework framework (XIV), extension extension function
腾讯三面:进程写文件过程中,进程崩溃了,文件数据会丢吗?
Do you know all the interface test interview questions?
bellman-ford AcWing 853. Shortest path with side limit
Unity skframework framework (XXI), texture filter map resource filtering tool
阿里发布的Redis开发文档,涵盖了所有的redis操作
How can attribute mapping of entity classes be without it?
[200 opencv routines] 100 Adaptive local noise reduction filter
Efficiency comparison between ArrayList and LinkedList
Jerry's watch modifies the alarm clock [chapter]
Five best software architecture patterns that architects must understand
Unity skframework framework (XIII), question module
spfa AcWing 852. SPFA judgement negative ring