rj-action-library/Runtime/Procedural/Scatter/Discarder/DiscardSphere.cs

24 lines
411 B
C#

using System.Collections;
using System.Collections.Generic;
using Godot;
using System;
namespace Rokojori
{
[Tool]
[GlobalClass]
public partial class DiscardSphere:Discarder
{
[Export]
public float radius;
public override bool IsInside( Vector3 position )
{
var localPoint = ToLocal( position );
return localPoint.LengthSquared() < radius * radius;
}
}
}