rj-action-library/Runtime/Procedural/Parametric/QuadBillboards/SingleQuadBillboard.cs

41 lines
860 B
C#
Raw Normal View History

2025-01-03 12:09:23 +00:00
using System.Collections;
using System.Collections.Generic;
using Godot;
using System;
namespace Rokojori
{
[Tool]
[GlobalClass]
public partial class SingleQuadBillboard:QuadBillboardDataProcessor
{
TransformChange transformChange = new TransformChange();
public override void _Process( double delta )
{
var changed = transformChange.Check( this );
if ( changed )
{
IncrementUpdateID();
}
}
public override List<QuadBillboardData> Process( List<QuadBillboardData> data )
{
var parent = GetParent<QuadBillboardMeshGenerator>();
var d = new QuadBillboardData();
d.position = GlobalPosition - parent.GlobalPosition;
d.rotation = this.GetGlobalQuaternion();
d.scale = Scale;
d.visible = true;
data.Add( d );
return data;
}
}
}