当前位置:网站首页>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
边栏推荐
- Js4day (DOM start: get DOM element content, modify element style, modify form element attributes, setinterval timer, carousel Map Case)
- Jerry's weather code table [chapter]
- [opencv learning] [image filtering]
- Unity SKFramework框架(二十一)、Texture Filter 贴图资源筛选工具
- Package management tools
- VIM super practical guide collection of this one is enough
- Js8day (rolling event (scroll family), offset family, client family, carousel map case (to be done))
- spfa AcWing 851. SPFA finding the shortest path
- 日本赌国运:Web3.0 ,反正也不是第一次失败了!
- moon
猜你喜欢
Interesting interview questions
嵌入式软件开发
Counting class DP acwing 900 Integer partition
Mobile layout (flow layout)
Js10day (API phased completion, regular expression introduction, custom attributes, filtering sensitive word cases, registration module verification cases)
Unity SKFramework框架(二十)、VFX Lab 特效库
JDBC prevent SQL injection problems and solutions [preparedstatement]
[opencv learning] [moving object detection]
8 examples of using date commands
Linear DP acwing 898 Number triangle
随机推荐
js1day(輸入輸出語法,數據類型,數據類型轉換,var和let區別)
Hash table acwing 841 String hash
Jerry's weather direction coding table [chapter]
百款拿来就能用的网页特效,不来看看吗?
Finally, someone explained the supervised learning clearly
Five best software architecture patterns that architects must understand
Linear DP acwing 898 Number triangle
日本赌国运:Web3.0 ,反正也不是第一次失败了!
挥发性有机物TVOC、VOC、VOCS气体检测+解决方案
Jerry's watch time synchronization [chapter]
Std:: vector batch import fast de duplication method
C modifier
Counting class DP acwing 900 Integer partition
PR usage skills, how to use PR to watermark?
Jerry's watch reads the alarm clock [chapter]
Js6day (search, add and delete DOM nodes. Instantiation time, timestamp, timestamp cases, redrawing and reflow)
Interesting interview questions
Jerry's weather code table [chapter]
Jerry's watch gets the default ringtone selection list [article]
基于STM32的OLED 屏幕驱动