default mesh collider are generated by default mesh, add camera info serialization, using error info instead of assert to process missing filepath when deserializing scene, move cullface into internal renderer api, fixed dynamic vertex buffer bug

This commit is contained in:
2026-01-19 13:05:24 +08:00
parent 81b52abf0f
commit 323d646611
32 changed files with 646 additions and 307 deletions

View File

@ -109,7 +109,7 @@ namespace FPSExample
{
RaycastHit hitInfo;
if (Input.IsKeyPressed(KeyCode.H) &&
Physics.Raycast(m_CameraTransform.Position + (m_CameraTransform.Transform.Forward),
Physics.Raycast(m_CameraTransform.Translation + (m_CameraTransform.Transform.Forward),
m_CameraTransform.Transform.Forward, 20.0f, out hitInfo))
{
FindEntityByID(hitInfo.EntityID).GetComponent<MeshComponent>().Mesh.GetMaterial(0).Set("u_AlbedoColor", new Vec3(1.0f ,0.0f, 0.0f));
@ -120,7 +120,7 @@ namespace FPSExample
// NOTE: The NonAlloc version of Overlap functions should be used when possible since it doesn't allocate a new array
// whenever you call it. The normal versions allocates a brand new array every time.
int numColliders = Physics.OverlapBoxNonAlloc(m_Transform.Position, new Vec3(1.0f), colliders);
int numColliders = Physics.OverlapBoxNonAlloc(m_Transform.Translation, new Vec3(1.0f), colliders);
Console.WriteLine("Colliders: {0}", numColliders);
// When using NonAlloc it's not safe to use a foreach loop since some of the colliders may not exist
@ -158,9 +158,9 @@ namespace FPSExample
}
private void UpdateCameraTransform(){
Vec3 position = m_Transform.Position + m_CameraTransform.Transform.Forward * CameraForwardOffset;
position.Y += m_Transform.Position.Y + CameraYOffset;
m_CameraTransform.Position = position;
Vec3 position = m_Transform.Translation + m_CameraTransform.Transform.Forward * CameraForwardOffset;
position.Y += m_Transform.Translation.Y + CameraYOffset;
m_CameraTransform.Translation = position;
}
}
}