当前位置:网站首页>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
边栏推荐
- 8 examples of using date commands
- About the loading of layer web spring layer components, the position of the layer is centered
- Jerry's weather direction coding table [chapter]
- Hash table acwing 840 Simulated hash table
- Counter attack of flour dregs: MySQL 66 questions, 20000 words + 50 pictures in detail! A little six
- 一些突然迸发出的程序思想(模块化处理)
- 国产免费数据仓库ETL调度自动化运维专家—TASKCTL
- Fully autonomous and controllable 3D cloud CAD: crowncad's convenient command search can quickly locate the specific location of the required command.
- JS generates 4-digit verification code
- 8A Synchronous Step-Down regulator tps568230rjer_ Specification information
猜你喜欢

js4day(DOM开始:获取DOM元素内容,修改元素样式,修改表单元素属性,setInterval定时器,轮播图案例)

Finally, someone explained the supervised learning clearly

JS6day(DOM结点的查找、增加、删除。实例化时间,时间戳,时间戳的案例,重绘和回流)

Unity SKFramework框架(十二)、Score 计分模块

Dijkstra AcWing 850. Dijkstra finding the shortest circuit II

js1day(输入输出语法,数据类型,数据类型转换,var和let区别)

阿里发布的Redis开发文档,涵盖了所有的redis操作

挥发性有机物TVOC、VOC、VOCS气体检测+解决方案

Tencent three sides: in the process of writing files, the process crashes, and will the file data be lost?

Ali was killed by two programming problems at the beginning, pushed inward again, and finally landed (he has taken an electronic offer)
随机推荐
Analog to digital converter (ADC) ade7913ariz is specially designed for three-phase energy metering applications
ADB basic commands
Should I have a separate interface assembly- Should I have a separate assembly for interfaces?
Unity SKFramework框架(十二)、Score 计分模块
Direct control PTZ PTZ PTZ PTZ camera debugging (c)
Domestic free data warehouse ETL dispatching automation operation and maintenance expert taskctl
Mobile layout (flow layout)
JSON serialization and parsing
Modular commonjs es module
JS generates 4-digit verification code
Ruby: how to copy variables without pointing to the same object- Ruby: how can I copy a variable without pointing to the same object?
获取文件版权信息
Jerry's watch modifies the alarm clock [chapter]
OLED screen driver based on stm32
Interval DP acwing 282 Stone merging
bellman-ford AcWing 853. Shortest path with side limit
Everyone wants to eat a broken buffet. It's almost cold
NTMFS4C05NT1G N-CH 30V 11.9A MOS管,PDF
Dijkstra AcWing 850. Dijkstra finding the shortest circuit II
8A Synchronous Step-Down regulator tps568230rjer_ Specification information