|
|
|
|
|
|
Degrees |
|
|
|
}; |
|
|
|
[Title("UV/Rotate")] |
|
|
|
public class UVRotatorNode : CodeFunctionNode |
|
|
|
public class RotateNode : CodeFunctionNode |
|
|
|
{ |
|
|
|
|
|
|
|
[SerializeField] |
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public UVRotatorNode() |
|
|
|
public RotateNode() |
|
|
|
{ |
|
|
|
name = "Rotate"; |
|
|
|
} |
|
|
|
|
|
|
if(m_constant == Unit.Radians) |
|
|
|
return GetType().GetMethod("Unity_UVRotator_Radians", BindingFlags.Static | BindingFlags.NonPublic); |
|
|
|
return GetType().GetMethod("Unity_Rotate_Radians", BindingFlags.Static | BindingFlags.NonPublic); |
|
|
|
return GetType().GetMethod("Unity_UVRotator_Degrees", BindingFlags.Static | BindingFlags.NonPublic); |
|
|
|
return GetType().GetMethod("Unity_Rotate_Degrees", BindingFlags.Static | BindingFlags.NonPublic); |
|
|
|
static string Unity_UVRotator_Radians( |
|
|
|
static string Unity_Rotate_Radians( |
|
|
|
[Slot(0, Binding.MeshUV0)] Vector2 UV, |
|
|
|
[Slot(1, Binding.None, 0.5f, 0.5f, 0.5f, 0.5f)] Vector2 Center, |
|
|
|
[Slot(2, Binding.None)] Vector1 Rotation, |
|
|
|
|
|
|
{precision} s = sin(Rotation); |
|
|
|
{precision} c = cos(Rotation); |
|
|
|
|
|
|
|
|
|
|
|
//center rotation matrix
|
|
|
|
{precision}2x2 rMatrix = float2x2(c, -s, s, c); |
|
|
|
rMatrix *= 0.5; |
|
|
|
|
|
|
}";
|
|
|
|
} |
|
|
|
|
|
|
|
static string Unity_UVRotator_Degrees( |
|
|
|
static string Unity_Rotate_Degrees( |
|
|
|
[Slot(0, Binding.MeshUV0)] Vector2 UV, |
|
|
|
[Slot(1, Binding.None, 0.5f, 0.5f, 0.5f, 0.5f)] Vector2 Center, |
|
|
|
[Slot(2, Binding.None)] Vector1 Rotation, |
|
|
|
|
|
|
return @"
|
|
|
|
{ |
|
|
|
//rotation matrix
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//center rotation matrix
|
|
|
|
{precision}2x2 rMatrix = float2x2(c, -s, s, c); |
|
|
|