言語: 日本語
  • C#
  • JS
  • Boo

スクリプト言語

お好みのスクリプト言語を選択すると、サンプルコードがその言語で表示されます。

Rigidbody.GetPointVelocity

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Sumbission failed

For some reason your suggested change could not be submitted. Please try again in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Switch to Manual
public function GetPointVelocity(worldPoint: Vector3): Vector3;
public Vector3 GetPointVelocity(Vector3 worldPoint);
public def GetPointVelocity(worldPoint as Vector3) as Vector3

Description

ワールド座標における、Rigidbodyオブジェクトの速度を取得します

GetPointVelocity は、速度を計算する時 Rigidbody の角運動速度 (angularVelocity) を取得します。

	// Prints the velocity of the wheel

	var point : Vector3;
	var velocity : Vector3;
	point = transform.InverseTransformPoint(Vector3(0, -.2, 0));
	velocity =  rigidbody.GetPointVelocity(point);
	print(velocity.magnitude);
using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour {
    public Vector3 point;
    public Vector3 velocity;
    void Example() {
        point = transform.InverseTransformPoint(new Vector3(0, -0.2F, 0));
        velocity = rigidbody.GetPointVelocity(point);
        print(velocity.magnitude);
    }
}
import UnityEngine
import System.Collections

public class ExampleClass(MonoBehaviour):

	public point as Vector3

	public velocity as Vector3

	def Example() as void:
		point = transform.InverseTransformPoint(Vector3(0, -0.2F, 0))
		velocity = rigidbody.GetPointVelocity(point)
		print(velocity.magnitude)