/FxkrbKwOGoAGYyxbrI5c3fDznSf.png)
机械臂 DT 需要的功能:
/FxkrbKwOGoAGYyxbrI5c3fDznSf.png)
机械臂 DT 需要的功能:

用于将关键点数据转化为关节动作(各关节旋转角度)
新的Input System:https://gamedevbeginner.com/input-in-unity-made-easy-complete-guide-to-the-new-system/#how_to_manage_input
目前的想法是将unity的physx和mujoco结合在一起,简化physx的对于相对运动很少的刚体间的物理解算。
Mujoco:https://mujoco.readthedocs.io/en/latest/unity.html
Besiege
需要更高的建造自由度:例如刚体零件的顶点自定义,3轴移动,3轴旋转,3轴缩放。
可视化内容更丰富:例如碰撞箱,连接点。
目前还是使用phsX引擎,考虑一下GPU加速这块功能。
零件之间的连接考虑使用joint以外的方式,特别是某些刚性连接。
参考我写的BesiegeModern Mod
{金属,木,玻璃}
需要自己写shader material实现该功能。
譬如撞击变形,高速击穿之类的
很难
在已有父刚体在运行中,更改碰撞箱布置是非常耗费性能的。
自定义场景元素
参考mc机械动力模组的“思索”
animation制作
起部分教程作用,添加沉浸感,吸引一些非硬核玩家
难,可能对电脑性能有较高要求。
unity shader
unity animation
美术相关工具
物理引擎Game Physics Engine Development
unity URP
.po file for zh-en translationApply patches on the Initialize() method in Db class.
1 | public class Patches |
Take gold washer (just like water purifier but output small amount of gold) as an example.
1 | using System; |
Create a new csharp class file in VS and copy the content into it.
Remember to rename
id in method CreateBuildingDef()ID in classGoldWasherGeneratedBuildings1 | using System; |
Only contain the control over control surface (on control over throttle)
Function: KeepPitch()
Control the angle of horizontal tail (elevator)
First keep the angle of elevator same with AoA(攻角), to avoid the disturbance of the horizontal tail on the attitide of the aircraft.
1 | aircraft.PitchAngle = aircraft.AoA; |
这里的aircraft.PitchAngle指的是飞机升降舵的角度(下片为正)
根据当前俯仰角,俯仰速度,和目标俯仰角,调整升降舵面的角度
1 | aircraft.PitchAngle += 5 * (p - aircraft.Pitch) / Mathf.Exp(10 * aircraft.PitchSpeed * Mathf.Sign(p - aircraft.Pitch)); |
与俯仰角类似(分别控制滚转舵面以及偏航舵面),不过不需要第一步
Control the thrust of aircraft to change the angle of gliding
保持飞机的俯仰角不变(5度仰角)
1 | KeepPitch(5f); |
计算当前下滑角
1 | float velAngle = 90 - Vector3.Angle(aircraft.rb.velocity, Vector3.up); |
根据下滑角更改油门大小
1 | aircraft.Thrust += (p - velAngle)/500f; |
通过调整飞机的下滑角来使飞机在竖直面上接近并维持在理想的下滑道
1 | Vector3 approachDirection = Vector3.ProjectOnPlane(route.Destination - transform.position, route.direction); |
1 | ThrustKeepGliding(-3 + Mathf.Clamp(approachDirection.y / 10f, -5,5)); |
通过调整飞机的偏航舵面角度(进而影响飞机的y轴rotation)来使飞机在水平面上接近并维持在理想的航道上
1 | Vector3 approachDirection = Vector3.ProjectOnPlane(route.Destination - transform.position, route.direction); |
1 | KeepYaw(-8 + Mathf.Clamp(distance / 10f, -50, 50)); |
基本的策略以及阐述完毕,那么所谓的理想下滑道到底应该怎么得到呢?
理想下滑道是一个射线,包含一个终点(飞机着陆的终点)和一个方向(飞机接近的方向)
1 | public class Target_Route |
理想航道的偏航角和下滑角已知(分别为-8(平行于着陆跑道)和-3)
通过迭代飞机着陆所需时间来求得下滑道终点的位置
1 | route.Destination = CV.transform.position; |

Starting point
The unity’s build-in physics engine PhysX is far from being precise enough for a vehicle simulator.

mod name: ModernAirCombat