Start physics recording when XR pose is set instead of during initialization
All checks were successful
Build / build (push) Successful in 1m19s
All checks were successful
Build / build (push) Successful in 1m19s
Moved recording start from level initialization to onInitialXRPoseSetObservable. This ensures the 30-second ring buffer only contains actual gameplay data, not loading screens or menu time. Recording now starts at the same time as the game timer, when the player enters VR and gameplay begins. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
d8571ef740
commit
96ae033064
@ -50,6 +50,12 @@ export class Level1 implements Level {
|
|||||||
this._ship.gameStats.startTimer();
|
this._ship.gameStats.startTimer();
|
||||||
debugLog('Game timer started');
|
debugLog('Game timer started');
|
||||||
|
|
||||||
|
// Start physics recording when gameplay begins
|
||||||
|
if (this._physicsRecorder) {
|
||||||
|
this._physicsRecorder.startRingBuffer();
|
||||||
|
debugLog('Physics recorder started');
|
||||||
|
}
|
||||||
|
|
||||||
const observer = xr.input.onControllerAddedObservable.add((controller) => {
|
const observer = xr.input.onControllerAddedObservable.add((controller) => {
|
||||||
debugLog('🎮 onControllerAddedObservable FIRED for:', controller.inputSource.handedness);
|
debugLog('🎮 onControllerAddedObservable FIRED for:', controller.inputSource.handedness);
|
||||||
this._ship.addController(controller);
|
this._ship.addController(controller);
|
||||||
@ -147,11 +153,10 @@ export class Level1 implements Level {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Initialize physics recorder
|
// Initialize physics recorder (but don't start it yet - will start on XR pose)
|
||||||
setLoadingMessage("Initializing physics recorder...");
|
setLoadingMessage("Initializing physics recorder...");
|
||||||
this._physicsRecorder = new PhysicsRecorder(DefaultScene.MainScene);
|
this._physicsRecorder = new PhysicsRecorder(DefaultScene.MainScene);
|
||||||
this._physicsRecorder.startRingBuffer();
|
debugLog('Physics recorder initialized (will start on XR pose)');
|
||||||
debugLog('Physics recorder initialized and running');
|
|
||||||
|
|
||||||
// Wire up recording keyboard shortcuts
|
// Wire up recording keyboard shortcuts
|
||||||
this._ship.keyboardInput.onRecordingActionObservable.add((action) => {
|
this._ship.keyboardInput.onRecordingActionObservable.add((action) => {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user