Skip to content

armgit / 67.js

Public Imported from GitHub
0

3D engine that AI agents drive

Skip the wind heading call when the recipe sets no wind

Nguyen Xuan An8deb9f6edadb
diff --git a/scripts/agent-preview-browser.js b/scripts/agent-preview-browser.js
index 4eeb8aa4..fe0bba0b 100644
--- a/scripts/agent-preview-browser.js
+++ b/scripts/agent-preview-browser.js
@@ -242,7 +242,7 @@ function windFrame(environment) {
// The heading lives in the on-demand world material code, so the core renderer carries nothing for it.
function applyRecipeWindHeading(renderer, environment) {
- if (!agentSceneModuleLoaded('worldMaterials')) return;
+ if (!agentSceneModuleLoaded('worldMaterials') || (!environment.wind && !renderer.windHeading)) return;
agentSceneModule('worldMaterials').applyWindHeading(renderer, (environment.wind?.direction ?? 0) * Math.PI / 180);
}