当前位置:网站首页>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
边栏推荐
- 8A Synchronous Step-Down regulator tps568230rjer_ Specification information
- ASP. Net MVC default configuration, if any, jumps to the corresponding program in the specified area
- Floyd AcWing 854. Floyd finds the shortest path
- 上手报告|今天聊聊腾讯目前在用的微服务架构
- std::vector批量导入快速去重方法
- js2day(又是i++和++i,if语句,三元运算符,switch、while语句,for循环语句)
- [opencv] [image gradient]
- 国内首款、完全自主、基于云架构的三维CAD平台——CrownCAD(皇冠CAD)
- 屠榜多目标跟踪!BoT-SORT:稳健的关联多行人跟踪
- 3 A VTT端接 稳压器 NCP51200MNTXG资料
猜你喜欢
[opencv] [image gradient]
Ltc3307ahv meets EMI standard, step-down converter qca7005-al33 phy
VIM super practical guide collection of this one is enough
8 examples of using date commands
Sensor adxl335bcpz-rl7 3-axis accelerometer complies with rohs/weee
[opencv learning] [Canny edge detection]
Linear DP acwing 902 Shortest editing distance
Dijkstra AcWing 850. Dijkstra finding the shortest circuit II
Modular commonjs es module
Unity SKFramework框架(十四)、Extension 扩展函数
随机推荐
获取文件版权信息
ArrayList与LinkedList效率的对比
Direct control PTZ PTZ PTZ PTZ camera debugging (c)
ADB basic commands
js5day(事件监听,函数赋值给变量,回调函数,环境对象this,全选反选案例,tab栏案例)
正确遍历EntryList方法
Oracle从入门到精通(第4版)
Rust语言文档精简版(上)——cargo、输出、基础语法、数据类型、所有权、结构体、枚举和模式匹配
Hash table acwing 841 String hash
Ruby: how to copy variables without pointing to the same object- Ruby: how can I copy a variable without pointing to the same object?
阿里发布的Redis开发文档,涵盖了所有的redis操作
架构师必须了解的 5 种最佳软件架构模式
The coloring method determines the bipartite graph acwing 860 Chromatic judgement bipartite graph
NTMFS4C05NT1G N-CH 30V 11.9A MOS管,PDF
嵌入式软件开发
Unity SKFramework框架(二十)、VFX Lab 特效库
How can attribute mapping of entity classes be without it?
Mobile layout (flow layout)
Js7day (event object, event flow, event capture and bubble, prevent event flow, event delegation, student information table cases)
Heap acwing 839 Simulated reactor