Skip to content

Commit

Permalink
Version 0.12.0 Alpha.4 [Prerelease]
Browse files Browse the repository at this point in the history
Warning: This commit hash may not be preserved!

Functional:
- WorldUpdateAllocator in baking systems
- CoreBootstrap.InstallNetCodePreSpawnEnableInEditorSystem()
- Optimized skeleton non-destructive sockets
- Optimized skeleton authoring cache
- EWBIK modular solve algorithm
- GraphicsEventPostal, GraphicsEventTunnel, and VfxGraphEventBufferProvider
- ComponentBroker
- Unika runtime (minus Burst)
- Unika user authoring and baking
- Baker interfaces
- Kinemation baker interface-based renderer overrides
- Unika baker interface source generation
- Unity 6 Myri Span Baker
- Myri managed editor driver (domain reload deadlock workaround)
- Improved LOD baking

Untested:
- [BurstCompile] nested type hoisting in source generators for ICollectionComponent
- Elliptical swing-twist constraint and solver
- LATIOS_BL_FORK
- VfxGraphGlobalBufferProvider
- UnitySim updated MotionExpansion and Jacobians
- Psyshock QuickTests ellipse methods
- PhysicsAspectLookup
- Bits (packed boolean and small integer utilities)
- TypePack and optimized multi-component structural changes
- Core and Transforms shader library
- Unique meshes (construct meshes from dynamic buffers)

Incomplete:
- Mimic.Shuriken
- Psyshock terrain
- Unique meshes normal and tangent recalculations
  • Loading branch information
Dreaming381 committed Dec 13, 2024
1 parent bff853b commit 3ae7c26
Show file tree
Hide file tree
Showing 47 changed files with 3,253 additions and 152 deletions.
2 changes: 1 addition & 1 deletion Core/Framework/BlackboardEntity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public unsafe struct BlackboardEntity
{
private Entity entity;
private LatiosWorldUnmanaged latiosWorld;
private EntityManager em => latiosWorld.m_impl->m_worldUnmanaged.EntityManager;
internal EntityManager em => latiosWorld.m_impl->m_worldUnmanaged.EntityManager;

/// <summary>
/// Create a blackboard entity
Expand Down
2 changes: 1 addition & 1 deletion Core/Framework/ICustomEditorBootstrap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ internal static void InitializeEditorWorld(World defaultEditorWorld)
#if UNITY_EDITOR
public static class UnityEditorTool
{
[UnityEditor.MenuItem("Edit/Restart Editor World")]
[UnityEditor.MenuItem("Edit/Latios/Restart Editor World")]
public static void RestartEditorWorld()
{
var previousEditorWorld = World.DefaultGameObjectInjectionWorld;
Expand Down
101 changes: 101 additions & 0 deletions Core/GameplayToolkit/Bits.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
using Unity.Collections;
using Unity.Entities;
using Unity.Mathematics;

namespace Latios
{
public static class Bits
{
public static bool GetBit(int data, int bitIndex) => new BitField32(math.asuint(data)).IsSet(bitIndex);
public static void SetBit(ref int data, int bitIndex, bool bitValue)
{
var bitfield = new BitField32(math.asuint(data));
bitfield.SetBits(bitIndex, bitValue);
data = math.asint(bitfield.Value);
}
public static bool GetBit(uint data, int bitIndex) => new BitField32(data).IsSet(bitIndex);
public static void SetBit(ref uint data, int bitIndex, bool bitValue)
{
var bitfield = new BitField32(data);
bitfield.SetBits(bitIndex, bitValue);
data = bitfield.Value;
}
public static bool GetBit(long data, int bitIndex) => new BitField64(math.asulong(data)).IsSet(bitIndex);
public static void SetBit(ref long data, int bitIndex, bool bitValue)
{
var bitfield = new BitField64(math.asulong(data));
bitfield.SetBits(bitIndex, bitValue);
data = math.aslong(bitfield.Value);
}
public static bool GetBit(ulong data, int bitIndex) => new BitField64(data).IsSet(bitIndex);
public static void SetBit(ref ulong data, int bitIndex, bool bitValue)
{
var bitfield = new BitField64(data);
bitfield.SetBits(bitIndex, bitValue);
data = bitfield.Value;
}
public static bool GetBit(ushort data, int bitIndex) => GetBit((uint)data, bitIndex);
public static void SetBit(ref ushort data, int bitIndex, bool bitValue)
{
uint intdata = data;
SetBit(ref intdata, bitIndex, bitValue);
data = (ushort)(intdata & 0xffff);
}
public static bool GetBit(byte data, int bitIndex) => GetBit((uint)data, bitIndex);
public static void SetBit(ref byte data, int bitIndex, bool bitValue)
{
uint intdata = data;
SetBit(ref intdata, bitIndex, bitValue);
data = (byte)(intdata & 0xff);
}

public static int GetBits(int data, int firstBitIndex, int bitCount)
=> math.asint(new BitField32(math.asuint(data)).GetBits(firstBitIndex, bitCount));
public static void SetBits(ref int data, int firstBitIndex, int bitCount, int newValue)
{
uint udata = math.asuint(data);
SetBits(ref udata, firstBitIndex, bitCount, math.asuint(newValue));
data = math.asint(udata);
}
public static uint GetBits(uint data, int firstBitIndex, int bitCount) => new BitField32(data).GetBits(firstBitIndex, bitCount);
public static void SetBits(ref uint data, int firstBitIndex, int bitCount, uint newValue)
{
var mask = 0xffffffffu >> (32 - bitCount);
var newPart = (newValue & mask) << firstBitIndex;
var oldPart = data & ~(mask << firstBitIndex);
data = newPart | oldPart;
}
public static long GetBits(long data, int firstBitIndex, int bitCount)
=> math.aslong(new BitField64(math.asulong(data)).GetBits(firstBitIndex, bitCount));
public static void SetBits(ref long data, int firstBitIndex, int bitCount, long newValue)
{
ulong udata = math.asulong(data);
SetBits(ref udata, firstBitIndex, bitCount, math.asulong(newValue));
data = math.aslong(udata);
}
public static ulong GetBits(ulong data, int firstBitIndex, int bitCount) => new BitField64(data).GetBits(firstBitIndex, bitCount);
public static void SetBits(ref ulong data, int firstBitIndex, int bitCount, ulong newValue)
{
var mask = (~0x0u) >> (64 - bitCount);
var newPart = (newValue & mask) << firstBitIndex;
var oldPart = data & ~(mask << firstBitIndex);
data = newPart | oldPart;
}
public static ushort GetBits(ushort data, int firstBitIndex, int bitCount)
=> (ushort)(0xffff & GetBits((uint)data, firstBitIndex, bitCount));
public static void SetBits(ref ushort data, int firstBitIndex, int bitCount, ushort newValue)
{
uint intdata = data;
SetBits(ref intdata, firstBitIndex, bitCount, newValue);
data = (ushort)(intdata & 0xffff);
}
public static byte GetBits(byte data, int firstBitIndex, int bitCount)
=> (byte)(0xff & GetBits((uint)data, firstBitIndex, bitCount));
public static void SetBits(ref byte data, int firstBitIndex, int bitCount, byte newValue)
{
uint intdata = data;
SetBits(ref intdata, firstBitIndex, bitCount, newValue);
data = (byte)(intdata & 0xff);
}
}
}
2 changes: 2 additions & 0 deletions Core/GameplayToolkit/Bits.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 3ae7c26

Please sign in to comment.