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. 【转载】Javascript原型继承-学习笔记

    阮一峰这篇文章写的很好 http://www.ruanyifeng.com/blog/2011/06/designing_ideas_of_inheritance_mechanism_in_javas ...

  2. WP7 MD5加密

    WP7不支持MD5加密,在网上找了一个实现MD5加密的算法. //Copyright (c) Microsoft Corporation. All rights reserved. using Sys ...

  3. Eclipse引用Library失败的问题

    整个导入流程严格按照guide的内容操作,但是始终无法导入,设置导入后项目中不出现相关的Library project.在设置完library之后重新打开始始终显示关联错误,就是reference那里 ...

  4. 新浪微博顶部新评论提示层效果——position:fixed

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  5. 8个必备的PHP功能开发 (转)

    做过PHP开发的程序员应该清楚,PHP中有很多内置的功能,掌握了它们,可以帮助你在做PHP开发时更加得心应手,本文将分享8个开发必备的PHP功能,个个都非常实用,希望各位PHP开发者能够掌握. 1.传 ...

  6. 【英语】Bingo口语笔记(47) - 关于马的表达

    beat a dead horse 浪费口舌

  7. win7下的IP-主机名映射

    今天学了个技巧,win7下有个目录:C:\Windows\System32\drivers\etc 该目录下有个文件: hosts 在这个文件里面我们可以映射IP-主机名: 127.0.0.1 loc ...

  8. Android 混合开发 的一些心得。

    其实所谓这个混合开发,也就是hybird,就是一些简单的,html5和native 代码之间的交互.很多电商之类的app里面都有类似的功能, 这种东西其实还是蛮重要的,主要就是你有什么功能都可以进行热 ...

  9. WCF tcpTrace.exe配置

    Web.config <?xml version="1.0" encoding="utf-8"?> <configuration> &l ...

  10. 更新Code First生成的数据库

    1,首次访问时会自动生成数据库 2,某个Model增加一个字段后,再次访问会报,数据库不是最新 操作 1,Enable-Migrations 注意选择Default project为Star.Core ...