刚体rigidbody怎么如何解除电脑休眠状态休眠

Rigidbody物体体积过小时,不能平稳放置怎解?_unity3d吧_百度贴吧
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&签到排名:今日本吧第个签到,本吧因你更精彩,明天继续来努力!
本吧签到人数:0成为超级会员,使用一键签到本月漏签0次!成为超级会员,赠送8张补签卡连续签到:天&&累计签到:天超级会员单次开通12个月以上,赠送连续签到卡3张
关注:54,077贴子:
Rigidbody物体体积过小时,不能平稳放置怎解?收藏
如图精确摆放到地表,运行后发生倾斜,而且都是朝z轴。再如图如果叠放的话,运行就会倒下来。scale大一些不会倒,因为倾斜影响会相对较小,但需要做成这种比例,跟重力加速度设置也有关。图中是3D物体,正交侧视图。demo是个多米诺模拟,缩放小是因为体积过大,倒下的速度会显得很慢,因为实际的骨牌也是很小的,几米高的骨牌倒下看着都费劲。如果G值增大,倒下速度会增大,但倾斜影响也更大,和原G值+缩小的骨牌效果是一样的。查了很多,目前无解。
火星时代unity3d,争当游戏大触,月薪过万小意思,手绘技能,概念设计,商业应用一步到位,你与u3d游戏特效设计师只差一步,赶快点击吧!
模型不对?
啦啦啦啦~啦啦啦啦~种!太!阳!
看图不解释 发个广告欢迎新手unity进群提问:q
质量弄重一点
不是有个drag摩擦力吗,,设置一个合适的值就到不了了——来自 爱贴吧 Windows Phone 客户端
自定义材质,弹性设成最小
如果LZ不是拟真的话,可以尝试自己写这个骨牌效应,而不要使用U3D自带的物理碰撞去做,刚体和碰撞盒只是作为碰撞检测,而不作用物理反馈
工程在此链接:
密码: sbw6
这个设置会影响稳定性,缺省设置可以保证垂直摞两块不倒
再总结下,骨牌体积比例 3:6:1, 这里设置成(0.3, 0.6, 0.1), 重力加速度98.1,体积与G的比例可以保证倒下的速度是正常速度,因为越大的物体运动看起来越慢。体积与G都乘以10是因为太小的物体阴影不好处理,而且可能会有更多精度问题。综上所述,遇到这个叠不住的问题。
登录百度帐号推荐应用
为兴趣而生,贴吧更懂你。或Rigidbody 刚体
Inherits from
Control of an object's position through physics simulation.
通过物理模拟控制一个物体的位置。
Rigidbody components take control over an object's position - it makes the objects fall down under the influence of gravity,
and can calculate how objects will respond to collisions.
Rigidbody组件控制物体的位置 - 它使物体在重力影响下下落,并可计算物体将怎样响应碰撞。
When manipulating rigidbody parameters you should work inside the .
Physics simulation is carried out in discrete timesteps. The
is called immediately before each step.
当操作刚体参数的时候,你应该在FixedUpdate函数中使用它,物理模拟以离散的时间步执行。FixedUpdate函数在每一步之前被立即调用。
Things to watch out for when using rigid bodies:
使用刚体需要注意的事:
1. If your simulation looks like slow motion and not solid:
This is a problem of scale. When your game world is huge everything will
appear to be move very slowly.
Make sure all your models are in real world sizes. For example a car
should be around 4 meters long. A character around 2 meters high.
An object falls at the same acceleration no matter big or small, heavy
If your game world has a large scale, objects will still fall at the
same acceleration. But since everything is larger, objects will appear
like they fall slower.
如果你的模拟看起来像慢动作并且不真实: 这是缩放的问题。如果你的游戏世界非常大,所以的东西将显示移动非常慢,确保你所有的模型为真实世界大小。例如,一个汽车应该有4米长,一个角色约2米高。物体以相同的加速度下落,不论大或小,重或轻。如果你的游戏世界有较大的缩放,物体仍以相同的加速度下落,但是因为所有的物体都比较大,物体的下落显得就比较慢。
Variables变量
The velocity vector of the rigidbody.
刚体的速度向量。
The angular velocity vector of the rigidbody.
刚体的角速度向量。
The drag of the object.
物体的阻力。
The angular drag of the object.
物体的角阻力。
The mass of the rigidbody.
刚体的质量。
Controls whether gravity affects this rigidbody.
控制重力是否影响整个刚体。
Controls whether physics affects the rigidbody.
控制物理学是否够影响这个刚体。
Controls whether physics will change the rotation of the object.
控制物理是否改变物体的旋转。
The Rigidbody's collision detection mode.
刚体的碰撞检测模式。
The center of mass relative to the transform's origin.
相对于变换原点的质量中心。
The center of mass of the rigidbody in world space (Read Only).
在世界坐标空间的刚体的质量中心。(只读)
The rotation of the inertia tensor.
惯性张量的旋转。
The diagonal inertia tensor of mass relative to the center of mass.
相对于重心的质量的惯性张量对角线。
Should collision detection be enabled? (By default always enabled)
碰撞检测应否启用?(默认总是启用的)
Force cone friction to be used for this rigidbody.
用于该刚体的锥形摩擦力。
The position of the rigidbody.
该刚体的位置。
The rotation of the rigdibody.
该刚体的旋转。
Interpolation allows you to smooth out the effect of running physics at a fixed frame rate.
插值允许你以固定的帧率平滑物理运行效果。
Allows you to override the solver iteration count per rigidbody.
允许你覆盖每个刚体的求解迭代次数。
The linear velocity, below which objects start going to sleep. (Default 0.14) range { 0, infinity }
线性速度,低于该值的物体将开始休眠。(默认0.14)范围{0, infinity}
The angular velocity, below which objects start going to sleep. (Default 0.14) range { 0, infinity }
角速度,低于该值的物体将开始休眠。(默认0.14)范围{0, infinity}
The maximimum angular velocity of the rigidbody. (Default 7) range { 0, infinity }
刚体的最大角速度,(默认7)范围{0, infinity}
Functions函数
Sets the mass based on the attached colliders assuming a constant density.
基于附加的碰撞器假设一个固定的密度设置质量。
Adds a force to the rigidbody. As a result the rigidbody will start moving.
添加一个力到刚体。作为结果刚体将开始移动。
Adds a force to the rigidbody relative to its coordinate system.
添加一个力到刚体。相对于它的系统坐标。
Adds a torque to the rigidbody.
添加一个力矩到刚体。
Adds a torque to the rigidbody relative to the rigidbodie's own coordinate system.
添加一个力矩到刚体,相对于刚体自身的坐标系统。
Applies force at position. As a result this will apply a torque and force on the object.
在position位置应用force力。作为结果这个将在这个物体上应用一个力矩和力。
Applies a force to the rigidbody that simulates explosion effects. The explosion force will fall off linearly with distance to the rigidbody.
应用一个力到刚体来模拟爆炸效果。爆炸力将随着到刚体的距离线形衰减。
The closest point to the bounding box of the attached colliders.
到附加的碰撞器边界框上的最近点。
The velocity relative to the rigidbody at the point relativePoint.
相对于刚体在relativePoint点的速度。
The velocity of the rigidbody at the point worldPoint in global space.
刚体在世界坐标空间中worldPoint点的速度。
Moves the rigidbody to position.
移动刚体到position。
Rotates the rigidbody to rotation.
旋转刚体到rot。
Forces a rigidbody to sleep at least one frame.
强制一个刚体休眠至少一帧。
Is the rigidbody sleeping?
刚体在休眠么?
Forces a rigidbody to wake up.
强制唤醒一个刚体。
Tests if a rigidbody would collide with anything, if it was moved through the scene.
如果一个刚体碰到任何东西触发测试,如果它是穿过场景。
Like Rigidbody.SweepTest, but returns all hits.
像,但是返回所有碰撞点。
Messages Sent发送消息
OnCollisionEnter is called when this collider/rigidbody has begun touching another rigidbody/collider.
当这个collider/rigidbody已经开始接触另一个rigidbody/collider时,OnCollisionEnter被调用。
OnCollisionExit is called when this collider/rigidbody has stopped touching another rigidbody/collider.
当这个collider/rigidbody停止接触另一个rigidbody/collider时,OnCollisionExit被调用。
OnCollisionStay is called once per frame for every collider/rigidbody that is touching rigidbody/collider.
对于每个collider/rigidbody接触另一个rigidbody/collider时,OnCollisionStay每帧被调用一次。
Inherited members继承成员
Inherited Variables继承变量
attached to this
(null if there is none attached).
附加到(游戏物体)(如无附加则为空)。
attached to this
(null if there is none attached).
附加到(游戏物体)(如无附加则为空)。
attached to this
(null if there is none attached).
附加到(游戏物体)(如无附加则为空)。
attached to this
(null if there is none attached).
附加到(游戏物体)(如无附加则为空)。
attached to this
(null if there is none attached).
附加到(游戏物体)(如无附加则为空)。
attached to this
(null if there is none attached).
附加到(游戏物体)(如无附加则为空)。
attached to this
(null if there is none attached).
附加到(游戏物体)(如无附加则为空)。
attached to this
(null if there is none attached).
附加到(游戏物体)(如无附加则为空)。
attached to this
(null if there is none attached).
附加到(游戏物体)(如无附加则为空)。
attached to this
(Read Only). (null if there is none attached)
附加到(游戏物体)(只读)(如无附加则为空)。
attached to this
(Read Only). (null if there is none attached)
附加到(游戏物体)(只读)(如无附加则为空)。
attached to this
(null if there is none attached).
附加到(游戏物体)(如无附加则为空)。
attached to this
(null if there is none attached).
附加到(游戏物体)(如无附加则为空)。
attached to this
(null if there is none attached).
附加到(游戏物体)(如无附加则为空)。
The game object this component is attached to. A component is always attached to a game object.
组件附加的游戏物体。一个组件总是被附加到一个游戏物体。
The tag of this game object.
游戏物体的标签。
The name of the object. //物体的名字
Should the object be hidden, saved with the scene or modifiable by the user?
物体是否被隐藏、保存在场景中或被用户修改?
Inherited Functions继承函数
Returns the component of Type type if the game object has one attached, null if it doesn't.
如果游戏物体有一个附加,则返回Type类型的组件,如果没有则为null。
Returns the component with name type if the game object has one attached, null if it doesn't.
如果游戏物体有一个附加,则返回名字类型组件,如果没有则为null。
Returns the component of Type type in the
or any of its children using depth first search.
返回Type类型组件,在或它的任何子物体使用深度优先搜索,仅返回激活的组件。
Returns all components of Type type in the
or any of its children.
在或任何它的子物体,返回全部Type类型组件
Returns all components of Type type in the .
在游戏物体返回全部Type类型组件。
Is this game object tagged tag?
游戏物体有被标记标签么?
Calls the method named methodName on every
in this game object and on every ancestor of the behaviour
在游戏物体每一个和每一个behaviour的祖先上调用名为methodName的方法。
Calls the method named methodName on every
in this game object.
在游戏物体每一个上调用名为methodName的方法。
Calls the method named methodName on every
in this game object or any of its children.
在游戏物体每一个和它的全部子物体上调用名为methodName的方法。
Returns the instance id of the object.
返回物体的实例ID
Returns the name of the game object.返回游戏物体的名称。
Inherited Class Functions继承类函数
Removes a gameobject, component or asset.
删除一个游戏物体、组件或资源
Destroys the object obj immediately. It is strongly recommended to use Destroy instead.
立即销毁物体obj,强烈建议使用Destroy代替。
Makes the object target not be destroyed automatically when loading a new scene.
加载新场景的时候使目标物体不被自动销毁。
Returns the first active loaded object of Type type.
返回Type类型第一个激活的加载的物体。
Returns a list of all active loaded objects of Type type.
返回Type类型的所有激活的加载的物体列表
Clones the object original and returns the clone.
克隆原始物体,并返回克隆的物体
本脚本参考基于Unity 3.4.1f5英文部分版权属&公司所有,中文部分&
版权所有,未经许可,严禁转载 。Unity3d引擎(7)
一、如果添加刚体组件
&&&&& 菜单Component下的Phsics-&Rigidbody添加刚体组件Rigidbody.
&&&& 添加了刚体组件的物体才能够受到物理引擎的影响,比如受到重力坠落。
二、刚体组件的属性介绍
&&&& Mass(质量)是与其他刚体的此属性比,单位为1.正常为0.01~100倍。Drag(阻力)属性值越大受到的阻力越大。AugularDrag(角速度阻力)为旋转受到的阻力,Use Gravity(使用重力)属性决定是否受到重力影响。Is
Kinematic()临时关闭物理引擎运动型原理而通过Transform来运动,但是仍可以与其他刚体发生碰撞等作用。Interpolate(插入过渡平滑)当物体发生碰撞抖动时候可以做平滑处理。Constraints的FreezePosition冻结方位约束如果y被勾选则物体在Y轴上不受物理引擎影响。
三、刚体与其他组件配合使用
&&& 带有刚体的物体主要不是收到Transform来运动的,而应主要收到物理引擎的影响运动的。
&& 比如添加了恒定力ConstantForce组件单一方向的力,此组件含有Force可以在某个轴上添加力正负为力的方向,这样可以使该物体收到此方向力的左右而运动;此组件还包含RelativeForce相对力属性,此属性是相对于无敌的x,y,z轴受到的力,Torque为扭矩力,可以使物体旋转,RelativeTorque相对扭矩力
四、脚本使用
&&& 刚体组件是继承Component类,一般操作物品刚体是在FixedUpdat函数中执行。
&&& 对象是rigidbody,可以使用脚本来添加力,如rigidbody.AddForce(0, 0, 0)来添加方向力
五、刚体之间交互
&& 刚体之间碰撞时通过碰撞盒BoxCollider组件来实现的,如果没有添加BoxCollider将穿过彼此。除了BoxCollider碰撞器还有SphereCollider球形碰撞器、CapsuleCollider胶囊碰撞器。此3个碰撞器左右相同,同为几何碰撞器。还有一种碰撞器MeshCollider。也俗称静态碰撞器,
& MeshCollider碰撞器包含有:IsTrigger
控制碰撞器是否受物理引擎影响;Material材质项,可以通过材质获取摩擦力弹力等熟悉;Convex此选项选择后就可以与其他MeshCollider碰撞器碰撞了,但是其碰撞器中的三角形数量不能大于255个;Smooth Sphere
Collisions此选项选中可以让球等平滑的滚动。Mesh选项是可以选择简单的多边形作为碰撞器形状。
参考知识库
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:2307次
排名:千里之外unity(4)
刚体:Rigidbody;
void Start () {?
GetComponent&Rigidbody&().AddForce(Vector3.up*3);//给刚 体施加力
GetComponent&Rigidbody&().AddExplosionForce(19.0f,transform.positi
on,10,1.5f,ForceMode.Force);//施加爆炸力?
GetComponent&Rigidbody&().AddRelativeForce(Vector3.up*10,ForceM ode.Force);//施加相对力?
GetComponent&Rigidbody&().AddTorque(- Vector3.right*70,ForceMode.Force); //施加力矩?
GetComponent&Rigidbody&().AddRelativeTorque(- Vector3.right*70,ForceMode.Force); //施加相对力矩?
void FixedUpdate () {
GetComponent&Rigidbody&().MovePosition(transform.position + Vector3.right*Time.deltaTime);//移动刚体?,参数为移动目的地址
GetComponent&Rigidbody&().MoveRotation(transform.rotation*Quaterni on.Euler(new Vector3(0,100,0)*Time.deltaTime));//旋转物体?
GetComponent&Rigidbody&().AddForceAtPosition(Vector3.up,transform. position,ForceMode.Force);//在指定点施加力
参考知识库
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:122次
排名:千里之外unity 人物模型加rigidbody怎么掉下去了_百度知道

我要回帖

更多关于 排位休眠状态怎么解除 的文章

 

随机推荐