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

スクリプト言語

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

Rigidbody.GetRelativePointVelocity

Switch to Manual
public function GetRelativePointVelocity(relativePoint: Vector3): Vector3;

Description

ローカル座標における、Rigidbodyオブジェクトの相対的速度を取得します

GetRelativePointVelocity will take the angularVelocity of the rigidbody into account when calculating the velocity.

	// 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);