当前位置:网站首页>Unity skframework framework (XVIII), roamcameracontroller roaming perspective camera control script
Unity skframework framework (XVIII), roamcameracontroller roaming perspective camera control script
2022-07-02 13:07:00 【CoderZ1010】
Catalog
One 、 brief introduction
RoamCameraController Is a camera control script for roaming Perspective , 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 controls movement
Via keyboard W、S、A、D、E、Q Press the key to move forward 、 after 、 Left 、 Right 、 On 、 Move down :

2. Zoom in and out
Through the scrolling of the mouse wheel, the angle of view is shortened or widened , The effect is equal to W、S Key :

3. Angle of view rotation
Rotate the viewing angle by holding down the right mouse button and dragging :

By setting verticalLimitMax、verticalLimitMin To limit the rotation angle in the vertical direction , To prevent the camera ” Handstand “.

4. 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);
5. 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 :

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: The speed of movement
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: Mouse 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
invertY: Whether to reverse the direction of rotation in the vertical direction
verticalLimitMax: The maximum angle of rotation in the vertical direction
verticalLimitMin: The minimum angle of rotation in the vertical direction
边栏推荐
- Execute any method of any class through reflection
- C#运算符
- JS10day(api 阶段性完结,正则表达式简介,自定义属性,过滤敏感词案例,注册模块验证案例)
- Dijkstra AcWing 850. Dijkstra finding the shortest circuit II
- Jerry's watch delete alarm clock [chapter]
- JDBC prevent SQL injection problems and solutions [preparedstatement]
- 3 a VTT terminal regulator ncp51200mntxg data
- Js5day (event monitoring, function assignment to variables, callback function, environment object this, select all, invert selection cases, tab column cases)
- Linear DP acwing 899 Edit distance
- std::vector批量导入快速去重方法
猜你喜欢

Get started REPORT | today, talk about the microservice architecture currently used by Tencent

js2day(又是i++和++i,if语句,三元运算符,switch、while语句,for循环语句)

Linear DP acwing 895 Longest ascending subsequence

Async/await asynchronous function
![[error record] cannot open](/img/d3/0435ae698ad635be71729c7c047a22.jpg)
[error record] cannot open "XXX" because Apple cannot check whether it contains malware

Hash table acwing 840 Simulated hash table
![Jerry's watch modifies the alarm clock [chapter]](/img/d6/04fb8143027578bb707529a05db548.jpg)
Jerry's watch modifies the alarm clock [chapter]

spfa AcWing 851. SPFA finding the shortest path

Unforgettable Ali, 4 skills, 5 hr additional written tests, it's really difficult and sad to walk

移动式布局(流式布局)
随机推荐
传感器 ADXL335BCPZ-RL7 3轴 加速度计 符合 RoHS/WEEE
Jerry's watch time synchronization [chapter]
The redis development document released by Alibaba covers all redis operations
完全自主可控三维云CAD:CrownCAD便捷的命令搜索,快速定位所需命令具体位置。
Some sudden program ideas (modular processing)
JS10day(api 阶段性完结,正则表达式简介,自定义属性,过滤敏感词案例,注册模块验证案例)
Efficiency comparison between ArrayList and LinkedList
Fundamentals of face recognition (facenet)
Ali was killed by two programming problems at the beginning, pushed inward again, and finally landed (he has taken an electronic offer)
百款拿来就能用的网页特效,不来看看吗?
上手报告|今天聊聊腾讯目前在用的微服务架构
Rust language document Lite (Part 1) - cargo, output, basic syntax, data type, ownership, structure, enumeration and pattern matching
Js1day (input / output syntax, data type, data type conversion, VaR and let differences)
JS6day(DOM结点的查找、增加、删除。实例化时间,时间戳,时间戳的案例,重绘和回流)
Domestic free data warehouse ETL dispatching automation operation and maintenance expert taskctl
Mui WebView down refresh pull-up load implementation
Wechat official account payment prompt MCH_ ID parameter format error
Std:: vector batch import fast de duplication method
js4day(DOM开始:获取DOM元素内容,修改元素样式,修改表单元素属性,setInterval定时器,轮播图案例)
Explain in detail the process of realizing Chinese text classification by CNN