Add area judge functions.

This commit is contained in:
2023-05-14 12:06:32 +08:00
parent fb31e833cb
commit 5bab0ca648
2 changed files with 154 additions and 2 deletions

View File

@@ -1,6 +1,7 @@
using Cryville.Common.Pdt;
using System;
using RBeatTime = Cryville.Crtr.BeatTime;
using RVector4 = UnityEngine.Vector4;
namespace Cryville.Crtr {
public abstract class PropSrc {
@@ -95,5 +96,21 @@ namespace Cryville.Crtr {
}
}
}
public class Vector4 : FixedBuffer {
readonly Func<RVector4> _cb;
public Vector4(Func<RVector4> cb) : base(PdtInternalType.Vector, 4 * sizeof(float) + sizeof(int)) { _cb = cb; }
protected unsafe override void InternalGet() {
base.InternalGet();
var vec = _cb();
fixed (byte* _ptr = buf) {
float* ptr = (float*)_ptr;
*ptr++ = vec.x;
*ptr++ = vec.y;
*ptr++ = vec.z;
*ptr++ = vec.w;
*(int*)ptr = PdtInternalType.Number;
}
}
}
}
}