Rigidbody Get Point Velocity#
Physics 3D / Rigidbody / Rigidbody Get Point Velocity
Description#
Compares the Get Point Velocity method of Rigidbody component to another value
Parameters#
| Name | Description |
|---|---|
| Rigidbody | |
| World Point | |
| Value |
Code#
// <auto-generated>
// This script was automatically generated using the Visual Script Transpiler.
// Do not modify. Changes to this file will be lost when updating the package.
// </auto-generated>
using System;
using UnityEngine;
using VisualScript.Icons;
namespace VisualScript.Runtime
{
[Title("Rigidbody Get Point Velocity")]
[Category("Physics 3D/Rigidbody/Get Point Velocity")]
[Description("Compares the Get Point Velocity method of Rigidbody component to another value")]
[Image(typeof(IconPhysics), ColorTheme.Type.Lime)]
[Keywords("Physics, 3D")]
[Parameter("Rigidbody")]
[Parameter("World Point")]
[Parameter("Value")]
[Serializable]
public class GenConditionVector3_Rigidbody_CheckGetPointVelocity_1 : Condition
{
[SerializeField] private GetGameObject m_Rigidbody = new GetGameObject(
new GenTypeGameObject_Rigidbody()
);
[SerializeField] private GetVector3 m_Value = new GetVector3();
[SerializeField] private GetVector3 m_WorldPoint = new GetVector3();
protected override string GetTitle(GameObject source)
{
string method = TextUtils.ThemeAsKeyword("Get Point Velocity");
string parameters = $"({this.m_WorldPoint})";
return $"{this.m_Rigidbody} {method} = {this.m_Value}";
}
protected override bool Run(Args args)
{
Rigidbody component = this.m_Rigidbody.Get<Rigidbody>(args);
if (component == null) return false;
Vector3 value = component.GetPointVelocity(
(Vector3) this.m_WorldPoint.Get(args)
);
return value == (Vector3) this.m_Value.Get(args);
}
}
}