Python-Unity Network
Python 和 Unity 间通讯
https://github.com/Siliconifier/Python-Unity-Socket-Communication
https://github.com/Siliconifier/Python-Unity-Socket-Communication
用于将关键点数据转化为关节动作(各关节旋转角度)
希望机械臂的末端始终竖直。方便夹取。
Unity IK: https://github.com/2000222/Robotic-Arm-IK-in-Unity
自定义自由度,非常好用,基于关节梯度迭代的方法
由这个 IK 算法负责机械臂前三个 joint 的旋转,确保 j4 的 anchor(红点)处于物体后上方的特定位置。
j4 位置的计算方法:
1 | public Vector3 GetPositionForJ4(Vector3 pos) |
之后由向量计算得出 j4 应该旋转的角度,以确保末端竖直。
j5 不旋转,j6 的旋转角度由物体朝向决定。
一条路径由若干个关键点构成,在构建路径时只需输入若干 turning point,就会自行生成路径中的关键点。
1 | public class KeyPoint |
IK 只需要获取关键点的坐标信息就可以生成各个关节旋转的数据。
1 | InverseKinematics(GetPositionForJ4(position)); |
新的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 classGoldWasher
GeneratedBuildings
1 | using System; |
Starting point
The unity’s build-in physics engine PhysX is far from being precise enough for a vehicle simulator.
Through Asset Store
Starting point
The car model should be customizable, i.e. the user drag a car model into a directory and the game should be able to load it.
Filetype .glb is nice but unity doesn’t have build-in support
In tactics project:
1 | git submodule add https://github.com/Siccity/GLTFUtility.git ./Tactics/Assets/ThirdParty/GLTFUtility |
1 | using Siccity.GLTFUtility |
here I use Application.streamingAssetsPath+"/Model/"+JsonReader.vehicle.model.carBody[0].dir
as filepath
ArgumentNullException: Value cannot be null. Parameter name: shader
Save
and Model
folders?Application.streamingAssetsPath
, stands for Assets/StreamingAssets
in Unity editor and Game_Data/StreamingAssets
in exported game.First construct the structure of the json file in c#.
Notice: the name of the member variable should be the same with those in json file
1 | [System.Serializable] |
Notice: [System.Serializable]
is for serialized display in Unity editor.
Then, directly use build-in json loader:
1 | VehiclePara vehicle; |
All the parameters will be stored in the instance vehicle
.
1 | flowchart RL |
1 | { |