PhysX

 1、施加力:

         if(GUILayout.Button("普通力‹",GUILayout.Height()))
{
//施加一个力,X轴方向力度为1000,Y轴方向力度为1000
addFrceObj.rigidbody.AddForce (, , );
} if(GUILayout.Button("位置力",GUILayout.Height()))
{
//施加一个位置力,物体将会朝向这个位置发力移动,力的模式为冲击力。
Vector3 force = cubeObj.transform.position - addPosObj.transform.position;
addPosObj.rigidbody.AddForceAtPosition(force,addPosObj.transform.position,ForceMode.Impulse);
}

 2、刚体的碰撞回调:

 3、What is Kinematic Rigidbodies?

  A Kinematic Rigidbody is a Rigidbody that has the isKinematic option enabled. Kinematic Rigidbodies are not affected by forces, gravity or collisions. They are driven explicitly by setting the position and rotation of the Transform or animating them, yet they can interact with other non-Kinematic Rigidbodies.

  Kinematic Rigidbodies correctly wake up other Rigidbodies when they collide with them, and they apply friction to Rigidbodies placed on top of them.

 4、What is Static Collider?

  A Static Collider is a GameObject that has a Collider but not a Rigidbody. Static Colliders are used for level geometry which always stays at the same place and never moves around. You can add a Mesh Collider to your already existing graphical meshes (even better use the Import Settings Generate Colliders check box), or you can use one of the other Collider types.

 5、The Physics Material is used to adjust friction and bouncing effects of colliding objects.

  

 6、Character Controller

  The Character Controller is mainly used for third-person or first-person player control that does not make use of Rigidbody physics.

  Character Controller组件用于帮助控制没有RigidBody的组件。

 7、Character Controller和RigidBody互斥,同一GameObject只能应用其一。

 8、SmoothFollow.js是内置Camera脚本组件,可以让某个Camera紧跟某个对象,实现第三人称Camera。

  

 9、使用Ray检测碰撞

         //??????0??????
Ray ray = new Ray(Vector3.zero, transform.position);
//?????????
RaycastHit hit;
Physics.Raycast(ray, out hit, );
//?????????????????????????
Debug.DrawLine(ray.origin, hit.point);

10、关节必须依赖于刚体组件。

 11、Triger与Collision分布图:

 12、动态添加关节组件:

         if(GUILayout.Button("添加链条关节"))
{ ResetJoint();
jointComponent = gameObject.AddComponent("HingeJoint");
HingeJoint hjoint = (HingeJoint)jointComponent;
connectedObj.rigidbody.useGravity = true;
hjoint.connectedBody = connectedObj.rigidbody;
} if(GUILayout.Button("添加固定关节"))
{
ResetJoint();
jointComponent =gameObject.AddComponent("FixedJoint");
FixedJoint fjoint = (FixedJoint)jointComponent;
connectedObj.rigidbody.useGravity = true;
fjoint.connectedBody = connectedObj.rigidbody;
}

PhysX的更多相关文章

  1. 关于缺少nvToolsExt64_1.lib时的PhysX的处理

    我本人之所以缺少这个文件是因为我的PhysX如果你的PhysX是从UE4源代码中提取的,那么可能会出现如下错误,提示找不到nvToolsExt64_1.lib(本机是64bit的操作系统) 那就执行u ...

  2. 物理引擎-Physx的源代码去哪里找

    前几天无意中看到了Physx开源了,就连自己的领导也高兴了一下,让本道士去下载源代码琢磨一下,顺便做几个例子跑起来.结果没成想这个nvidia的github上的源代码被移除了,而且csdn,pudn上 ...

  3. Physx入门

    [疑问] 1.Physx中的场景有大小的概念么?如果有大小,那么场景中的刚体超出场景边界之后, 如何定义之后的行为. 2.如何给一个刚体增加动量?目前的接口只看到设置速度或者增加作用力.

  4. Mesh.Bake Scaled Mesh PhysX CollisionData的性能问题

    最近在做项目优化时,遇到Mesh.Bake Scaled Mesh PhysX CollisionData这个问题,随手记录一下. profiler中显示的cpu波峰瓶颈中,Mesh.Bake Sca ...

  5. PhysX Clothing for UE4

    转自:http://www.52vr.com/article-737-1.html Hello! 之前看到论坛里有人发了个关于UE4布料的小知识,于是跟帖说抽空写个布料的工作流程供大家参考,那么,今天 ...

  6. [原][译][physX]phsyX3.3.4官方文档物理引擎基本概念和例子介绍

    世界和物体: 物理世界包括集合的场景,每个包含的物体称为演员(Actors) 每个场景(Scene)都定义了自己的参考框架包含了所有的时间和空间 在不同的场景,演员不互相影响 演员通常有三种类型:刚体 ...

  7. 我所遭遇过的游戏中间件--PhysX

    我所遭遇过的游戏中间件--PhysX PhysX现在是Nvidia的物理中间件.其特点是简练且功能强大.当我最初拿到PHYSX的SDK时,就发现这个物理中间件比Havok要小很多,但该有的功能都有,甚 ...

  8. PhysX SDK src

    PhysX SDK src Physx3.3 source code http://download.csdn.net/download/qq122252656/9427387 Nvidia CUDA ...

  9. PhysX SDK

    PhysX SDK https://developer.nvidia.com/physx-sdk NVIDIA PhysX SDK Downloads http://www.nvidia.cn/obj ...

随机推荐

  1. hibernate4 二级缓存demo实例

    转载:http://blog.csdn.net/chaoowang/article/details/21236501 hibernate使用版本是:hibernate-release-4.3.4.Fi ...

  2. warning:performSelector may cause a leak because its selector

    warning:performSelector may cause a leak because its selector     在ARC项目中使用 performSelector: withObj ...

  3. 以一个上传文件的例子来说 DistributedFileSystem

    public class UploadAndDown { public static void main(String[] args) { UploadAndDown uploadAndDown = ...

  4. Java笔记之String

    1. String s="a",t="b"; t.concat(s); 之后,t仍然是"b",而不是"ba",要使t是& ...

  5. HDU1026 Ignatius and the Princess I

    解题思路:打印路径是关键,细节处理见代码. #include<cstdio> #include<cstring> #include<algorithm> using ...

  6. yii2.0 事务

    $transaction=\Yii::$app->db->beginTransaction(); $model=Customer::findOne(1); $model->name= ...

  7. 实验室 Linux 集群的管理常用命令

    实验室有一个Linux集群,本文做一下记录. SSH相关命令 通过SSH登录集群中的其他机器上的操作系统(或虚拟机中的操作系统).操作系统之间已经设置免密码登录. 1. 无选项参数运行 SSH 通常使 ...

  8. jQuery 实现Bootstrap Chart 图表

    很多时候我们制作报表的时候需要图表,如果你使用bootstrap开发你的网站,如果你需要使用图表,那么最简单的方法就是就是使用bootstrap 的chart.js来实现图表,下面介绍方法 1.引入c ...

  9. C++ STL算法系列6---copy函数

    现在我们来看看变易算法.所谓变易算法(Mutating algorithms)就是一组能够修改容器元素数据的模板函数,可进行序列数据的复制,变换等. 我们现在来看看第一个变易算法:元素复制算法copy ...

  10. PyPI镜像网站

    镜像列表:http://www.pypi-mirrors.org/ 清华镜像:http://e.pypi.python.org/