用户工具

站点工具


侧边栏

script:unityengine:classes:rigidbody2d:rigidbody2d

Rigidbody2D 二维刚体

Namespace: UnityEngine / Inherits from: Component

Description 描述

Rigidbody physics component for 2D sprites.

用于2D精灵的刚体物理组件。

The Rigidbody2D class essentially provides the same functionality in 2D that the Rigidbody class provides in 3D. Adding a Rigidbody2D component to a sprite puts in under the control of the physics engine. By itself, this means that the sprite will be affected by gravity and can be controlled from scripts using forces. By adding the appropriate collider component, the sprite will also respond to collisions with other sprites. This behaviour comes entirely from Unity's physics system; very little code is required to get impressive and authentic physical behaviour and allows for “emergent” gameplay that was not explicitly coded into the game.

Rigidbody2D类本质上提供了与3D刚体同样功能。添加Rigidbody2D组件到一个精灵上置于物理引擎的控制下。就其本身而言,这意味着精灵会受到重力的影响并可以从脚本使用力控制。通过添加合适的碰撞器组件,该精灵也会响应与其他精灵碰撞。这种行为完全来自Unity的物理系统;非常少的代码得到令人印象深刻和真实的物理行为,并允许游戏中未明确编码的“突发”的运动。

See Also: Rigidbody class, SpriteRenderer class, Collider2D class, Joint2D class.

Variables 变量

angularDragCoefficient of angular drag.
角阻力系数。
angularVelocityAngular velocity in degrees per second.
每秒度的角速度。
centerOfMassThe center of mass of the rigidBody in local space.
刚体局部空间坐标的质量中心。
collisionDetectionModeThe method used by the physics engine to check if two objects have collided.
这个方法用于检测物理引擎两个对象是否已经碰撞。
script/unityengine/classes/rigidbody2d/rigidbody2d.txt · 最后更改: 2016/08/02 05:30 (外部编辑)