当前位置:网站首页>Unity skframework framework (XVII), freecameracontroller God view / free view camera control script
Unity skframework framework (XVII), freecameracontroller God view / free view camera control script
2022-07-02 13:07:00 【CoderZ1010】
Catalog
1. Keyboard control translation
4. Rotate around the center of view
7. Rotate around the center of view when idle
One 、 brief introduction
FreeCameraController It's for God's perspective 、 Camera control script with free view , 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 control translation
Via keyboard W、S、A、D、E、Q Press the key to move forward 、 after 、 Left 、 Right 、 On 、 Translation in the down direction :
2. Mouse control translation
Pan by holding down the left mouse button and dragging :
3. Zoom in and out
Through the scrolling of the mouse wheel, the angle of view is shortened or widened :
4. Rotate around the center of view
By holding down the right mouse button and dragging, the viewing angle rotates around the center :
5. 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);
6. 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 :
7. Rotate around the center of view when idle
When the user does not operate for a certain period of time , Go idle , The camera automatically rotates around the center of view , This function is enabled by enableAutoIdle Realization :
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: Translation speed
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: The sensitivity of dragging and moving with the left mouse button
mouseRotationSensitivityCurve: Right mouse button drag rotation 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
enableAutoIdle: Whether to enable automatic idle
idleWaitTime: When the user has no operation within this period , Go idle , The camera automatically rotates around the center of view , When enableAutoIdle by true It works
idleRotateSpeed: When idle , The speed of rotation around the center of view
边栏推荐
- leetcode621. 任务调度器
- The UVM Primer——Chapter2: A Conventional Testbench for the TinyALU
- LTC3307AHV 符合EMI标准,降压转换器 QCA7005-AL33 PHY
- Js10day (API phased completion, regular expression introduction, custom attributes, filtering sensitive word cases, registration module verification cases)
- Js4day (DOM start: get DOM element content, modify element style, modify form element attributes, setinterval timer, carousel Map Case)
- Interval DP acwing 282 Stone merging
- C#修饰符
- Should I have a separate interface assembly- Should I have a separate assembly for interfaces?
- C operator
- Day4 operator, self increasing, self decreasing, logical operator, bit operation, binary conversion decimal, ternary operator, package mechanism, document comment
猜你喜欢
Word efficiency guide - word's own template
js1day(輸入輸出語法,數據類型,數據類型轉換,var和let區別)
VIM super practical guide collection of this one is enough
3 A VTT端接 稳压器 NCP51200MNTXG资料
Linear DP acwing 898 Number triangle
Unity skframework framework (XX), VFX lab special effects library
Jerry's watch delete alarm clock [chapter]
自主可控三维云CAD:CrownCAD赋能企业创新设计
应用LNK306GN-TL 转换器、非隔离电源
[opencv learning] [common image convolution kernel]
随机推荐
模数转换器(ADC) ADE7913ARIZ 专为三相电能计量应用而设计
Fully autonomous and controllable 3D cloud CAD: crowncad's convenient command search can quickly locate the specific location of the required command.
The UVM Primer——Chapter2: A Conventional Testbench for the TinyALU
Jerry's weather code table [chapter]
挥发性有机物TVOC、VOC、VOCS气体检测+解决方案
Ali on three sides, it's really difficult to successfully get the offer rated P7
Explain in detail the process of realizing Chinese text classification by CNN
屠榜多目标跟踪!BoT-SORT:稳健的关联多行人跟踪
Linear DP acwing 898 Number triangle
PXE installation UOS prompt NFS over TCP not available from 10 x.x.x
Unity skframework framework (XXI), texture filter map resource filtering tool
js3day(数组操作,js冒泡排序,函数,调试窗口,作用域及作用域链,匿名函数,对象,Math对象)
Unity skframework framework (XV), singleton singleton
To bypass obregistercallbacks, you need to drive the signature method
Efficiency comparison between ArrayList and LinkedList
How to get the operating system running PHP- How to get the OS on which PHP is running?
8A Synchronous Step-Down regulator tps568230rjer_ Specification information
嵌入式软件开发
Jerry's watch ringtone audition [article]
Unity skframework framework (XX), VFX lab special effects library