Skip to content

Commit c544598

Browse files
authored
Merge branch 'Facepunch:master' into volumetric-fog-gizmos
2 parents ff87c92 + da6e239 commit c544598

210 files changed

Lines changed: 6695 additions & 1899 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/pull_request.yml

Lines changed: 44 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Pull Request
1+
name: PR Triage
22
on:
33
pull_request_target:
44
types: [ labeled ]
@@ -8,10 +8,48 @@ jobs:
88
runs-on: ubuntu-latest
99
if: github.event.label.name == 'triaged'
1010
steps:
11+
- name: Ensure PR checks passed
12+
uses: actions/github-script@v7
13+
with:
14+
github-token: ${{ secrets.GITHUB_TOKEN }}
15+
script: |
16+
const requiredChecks = ['format', 'tests'];
17+
18+
const pr = context.payload.pull_request;
19+
if (!pr) {
20+
throw new Error('No pull request found in event payload.');
21+
}
22+
23+
const { data } = await github.rest.checks.listForRef({
24+
owner: context.repo.owner,
25+
repo: context.repo.repo,
26+
ref: pr.head.sha,
27+
per_page: 100
28+
});
29+
30+
const checkRuns = data.check_runs ?? [];
31+
for (const requiredCheck of requiredChecks) {
32+
const match = checkRuns.find(run => (run.name ?? '') === requiredCheck);
33+
34+
if (!match || match.conclusion !== 'success') {
35+
const status = match ? (match.conclusion ?? match.status ?? 'unknown') : 'missing';
36+
core.warning(`Required check '${requiredCheck}' did not pass (${status}).`);
37+
throw new Error('Cannot triage until required checks succeed. Remove and re-add the triaged label to retry.');
38+
}
39+
}
40+
1141
- name: Repository Dispatch
12-
uses: peter-evans/repository-dispatch@v4
42+
uses: actions/github-script@v7
43+
env:
44+
DISPATCH_CONTEXT: ${{ toJson(github) }}
1345
with:
14-
token: ${{ secrets.SBOXBOT_TOKEN }}
15-
repository: Facepunch/sbox
16-
event-type: pr-triaged
17-
client-payload: '{"github": ${{ toJson(github) }}}'
46+
github-token: ${{ secrets.SBOXBOT_TOKEN }}
47+
script: |
48+
const clientPayload = JSON.parse(process.env.DISPATCH_CONTEXT);
49+
50+
await github.rest.repos.createDispatchEvent({
51+
owner: 'Facepunch',
52+
repo: 'sbox',
53+
event_type: 'pr-triaged',
54+
client_payload: { github: clientPayload }
55+
});
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Tests
2+
3+
on:
4+
pull_request:
5+
branches: [ master ]
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
tests:
12+
runs-on: [ windows-latest ]
13+
steps:
14+
- name: Full Checkout
15+
uses: actions/checkout@v4
16+
with:
17+
clean: true
18+
fetch-depth: 0
19+
persist-credentials: false
20+
- name: Setup .NET
21+
uses: actions/setup-dotnet@v5
22+
with:
23+
dotnet-version: '10.0.x'
24+
25+
- name: Build
26+
run: dotnet run --project .\engine\Tools\SboxBuild\SboxBuild.csproj -- build --config Developer
27+
28+
- name: Test
29+
run: dotnet run --project .\engine\Tools\SboxBuild\SboxBuild.csproj -- test
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Formatting
2+
3+
on:
4+
pull_request:
5+
branches: [ master ]
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
format:
12+
runs-on: [ windows-latest ]
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
with:
17+
clean: true
18+
fetch-depth: 1
19+
persist-credentials: false
20+
21+
- name: Setup .NET
22+
uses: actions/setup-dotnet@v5
23+
with:
24+
dotnet-version: '10.0.x'
25+
26+
- name: Format
27+
run: dotnet run --project .\engine\Tools\SboxBuild\SboxBuild.csproj -- format --verify

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# Git
66
!.gitignore
77
!.gitattributes
8+
!.github/workflows/**
89

910
# Source files
1011
!*.sln

engine/Definitions/common/Physics/IPhysicsJoint.def

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,43 @@ native class IPhysicsJoint as NativeEngine.IPhysicsJoint
7979
float Motor_GetAngularDampingRatio();
8080
float Motor_GetMaxSpringForce();
8181
float Motor_GetMaxSpringTorque();
82+
83+
void Wheel_EnableSuspension( bool flag );
84+
bool Wheel_IsSuspensionEnabled();
85+
void Wheel_SetSuspensionHertz( float hertz );
86+
float Wheel_GetSuspensionHertz();
87+
void Wheel_SetSuspensionDampingRatio( float dampingRatio );
88+
float Wheel_GetSuspensionDampingRatio();
89+
void Wheel_EnableSuspensionLimit( bool flag );
90+
bool Wheel_IsSuspensionLimitEnabled();
91+
float Wheel_GetLowerSuspensionLimit();
92+
float Wheel_GetUpperSuspensionLimit();
93+
void Wheel_SetSuspensionLimits( float lower, float upper );
94+
void Wheel_EnableSpinMotor( bool flag );
95+
bool Wheel_IsSpinMotorEnabled();
96+
void Wheel_SetSpinMotorSpeed( float speed );
97+
float Wheel_GetSpinMotorSpeed();
98+
void Wheel_SetMaxSpinTorque( float torque );
99+
float Wheel_GetMaxSpinTorque();
100+
void Wheel_EnableSteering( bool flag );
101+
bool Wheel_IsSteeringEnabled();
102+
void Wheel_SetSteeringHertz( float hertz );
103+
float Wheel_GetSteeringHertz();
104+
void Wheel_SetSteeringDampingRatio( float dampingRatio );
105+
float Wheel_GetSteeringDampingRatio();
106+
void Wheel_SetMaxSteeringTorque( float torque );
107+
float Wheel_GetMaxSteeringTorque();
108+
void Wheel_EnableSteeringLimit( bool flag );
109+
bool Wheel_IsSteeringLimitEnabled();
110+
float Wheel_GetLowerSteeringLimit();
111+
float Wheel_GetUpperSteeringLimit();
112+
void Wheel_SetSteeringLimits( float lowerRadians, float upperRadians );
113+
void Wheel_SetTargetSteeringAngle( float radians );
114+
float Wheel_GetTargetSteeringAngle();
115+
float Wheel_GetSpinSpeed();
116+
float Wheel_GetSpinTorque();
117+
float Wheel_GetSteeringAngle();
118+
float Wheel_GetSteeringTorque();
82119
}
83120

84121
managed static class Sandbox.Physics.PhysicsEngine

engine/Definitions/common/Physics/IPhysicsWorld.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ native class IPhysicsWorld
4343
IPhysicsJoint AddPrismaticJoint( IPhysicsBody pBody1, IPhysicsBody pBody2, Transform localFrame1, Transform localFrame2 );
4444
IPhysicsJoint AddSphericalJoint( IPhysicsBody pBody1, IPhysicsBody pBody2, Transform localFrame1, Transform localFrame2 );
4545
IPhysicsJoint AddMotorJoint( IPhysicsBody pBody1, IPhysicsBody pBody2, Transform localFrame1, Transform localFrame2 );
46+
IPhysicsJoint AddWheelJoint( IPhysicsBody pBody1, IPhysicsBody pBody2, Transform localFrame1, Transform localFrame2 );
4647

4748
//
4849
// Sets the collision rules using a json serialized Sandbox.Internal.CollisionRules

engine/Definitions/common/Render/renderdevice.def

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ native accessor g_pRenderDevice
6969

7070
bool IsTextureRenderTarget( ITexture texture );
7171

72+
bool IsRayTracingSupported();
73+
7274
inline RenderBufferHandle_t CreateGPUBuffer( RenderBufferType_t nType, BufferDesc_t desc, RenderBufferFlags_t usage, string pDebugName )
7375
{
7476
desc.m_pDebugName = pDebugName;
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#include "scenesystem/iscenesystem.h"
2+
3+
native class IRayTraceSceneWorld as NativeEngine.IRayTraceSceneWorld
4+
{
5+
void BeginBuild();
6+
void AddSceneWorldToBuild( ISceneWorld pWorld, IRenderContext pRenderContext );
7+
bool EndBuild( IRenderContext pRenderContext, CRenderAttributes attrs );
8+
9+
inline bool BuildTLASForWorld( ISceneWorld pWorld, CRenderAttributes attrs )
10+
{
11+
CRenderContextPtr pRenderContext( g_pRenderDevice, "sceneinfo_gpu" );
12+
13+
this->BeginBuild();
14+
this->AddSceneWorldToBuild( pWorld, pRenderContext );
15+
this->EndBuild( pRenderContext, attrs );
16+
17+
return true;
18+
}
19+
}

engine/Definitions/common/SceneSystem/g_pSceneSystem.def

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,4 +160,8 @@ native accessor g_pSceneSystem as NativeEngine.CSceneSystem
160160
void RenderTiledLightCulling( IRenderContext pCtx, ISceneView pView, RenderViewport viewport );
161161

162162
void BindTransformSlot( IRenderContext pCtx, int nVBSlot, int nTransformSlotIndex );
163+
164+
// Ray Tracing
165+
IRayTraceSceneWorld CreateRayTraceWorld( string pWorldDebugName, int nMaxRayTypes );
166+
void DestroyRayTraceWorld( IRayTraceSceneWorld pRayTraceSceneWorld );
163167
}

engine/Definitions/engine/Render/RenderTools.def

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ native static class RenderTools as NativeEngine.RenderTools
1717
//
1818
void Compute( IRenderContext renderContext, CRenderAttributes attributes, IMaterialMode pMode, int tx, int ty, int tz );
1919
void ComputeIndirect( IRenderContext renderContext, CRenderAttributes attributes, IMaterialMode pMode, RenderBufferHandle_t hIndirectBuffer, uint nIndirectBufferOffset );
20+
void TraceRays( IRenderContext renderContext, CRenderAttributes attributes, IMaterialMode pMode, uint tx, uint ty, uint tz );
21+
void TraceRaysIndirect( IRenderContext renderContext, CRenderAttributes attributes, IMaterialMode pMode, RenderBufferHandle_t hIndirectBuffer, uint nIndirectBufferOffset );
2022
void SetDynamicConstantBufferData( CRenderAttributes attributes, StringToken nTokenID, IRenderContext renderContext, void* data, int dataSize );
2123

2224
void CopyTexture( IRenderContext renderContext, ITexture sourceTexture, ITexture destTexture, Rect_t pSrcRect, int nDestX, int nDestY, uint nSrcMipSlice, uint nSrcArraySlice, uint nDstMipSlice, uint nDstArraySlice );

0 commit comments

Comments
 (0)