Transform Inverse Transform Point#
Transform / Transformations / Transform Inverse Transform Point Position
Description#
Transforms the position from world space to local space
Parameters#
| Name | Description |
|---|---|
| Transform | |
| Position | |
| 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("Transform Inverse Transform Point")]
[Category("Transform/Transformations/Inverse Transform Point", "Position")]
[Description("Transforms the position from world space to local space")]
[Image(typeof(IconCubeOutline), ColorTheme.Type.Lime, typeof(BadgeArrowUp))]
[Keywords("Transform")]
[Parameter("Transform")]
[Parameter("Position")]
[Parameter("Value")]
[Serializable]
public class GenConditionVector3_Transform_CheckInverseTransformPoint_1_Vector3Position : Condition
{
[SerializeField] private GetGameObject m_Transform = new GetGameObject(
new GenTypeGameObject_Transform()
);
[SerializeField] private GetVector3 m_Value = new GetVector3();
[SerializeField] private GetVector3 m_Position = new GetVector3();
protected override string GetTitle(GameObject source)
{
string method = TextUtils.ThemeAsKeyword("Inverse Transform Point");
string parameters = $"({this.m_Position})";
return $"{this.m_Transform} {method} = {this.m_Value}";
}
protected override bool Run(Args args)
{
Transform component = this.m_Transform.Get<Transform>(args);
if (component == null) return false;
Vector3 value = component.InverseTransformPoint(
(Vector3) this.m_Position.Get(args)
);
return value == (Vector3) this.m_Value.Get(args);
}
}
}