Added frustum culling;

Added geometry data;

Changed name of VolumeObject to AoVolume;

Removed the capsule type in VolumeType, all volumes are box volume now;
This commit is contained in:
2025-02-19 23:20:38 +09:00
parent de8eafb713
commit ef2bdeac98
18 changed files with 348 additions and 39 deletions

View File

@@ -0,0 +1,40 @@
using UnityEngine;
namespace Misaki.AoVolume
{
internal class AoVolume : MonoBehaviour
{
private VolumeEntity _entity = VolumeEntity.InvalidEntity;
public VolumeData data;
protected virtual void InitializeEntity()
{
if (_entity.IsValid)
{
return;
}
_entity = VolumeDatabase.Instance.CreateEntity(this);
}
protected virtual void OnEnable()
{
InitializeEntity();
}
protected virtual void OnDisable()
{
if (_entity.IsValid)
{
VolumeDatabase.Instance.DestroyEntity(_entity);
}
}
protected virtual void Update()
{
data.worldMatrix = transform.localToWorldMatrix;
data.inverseWorldMatrix = data.worldMatrix.inverse;
}
}
}