当前位置:网站首页>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
边栏推荐
- Unity SKFramework框架(二十)、VFX Lab 特效库
- Apply lnk306gn-tl converter, non isolated power supply
- ADB basic commands
- Window10 upgrade encountered a big hole error code: 0xc000000e perfect solution
- 绕过ObRegisterCallbacks需要驱动签名方法
- West digital decided to raise the price of flash memory products immediately after the factory was polluted by materials
- Js8day (rolling event (scroll family), offset family, client family, carousel map case (to be done))
- Browser storage scheme
- About asp Net MVC project in local vs running response time is too long to access, the solution!
- 8A 同步降压稳压器 TPS568230RJER_规格信息
猜你喜欢

Js7day (event object, event flow, event capture and bubble, prevent event flow, event delegation, student information table cases)

Floyd AcWing 854. Floyd finds the shortest path

Js5day (event monitoring, function assignment to variables, callback function, environment object this, select all, invert selection cases, tab column cases)

Js10day (API phased completion, regular expression introduction, custom attributes, filtering sensitive word cases, registration module verification cases)

js1day(輸入輸出語法,數據類型,數據類型轉換,var和let區別)

Hash table acwing 840 Simulated hash table

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

js3day(数组操作,js冒泡排序,函数,调试窗口,作用域及作用域链,匿名函数,对象,Math对象)

8 examples of using date commands

Everyone wants to eat a broken buffet. It's almost cold
随机推荐
Js1day (input / output syntax, data type, data type conversion, VaR and let differences)
VIM super practical guide collection of this one is enough
上海交大教授:何援军——包围盒(包容体/包围盒子)
JS10day(api 阶段性完结,正则表达式简介,自定义属性,过滤敏感词案例,注册模块验证案例)
Js3day (array operation, JS bubble sort, function, debug window, scope and scope chain, anonymous function, object, Math object)
Rust language document Lite (Part 1) - cargo, output, basic syntax, data type, ownership, structure, enumeration and pattern matching
Interval DP acwing 282 Stone merging
Modular commonjs es module
Package management tools
js1day(輸入輸出語法,數據類型,數據類型轉換,var和let區別)
一些突然迸发出的程序思想(模块化处理)
国内首款、完全自主、基于云架构的三维CAD平台——CrownCAD(皇冠CAD)
[opencv] [image gradient]
OLED screen driver based on stm32
js2day(又是i++和++i,if语句,三元运算符,switch、while语句,for循环语句)
C operator
Hash table acwing 841 String hash
[opencv learning] [Canny edge detection]
Jerry's watch time synchronization [chapter]
[opencv learning] [template matching]