版本 |
作者 |
参与者 |
完成日期 |
备注 |
UnityAPI_Cloth_V01_1.0 |
严立钻 |
|
2020.07.04 |
|
|
|
|
|
|
立钻哥哥:Unity是一个入门快、提高难的游戏引擎,想要提升能力,至少需要越过3道坎:API+Shader+综合能力;++1、API的积累:对API的合理利用不仅可以减轻自己的编码负担,而且往往可以提高程序的运行效率;这也是钻哥开始“Unity API”独立打造分类的初衷; ++2、Shader编程:想要做出一款精品游戏往往需要有高效的Shader的支持;Unity提供了一套改良的“Shader Lab”系统,优化了繁杂的“Open GL”编程; ++3、综合能力(技术+业务+管理):一款产品的制作除了功能编程外,往往会涉及很多其他领域,例如产品架构、UI交互设计、模型制作等,作为主要的编程人员,对其他相关领域的了解程序往往会影响到产品制作直至最后的产品体验; ++++立钻哥哥一直在推动【VR云游戏=Unity+SteamVR+云技术+5G+AI】,这个只是一个引子,抛砖引玉让大家对整个知识体系有一个明确的落地方向,宝宝们可以根据自己的兴趣方向进行拓展:比如Unity这里是指一种“3D游戏引擎”,也可拓展至“UE4、Cocos2dx”等游戏引擎;SteamVR是一种跨硬件解决方案,也可拓展至“VRTK”等第三方插件;“云技术+5G”是一种跨平台解决方案的核心技术,同样可拓展至其他平台解决方案;AI也是一种先进技术的举例,也可以拓展至任何一种前沿技术; |
++++【Unity API】分类:https://blog.csdn.net/vrunsoftyanlz/category_7637520.html
++++【Unity开发基础】分类:https://blog.csdn.net/vrunsoftyanlz/category_7309057.html
++++【Linux系统编程】分类:https://blog.csdn.net/vrunsoftyanlz/category_9694767.html
++++【C++C铸就生存利器】分类:https://blog.csdn.net/vrunsoftyanlz/category_9325802.html
++++【人工智能AI2026】分类:https://blog.csdn.net/vrunsoftyanlz/category_9212024.html
++++【立钻哥哥CSDN空间】:https://blog.csdn.net/VRunSoftYanlz/
#Cloth布料 |
#Cloth布料++A1、Description描述++B2、Variables变量++C3、Public Function共有函数++D4、Message消息 |
#A1、Description描述 |
#B2、Variables变量 |
++B2、Variables变量++++B2.1、bendingStiffness++++B2.2、capsuleColliders++++B2.3、coefficients++++B2.4、collisionMassScale++++B2.5、damping++++B2.6、enabled++++B2.7、externalAcceleration++++B2.8、friction++++B2.9、normals++++B2.10、randomAcceleration++++B2.11、sleepThreshold++++B2.12、solverFrequency++++B2.13、sphereColliders++++B2.14、stretchingStiffness++++B2.15、useContinuousCollision++++B2.16、useGravity++++B2.17、useVirtualParticles++++B2.18、vertices++++B2.19、worldAccelerationScale++++B2.20、worldVelocityScale++++B2.21、YanlzXREngine.Cloth.Variables |
++B2.1、bendingStiffness |
public float bendingStiffness; |
++++布料的弯曲刚度;
++++该值必须在0~1之间;该值设置为0则禁用弯曲刚度模拟;在很多情况下,当想要布料更加坚硬时,减少布料的顶点数,将会得到更好的效果和性能;
using UnityEngine; using System.Collections; using YanlzXREngine;
public class YanlzCloth : MonoBehaviour{
void MyTestFunc(){ transform.GetComponent<Cloth>().bendingStiffness = 1; } //立钻哥哥:void MyTestFunc(){}
} //立钻哥哥:public class YanlzCloth{} |
++B2.2、capsuleColliders |
public CapsuleCollider[] capsuleColliders; |
++++将与该布料实例进行碰撞的胶囊碰撞体的数组;
++++任何在Cloth.capsuleColliders中指定的胶囊碰撞体将与布料顶点进行碰撞;最多支持32个胶囊碰撞体;
++B2.3、coefficients |
public ClothSkinningCoefficient[] coefficients; |
++++布料蒙皮系统用于设置布与蒙皮网格的交互;
++B2.4、collisionMassScale |
public float collisionMassScale; |
++++碰撞粒子的系数增加多少;
++B2.5、damping |
public float damping; |
++++减少布料的平滑;
++++设置该值去减少布料实例的平滑;该值必须在0~1之间;设置该值为0将会禁用布料平滑;
using UnityEngine; using System.Collections; using YanlzXREngine;
public class YanlzCloth : MonoBehaviour{
void MyTestFunc(){ transform.GetComponent<Cloth>().damping = 1; } //立钻哥哥:void MyTestFunc(){}
} //立钻哥哥:public class YanlzCloth{} |
++B2.6、enabled |
public bool enabled; |
++++是否该布料启用;
++++该属性和检查器面板的组件旁边的复选框相同;一个禁用的布料组件将不会更新它的物理仿真模拟,因此当不需要时,可以使用该属性去暂停布料物体的模拟,布仿真是一种cpu密集型任务;
++B2.7、externalAcceleration |
public Vector3 externalAcceleration; |
++++施加于布料的外力,一个恒量;
++++用这个来模拟恒定大小的力,例如风可影响旗帜;
using UnityEngine; using System.Collections; using YanlzXREngine;
public class YanlzCloth : MonoBehaviour{
void MyTestFunc(){ transform.GetComponent<Cloth>().externalAcceleration = -Physics.gravity / 2; } //立钻哥哥:void MyTestFunc(){}
} //立钻哥哥:public class YanlzCloth{} |
++B2.8、friction |
public float friction; |
++++当角色碰撞时布料的摩擦力;
++B2.9、normals |
public Vector3[] normals; |
++++布料物体的当前法线列表;
++++这使可以读取访问布料物体的法线,所以可以分析目前的模拟状态;请注意:法线索引未必一定对应于源网格索引,尤其当在源网格的三角形带或UV接缝时使用(如:同一顶点多个索引),布料顶点将不同,作为布料模拟只使用每个顶点单个索引;
++B2.10、randomAcceleration |
public Vector3 randomAcceleration; |
++++施加于布料的外力,一个随机变量;
++++用这个来模拟随机大小的力,例如随风飘扬的旗帜;
using UnityEngine; using System.Collections; using YanlzXREngine;
public class YanlzCloth : MonoBehaviour{
void MyTestFunc(){ transform.GetComponent<Cloth>().randomAcceleration = new Vector3(10, 0, 0); } //立钻哥哥:void MyTestFunc(){}
} //立钻哥哥:public class YanlzCloth{} |
++B2.11、sleepThreshold |
public float sleepThreshold; |
++++布料的休眠阀值;
++++休眠阀值是布料粒子的线性速度,低于该值整块布料将会进入休眠;
++B2.12、solverFrequency |
public bool solverFrequency; |
++++每秒迭代求解次数;
++B2.13、sphereColliders |
public ClothSphereColliderPair[] sphereColliders; |
++++将要与布料实例发生碰撞的布料碰撞球对的列表数组;
++++任何在Cloth.capsuleColliders中指定的布球碰撞体对将会与布料的顶点碰撞;最多支持32个球体;
++B2.14、stretchingStiffness |
public float stretchingStiffness; |
++++布料的韧性(可拉伸的程度);
++++必须大于0,或小于等于1;在大多数情况下,当想要一块比较硬的布料,实际上可以减少布料的顶点数,会得到更好的效果和性能;
using UnityEngine; using System.Collections; using YanlzXREngine;
public class YanlzCloth : MonoBehaviour{
void MyTestFunc(){ transform.GetComponent<Cloth>().strethingStiffness = 1; } //立钻哥哥:void MyTestFunc(){}
} //立钻哥哥:public class YanlzCloth{} |
++B2.15、useContinuousCollision |
public float useContinuousCollision; |
++++启用连续碰撞提高碰撞的稳定性;
++B2.16、useGravity |
public bool useGravity; |
++++是否重力影响布料模拟;
using UnityEngine; using System.Collections; using YanlzXREngine;
public class YanlzCloth : MonoBehaviour{
void MyTestFunc(){ //Dont use gravity on this cloth regardless if is Interactive or Skinned. transform.GetComponent<Cloth>().useGravity = false; } //立钻哥哥:void MyTestFunc(){}
} //立钻哥哥:public class YanlzCloth{} |
++B2.17、useVirtualParticles |
public float useVirtualParticles; |
++++每个三角添加一个虚拟粒子提高碰撞稳定性;
++B2.18、vertices |
public Vector3[] vertices; |
++++布料实例的当前顶点的位置;
++++这使可以读取访问布料物体的顶点位置,所以可以分析它目前的模拟状态;请注意:法线索引未必一定对应于源网格索引,尤其当在源网格的三角形带或UV接缝时使用(如:同一顶点多个索引),布料顶点将不同,作为布料模拟只使用每个顶点单个索引;
++B2.19、worldAccelerationScale |
public float worldAccelerationScale; |
++++影响布料顶点的角色外力的世界空间的范围大小;
++B2.20、worldVelocityScale |
public float worldVelocityScale; |
++++将要影响布料顶点的角色运动的世界空间的范围大小;
#C3、Public Functions公共函数 |
++C3、Public Functions公共函数++++C3.1、ClearTransformMotion++++C3.2、SetEnabledFading++++C3.3、YanlzXREngine.Cloth.PublicFunctions |
++C3.1、ClearTransformMotion |
public void ClearTransformMotion(); |
++++从影响布料模拟改变中清除未定的变换;
++++当布料的变换改变时,该布料不会立即跟随改变,恰恰相反,SkinnedMeshRenderer的顶点的新的位置将会通过配置约束下次更新布料模拟影响布料,因此移除改变将会使布料运动更加逼真;
++++在布料发生改变时,可以调用ClearTransformMotion;调用ClearTransformMotion时,将会沿着变换移除布料模拟粒子,因此该变换对布料模拟没有影响;如果想将角色从一点传送到另一点时这是有用的,布料不会突然猛地到达位置;
transform.position = newPosition; GetComponent<Cloth>().ClearTransformMotion(); |
++C3.2、SetEnabledFading |
public void SetEnabledFading(bool enabled, float interpolationTime=0.5f); |
++++[enabled]:Fading enabled or not;
++++淡入淡出的布料模拟;
#D4、立钻哥哥对Cloth类的拓展 |
++++【Unity API】分类:https://blog.csdn.net/vrunsoftyanlz/category_7637520.html
++++【Unity开发基础】分类:https://blog.csdn.net/vrunsoftyanlz/category_7309057.html
++++【Linux系统编程】分类:https://blog.csdn.net/vrunsoftyanlz/category_9694767.html
++++【C++C铸就生存利器】分类:https://blog.csdn.net/vrunsoftyanlz/category_9325802.html
++++【人工智能AI2026】分类:https://blog.csdn.net/vrunsoftyanlz/category_9212024.html
++++【立钻哥哥CSDN空间】:https://blog.csdn.net/VRunSoftYanlz/
立钻哥哥推荐的拓展学习链接(Link_Url) |
++++立钻哥哥Unity 学习空间: http://blog.csdn.net/VRunSoftYanlz/
++++虚拟现实VR资讯: https://blog.csdn.net/VRunSoftYanlz/article/details/89165846
++++HTC_VIVE开发基础:https://blog.csdn.net/VRunSoftYanlz/article/details/81989970
++++Oculus杂谈:https://blog.csdn.net/VRunSoftYanlz/article/details/82469850
++++Oculus安装使用:https://blog.csdn.net/VRunSoftYanlz/article/details/82718982
++++Unity+SteamVR=>VR:https://blog.csdn.net/VRunSoftYanlz/article/details/88809370
++++Unity减少VR晕眩症:https://blog.csdn.net/VRunSoftYanlz/article/details/89115518
++++SteamVR简介:https://blog.csdn.net/VRunSoftYanlz/article/details/86484254
++++SteamVR脚本功能分析:https://blog.csdn.net/VRunSoftYanlz/article/details/86531480
++++SteamVR2.0开发指南:https://blog.csdn.net/VRunSoftYanlz/article/details/86618187
++++SteamVR2.2.0开发指南:https://blog.csdn.net/VRunSoftYanlz/article/details/88784527
++++SteamVR2.2.0快速入门:https://blog.csdn.net/VRunSoftYanlz/article/details/88833579
++++SteamVR2.2.0交互系统:https://blog.csdn.net/VRunSoftYanlz/article/details/89199778
++++SteamVR2.2.0传送机制:https://blog.csdn.net/VRunSoftYanlz/article/details/89390866
++++SteamVR2.2.0教程(一):https://blog.csdn.net/VRunSoftYanlz/article/details/89324067
++++SteamVR2.2.0教程(二):https://blog.csdn.net/VRunSoftYanlz/article/details/89894097
++++SteamVR_Skeleton_Poser:https://blog.csdn.net/VRunSoftYanlz/article/details/89931725
++++SteamVR实战之PMCore:https://blog.csdn.net/VRunSoftYanlz/article/details/89463658
++++SteamVR/Extras:https://blog.csdn.net/VRunSoftYanlz/article/details/86584108
++++SteamVR/Input:https://blog.csdn.net/VRunSoftYanlz/article/details/86601950
++++OpenXR简介:https://blog.csdn.net/VRunSoftYanlz/article/details/85726365
++++VRTK杂谈:https://blog.csdn.net/VRunSoftYanlz/article/details/82562993
++++VRTK快速入门(杂谈):https://blog.csdn.net/VRunSoftYanlz/article/details/82955267
++++VRTK官方示例(目录):https://blog.csdn.net/VRunSoftYanlz/article/details/82955410
++++VRTK代码结构(目录):https://blog.csdn.net/VRunSoftYanlz/article/details/82780085
++++VRTK(SceneResources):https://blog.csdn.net/VRunSoftYanlz/article/details/82795400
++++VRTK_ControllerEvents:https://blog.csdn.net/VRunSoftYanlz/article/details/83099512
++++VRTK_InteractTouch:https://blog.csdn.net/VRunSoftYanlz/article/details/83120220
++++虚拟现实行业应用:https://blog.csdn.net/VRunSoftYanlz/article/details/88360157
++++Steam平台上的VR:https://blog.csdn.net/VRunSoftYanlz/article/details/88960085
++++Steam平台热销VR:https://blog.csdn.net/VRunSoftYanlz/article/details/89007741
++++VR实验:以太网帧的构成:https://blog.csdn.net/VRunSoftYanlz/article/details/82598140
++++实验四:存储器扩展实验:https://blog.csdn.net/VRunSoftYanlz/article/details/87834434
++++FrameVR示例V0913:https://blog.csdn.net/VRunSoftYanlz/article/details/82808498
++++FrameVR示例V1003:https://blog.csdn.net/VRunSoftYanlz/article/details/83066516
++++SwitchMachineV1022:https://blog.csdn.net/VRunSoftYanlz/article/details/83280886
++++PlaySceneManagerV1022:https://blog.csdn.net/VRunSoftYanlz/article/details/83280886
++++Unity5.x用户手册:https://blog.csdn.net/VRunSoftYanlz/article/details/81712741
++++Unity面试题ABC:https://blog.csdn.net/vrunsoftyanlz/article/details/78630687
++++Unity面试题D:https://blog.csdn.net/VRunSoftYanlz/article/details/78630838
++++Unity面试题E:https://blog.csdn.net/vrunsoftyanlz/article/details/78630913
++++Unity面试题F:https://blog.csdn.net/VRunSoftYanlz/article/details/78630945
++++Cocos2dx面试题:https://blog.csdn.net/VRunSoftYanlz/article/details/78630967
++++禅道[zentao]:https://blog.csdn.net/VRunSoftYanlz/article/details/83964057
++++Lua快速入门篇(Xlua拓展):https://blog.csdn.net/VRunSoftYanlz/article/details/81173818
++++Lua快速入门篇(XLua教程):https://blog.csdn.net/VRunSoftYanlz/article/details/81141502
++++Lua快速入门篇(基础概述):https://blog.csdn.net/VRunSoftYanlz/article/details/81041359
++++框架知识点:https://blog.csdn.net/VRunSoftYanlz/article/details/80862879
++++游戏框架(UI框架夯实篇):https://blog.csdn.net/vrunsoftyanlz/article/details/80781140
++++游戏框架(初探篇):https://blog.csdn.net/VRunSoftYanlz/article/details/80630325
++++.Net框架设计:https://blog.csdn.net/VRunSoftYanlz/article/details/87401225
++++从零开始学架构:https://blog.csdn.net/VRunSoftYanlz/article/details/88095895
++++设计模式简单整理:https://blog.csdn.net/vrunsoftyanlz/article/details/79839641
++++专题:设计模式(精华篇):https://blog.csdn.net/VRunSoftYanlz/article/details/81322678
++++U3D小项目参考:https://blog.csdn.net/vrunsoftyanlz/article/details/80141811
++++Unity小游戏算法分析:https://blog.csdn.net/VRunSoftYanlz/article/details/87908365
++++Unity案例(Vehicle):https://blog.csdn.net/VRunSoftYanlz/article/details/82355876
++++UML类图:https://blog.csdn.net/vrunsoftyanlz/article/details/80289461
++++PowerDesigner简介:https://blog.csdn.net/VRunSoftYanlz/article/details/86500084
++++Unity知识点0001:https://blog.csdn.net/vrunsoftyanlz/article/details/80302012
++++Unity知识点0008:https://blog.csdn.net/VRunSoftYanlz/article/details/81153606
++++U3D_Shader编程(第一篇:快速入门篇):https://blog.csdn.net/vrunsoftyanlz/article/details/80372071
++++U3D_Shader编程(第二篇:基础夯实篇):https://blog.csdn.net/vrunsoftyanlz/article/details/80372628
++++Unity引擎基础:https://blog.csdn.net/vrunsoftyanlz/article/details/78881685
++++Unity面向组件开发:https://blog.csdn.net/vrunsoftyanlz/article/details/78881752
++++Unity物理系统:https://blog.csdn.net/vrunsoftyanlz/article/details/78881879
++++Unity2D平台开发:https://blog.csdn.net/vrunsoftyanlz/article/details/78882034
++++UGUI基础:https://blog.csdn.net/vrunsoftyanlz/article/details/78884693
++++UGUI进阶:https://blog.csdn.net/vrunsoftyanlz/article/details/78884882
++++UGUI综合:https://blog.csdn.net/vrunsoftyanlz/article/details/78885013
++++Unity动画系统基础:https://blog.csdn.net/vrunsoftyanlz/article/details/78886068
++++Unity动画系统进阶:https://blog.csdn.net/vrunsoftyanlz/article/details/78886198
++++Navigation导航系统:https://blog.csdn.net/vrunsoftyanlz/article/details/78886281
++++Unity特效渲染:https://blog.csdn.net/vrunsoftyanlz/article/details/78886403
++++Unity数据存储:https://blog.csdn.net/vrunsoftyanlz/article/details/79251273
++++Unity中Sqlite数据库:https://blog.csdn.net/vrunsoftyanlz/article/details/79254162
++++WWW类和协程:https://blog.csdn.net/vrunsoftyanlz/article/details/79254559
++++Unity网络:https://blog.csdn.net/vrunsoftyanlz/article/details/79254902
++++Unity资源加密:https://blog.csdn.net/VRunSoftYanlz/article/details/87644514
++++PhotonServer简介:https://blog.csdn.net/VRunSoftYanlz/article/details/86652770
++++编写Photon游戏服务器:https://blog.csdn.net/VRunSoftYanlz/article/details/86682935
++++C#事件:https://blog.csdn.net/vrunsoftyanlz/article/details/78631267
++++C#委托:https://blog.csdn.net/vrunsoftyanlz/article/details/78631183
++++C#集合:https://blog.csdn.net/vrunsoftyanlz/article/details/78631175
++++C#泛型:https://blog.csdn.net/vrunsoftyanlz/article/details/78631141
++++C#接口:https://blog.csdn.net/vrunsoftyanlz/article/details/78631122
++++C#静态类:https://blog.csdn.net/vrunsoftyanlz/article/details/78630979
++++C#中System.String类:https://blog.csdn.net/vrunsoftyanlz/article/details/78630945
++++C#数据类型:https://blog.csdn.net/vrunsoftyanlz/article/details/78630913
++++Unity3D默认的快捷键:https://blog.csdn.net/vrunsoftyanlz/article/details/78630838
++++游戏相关缩写:https://blog.csdn.net/vrunsoftyanlz/article/details/78630687
++++UnityAPI.Rigidbody刚体:https://blog.csdn.net/VRunSoftYanlz/article/details/81784053
++++UnityAPI.Material材质:https://blog.csdn.net/VRunSoftYanlz/article/details/81814303
++++UnityAPI.Android安卓:https://blog.csdn.net/VRunSoftYanlz/article/details/81843193
++++UnityAPI.AndroidJNI安卓JNI:https://blog.csdn.net/VRunSoftYanlz/article/details/81879345
++++UnityAPI.Transform变换:https://blog.csdn.net/VRunSoftYanlz/article/details/81916293
++++UnityAPI.WheelCollider轮碰撞器:https://blog.csdn.net/VRunSoftYanlz/article/details/82356217
++++UnityAPI.Resources资源:https://blog.csdn.net/VRunSoftYanlz/article/details/83155518
++++JSON数据结构:https://blog.csdn.net/VRunSoftYanlz/article/details/82026644
++++CocosStudio快速入门:https://blog.csdn.net/VRunSoftYanlz/article/details/82356839
++++Unity企业内训(目录):https://blog.csdn.net/VRunSoftYanlz/article/details/82634668
++++Unity企业内训(第1讲):https://blog.csdn.net/VRunSoftYanlz/article/details/82634733
++++Unity企业内训(第2讲):https://blog.csdn.net/VRunSoftYanlz/article/details/82861180
++++Unity企业内训(第3讲):https://blog.csdn.net/VRunSoftYanlz/article/details/82927699
++++Unity企业内训(第4讲):https://blog.csdn.net/VRunSoftYanlz/article/details/83479776
++++Unity企业内训(第5讲):https://blog.csdn.net/VRunSoftYanlz/article/details/83963811
++++Unity企业内训(第6讲):https://blog.csdn.net/VRunSoftYanlz/article/details/84207696
++++钻哥带您了解产品原型:https://blog.csdn.net/VRunSoftYanlz/article/details/87303828
++++插件
++++计算机组成原理(教材篇):https://blog.csdn.net/VRunSoftYanlz/article/details/82719129
++++5G接入:云计算和雾计算:https://blog.csdn.net/VRunSoftYanlz/article/details/88372718
++++云计算通俗讲义:https://blog.csdn.net/VRunSoftYanlz/article/details/88652803
++++立钻哥哥Unity 学习空间: http://blog.csdn.net/VRunSoftYanlz
--_--VRunSoft:lovezuanzuan--_--
--_--VRunSoft:lovezuanzuan--_--