|
|
|
|
|
|
|
|
|
|
static string Unity_UVRotator_Radians( |
|
|
|
[Slot(0, Binding.MeshUV0)] Vector2 UV, |
|
|
|
[Slot(1, Binding.None)] Vector1 Rotation, |
|
|
|
[Slot(2, Binding.None)] out Vector2 Out) |
|
|
|
[Slot(1, Binding.None, 0.5f, 0.5f, 0.5f, 0.5f)] Vector2 Center, |
|
|
|
[Slot(2, Binding.None)] Vector1 Rotation, |
|
|
|
[Slot(3, Binding.None)] out Vector2 Out) |
|
|
|
{ |
|
|
|
Out = Vector2.zero; |
|
|
|
|
|
|
|
|
|
|
{ |
|
|
|
//rotation matrix
|
|
|
|
UV.xy -= 0.5; |
|
|
|
UV -= Center; |
|
|
|
{precision} s = sin(Rotation); |
|
|
|
{precision} c = cos(Rotation); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//multiply the UVs by the rotation matrix
|
|
|
|
UV.xy = mul(UV.xy, rMatrix); |
|
|
|
UV.xy += 0.5; |
|
|
|
UV += Center; |
|
|
|
|
|
|
|
Out = UV; |
|
|
|
}";
|
|
|
|
|
|
|
[Slot(0, Binding.MeshUV0)] Vector2 UV, |
|
|
|
[Slot(1, Binding.None)] Vector1 Rotation, |
|
|
|
[Slot(2, Binding.None)] out Vector2 Out) |
|
|
|
[Slot(1, Binding.None, 0.5f, 0.5f, 0.5f, 0.5f)] Vector2 Center, |
|
|
|
[Slot(2, Binding.None)] Vector1 Rotation, |
|
|
|
[Slot(3, Binding.None)] out Vector2 Out) |
|
|
|
{ |
|
|
|
Out = Vector2.zero; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UV.xy -= 0.5; |
|
|
|
UV -= Center; |
|
|
|
{precision} s = sin(Rotation); |
|
|
|
{precision} c = cos(Rotation); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//multiply the UVs by the rotation matrix
|
|
|
|
UV.xy = mul(UV.xy, rMatrix); |
|
|
|
UV.xy += 0.5; |
|
|
|
UV += Center; |
|
|
|
|
|
|
|
Out = UV; |
|
|
|
}";
|
|
|
|