@2112-lab/central-plant 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -0
- package/dist/bundle/index.js +14259 -0
- package/dist/cjs/_virtual/_rollupPluginBabelHelpers.js +353 -0
- package/dist/cjs/node_modules/three/examples/jsm/controls/OrbitControls.js +1292 -0
- package/dist/cjs/node_modules/three/examples/jsm/controls/TransformControls.js +1543 -0
- package/dist/cjs/node_modules/three/examples/jsm/loaders/GLTFLoader.js +4374 -0
- package/dist/cjs/node_modules/three/examples/jsm/loaders/RGBELoader.js +465 -0
- package/dist/cjs/node_modules/three/examples/jsm/utils/BufferGeometryUtils.js +117 -0
- package/dist/cjs/src/ConnectionManager.js +114 -0
- package/dist/cjs/src/Pathfinder.js +88 -0
- package/dist/cjs/src/animationManager.js +121 -0
- package/dist/cjs/src/componentManager.js +151 -0
- package/dist/cjs/src/debugLogger.js +176 -0
- package/dist/cjs/src/disposalManager.js +185 -0
- package/dist/cjs/src/environmentManager.js +1015 -0
- package/dist/cjs/src/hotReloadManager.js +252 -0
- package/dist/cjs/src/index.js +126 -0
- package/dist/cjs/src/keyboardControlsManager.js +206 -0
- package/dist/cjs/src/modelPreloader.js +360 -0
- package/dist/cjs/src/nameUtils.js +106 -0
- package/dist/cjs/src/pathfindingManager.js +321 -0
- package/dist/cjs/src/performanceMonitor.js +718 -0
- package/dist/cjs/src/sceneExportManager.js +292 -0
- package/dist/cjs/src/sceneInitializationManager.js +540 -0
- package/dist/cjs/src/sceneOperationsManager.js +560 -0
- package/dist/cjs/src/textureConfig.js +195 -0
- package/dist/cjs/src/transformControlsManager.js +851 -0
- package/dist/esm/_virtual/_rollupPluginBabelHelpers.js +328 -0
- package/dist/esm/node_modules/three/examples/jsm/controls/OrbitControls.js +1287 -0
- package/dist/esm/node_modules/three/examples/jsm/controls/TransformControls.js +1537 -0
- package/dist/esm/node_modules/three/examples/jsm/loaders/GLTFLoader.js +4370 -0
- package/dist/esm/node_modules/three/examples/jsm/loaders/RGBELoader.js +461 -0
- package/dist/esm/node_modules/three/examples/jsm/utils/BufferGeometryUtils.js +113 -0
- package/dist/esm/src/ConnectionManager.js +110 -0
- package/dist/esm/src/Pathfinder.js +84 -0
- package/dist/esm/src/animationManager.js +112 -0
- package/dist/esm/src/componentManager.js +123 -0
- package/dist/esm/src/debugLogger.js +167 -0
- package/dist/esm/src/disposalManager.js +155 -0
- package/dist/esm/src/environmentManager.js +989 -0
- package/dist/esm/src/hotReloadManager.js +244 -0
- package/dist/esm/src/index.js +117 -0
- package/dist/esm/src/keyboardControlsManager.js +196 -0
- package/dist/esm/src/modelPreloader.js +337 -0
- package/dist/esm/src/nameUtils.js +99 -0
- package/dist/esm/src/pathfindingManager.js +295 -0
- package/dist/esm/src/performanceMonitor.js +712 -0
- package/dist/esm/src/sceneExportManager.js +286 -0
- package/dist/esm/src/sceneInitializationManager.js +513 -0
- package/dist/esm/src/sceneOperationsManager.js +536 -0
- package/dist/esm/src/textureConfig.js +168 -0
- package/dist/esm/src/transformControlsManager.js +827 -0
- package/dist/index.d.ts +259 -0
- package/package.json +53 -0
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _rollupPluginBabelHelpers = require('../_virtual/_rollupPluginBabelHelpers.js');
|
|
6
|
+
var ConnectionManager = require('./ConnectionManager.js');
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Pathfinder class
|
|
10
|
+
* Enhanced version with better error handling for missing data
|
|
11
|
+
*/
|
|
12
|
+
var Pathfinder = /*#__PURE__*/function () {
|
|
13
|
+
function Pathfinder(sceneData) {
|
|
14
|
+
_rollupPluginBabelHelpers.classCallCheck(this, Pathfinder);
|
|
15
|
+
this.sceneData = sceneData || {};
|
|
16
|
+
this.connectionManager = new ConnectionManager["default"]();
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Find paths in the scene
|
|
21
|
+
* @returns {Array} Array of paths
|
|
22
|
+
*/
|
|
23
|
+
return _rollupPluginBabelHelpers.createClass(Pathfinder, [{
|
|
24
|
+
key: "findPaths",
|
|
25
|
+
value: function findPaths() {
|
|
26
|
+
var _this = this;
|
|
27
|
+
console.log('[DEBUG] Starting findPaths()');
|
|
28
|
+
try {
|
|
29
|
+
var connections = this.sceneData.connections;
|
|
30
|
+
|
|
31
|
+
// Safety check for connections
|
|
32
|
+
if (!connections || !Array.isArray(connections)) {
|
|
33
|
+
console.warn('Pathfinder: No valid connections provided in scene data');
|
|
34
|
+
return [];
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// Create clusters from connections
|
|
38
|
+
var clusters = this.connectionManager.clusterConnections(connections);
|
|
39
|
+
|
|
40
|
+
// Return empty array if there are no valid clusters
|
|
41
|
+
if (!clusters || !clusters.length) {
|
|
42
|
+
console.log('Pathfinder: No valid connection clusters generated');
|
|
43
|
+
return [];
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// Process the clusters and generate paths
|
|
47
|
+
// (Simplified implementation, the actual process would be more complex)
|
|
48
|
+
var paths = [];
|
|
49
|
+
clusters.forEach(function (cluster) {
|
|
50
|
+
if (cluster && cluster.objects && Array.isArray(cluster.objects)) {
|
|
51
|
+
// Generate path for this cluster
|
|
52
|
+
var clusterPaths = _this._generatePathsForCluster(cluster);
|
|
53
|
+
paths.push.apply(paths, _rollupPluginBabelHelpers.toConsumableArray(clusterPaths));
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
return paths;
|
|
57
|
+
} catch (error) {
|
|
58
|
+
console.error('Pathfinder: Error finding paths:', error);
|
|
59
|
+
return [];
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Generate paths for a single cluster
|
|
65
|
+
* @param {Object} cluster - The cluster to generate paths for
|
|
66
|
+
* @returns {Array} Array of paths for this cluster
|
|
67
|
+
* @private
|
|
68
|
+
*/
|
|
69
|
+
}, {
|
|
70
|
+
key: "_generatePathsForCluster",
|
|
71
|
+
value: function _generatePathsForCluster(cluster) {
|
|
72
|
+
// This is a placeholder implementation
|
|
73
|
+
// In your actual system, this would use your existing pathfinding logic
|
|
74
|
+
return cluster.objects.map(function (obj, index, arr) {
|
|
75
|
+
if (index < arr.length - 1) {
|
|
76
|
+
return {
|
|
77
|
+
from: obj,
|
|
78
|
+
to: arr[index + 1],
|
|
79
|
+
path: [] // This would normally contain 3D points for the path
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
return null;
|
|
83
|
+
}).filter(Boolean);
|
|
84
|
+
}
|
|
85
|
+
}]);
|
|
86
|
+
}();
|
|
87
|
+
|
|
88
|
+
exports["default"] = Pathfinder;
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var debugLogger = require('./debugLogger.js');
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Animation Manager
|
|
9
|
+
* Handles animation loops and timing
|
|
10
|
+
*/
|
|
11
|
+
var animationFrameId = null;
|
|
12
|
+
var isAnimating = false;
|
|
13
|
+
var lastTime = 0;
|
|
14
|
+
var callbacks = [];
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Start the animation loop
|
|
18
|
+
*/
|
|
19
|
+
function startAnimation(component) {
|
|
20
|
+
if (isAnimating) return;
|
|
21
|
+
isAnimating = true;
|
|
22
|
+
lastTime = performance.now();
|
|
23
|
+
var _animate = function animate(time) {
|
|
24
|
+
if (!isAnimating) return;
|
|
25
|
+
|
|
26
|
+
// Calculate delta time
|
|
27
|
+
var deltaTime = (time - lastTime) / 1000; // in seconds
|
|
28
|
+
lastTime = time;
|
|
29
|
+
|
|
30
|
+
// Execute animation callbacks
|
|
31
|
+
executeCallbacks(time, deltaTime);
|
|
32
|
+
|
|
33
|
+
// Render if component exists
|
|
34
|
+
if (component && component.renderer && component.scene && component.camera) {
|
|
35
|
+
component.renderer.render(component.scene, component.camera);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Update orbit controls if they exist
|
|
39
|
+
if (component && component.controls && component.controls.update) {
|
|
40
|
+
component.controls.update();
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// Continue animation loop
|
|
44
|
+
animationFrameId = requestAnimationFrame(_animate);
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
// Start animation loop
|
|
48
|
+
animationFrameId = requestAnimationFrame(_animate);
|
|
49
|
+
debugLogger.logger.info('Animation loop started');
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Stop the animation loop
|
|
54
|
+
*/
|
|
55
|
+
function stopAnimation() {
|
|
56
|
+
if (!isAnimating) return;
|
|
57
|
+
if (animationFrameId !== null) {
|
|
58
|
+
cancelAnimationFrame(animationFrameId);
|
|
59
|
+
animationFrameId = null;
|
|
60
|
+
}
|
|
61
|
+
isAnimating = false;
|
|
62
|
+
debugLogger.logger.info('Animation loop stopped');
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Register an animation callback
|
|
67
|
+
*/
|
|
68
|
+
function addAnimationCallback(callback) {
|
|
69
|
+
if (typeof callback !== 'function') {
|
|
70
|
+
debugLogger.logger.warn('Invalid animation callback');
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
callbacks.push(callback);
|
|
74
|
+
return callback;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Remove an animation callback
|
|
79
|
+
*/
|
|
80
|
+
function removeAnimationCallback(callback) {
|
|
81
|
+
var index = callbacks.indexOf(callback);
|
|
82
|
+
if (index !== -1) {
|
|
83
|
+
callbacks.splice(index, 1);
|
|
84
|
+
return true;
|
|
85
|
+
}
|
|
86
|
+
return false;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Execute all registered animation callbacks
|
|
91
|
+
*/
|
|
92
|
+
function executeCallbacks(time, deltaTime) {
|
|
93
|
+
callbacks.forEach(function (callback) {
|
|
94
|
+
try {
|
|
95
|
+
callback(time, deltaTime);
|
|
96
|
+
} catch (error) {
|
|
97
|
+
debugLogger.logger.error('Error in animation callback:', error);
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Check if animation is running
|
|
104
|
+
*/
|
|
105
|
+
function isAnimationRunning() {
|
|
106
|
+
return isAnimating;
|
|
107
|
+
}
|
|
108
|
+
var animationManager = {
|
|
109
|
+
startAnimation: startAnimation,
|
|
110
|
+
stopAnimation: stopAnimation,
|
|
111
|
+
addAnimationCallback: addAnimationCallback,
|
|
112
|
+
removeAnimationCallback: removeAnimationCallback,
|
|
113
|
+
isAnimationRunning: isAnimationRunning
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
exports.addAnimationCallback = addAnimationCallback;
|
|
117
|
+
exports["default"] = animationManager;
|
|
118
|
+
exports.isAnimationRunning = isAnimationRunning;
|
|
119
|
+
exports.removeAnimationCallback = removeAnimationCallback;
|
|
120
|
+
exports.startAnimation = startAnimation;
|
|
121
|
+
exports.stopAnimation = stopAnimation;
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _rollupPluginBabelHelpers = require('../_virtual/_rollupPluginBabelHelpers.js');
|
|
6
|
+
var THREE = require('three');
|
|
7
|
+
var debugLogger = require('./debugLogger.js');
|
|
8
|
+
|
|
9
|
+
function _interopNamespace(e) {
|
|
10
|
+
if (e && e.__esModule) return e;
|
|
11
|
+
var n = Object.create(null);
|
|
12
|
+
if (e) {
|
|
13
|
+
Object.keys(e).forEach(function (k) {
|
|
14
|
+
if (k !== 'default') {
|
|
15
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
16
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: function () { return e[k]; }
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
n["default"] = e;
|
|
24
|
+
return Object.freeze(n);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
var THREE__namespace = /*#__PURE__*/_interopNamespace(THREE);
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Load a component from data
|
|
31
|
+
*/
|
|
32
|
+
function loadComponent(_x) {
|
|
33
|
+
return _loadComponent.apply(this, arguments);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Place a component in the scene
|
|
38
|
+
*/
|
|
39
|
+
function _loadComponent() {
|
|
40
|
+
_loadComponent = _rollupPluginBabelHelpers.asyncToGenerator(/*#__PURE__*/_rollupPluginBabelHelpers.regenerator().m(function _callee(componentData) {
|
|
41
|
+
var component;
|
|
42
|
+
return _rollupPluginBabelHelpers.regenerator().w(function (_context) {
|
|
43
|
+
while (1) switch (_context.n) {
|
|
44
|
+
case 0:
|
|
45
|
+
debugLogger.logger.info("Loading component: ".concat(componentData.id || 'Unknown'));
|
|
46
|
+
|
|
47
|
+
// This is a stub implementation that will need to be expanded
|
|
48
|
+
component = {
|
|
49
|
+
id: componentData.id || 'unknown-component',
|
|
50
|
+
type: componentData.type || 'generic',
|
|
51
|
+
data: componentData,
|
|
52
|
+
object: new THREE__namespace.Group(),
|
|
53
|
+
position: componentData.position || {
|
|
54
|
+
x: 0,
|
|
55
|
+
y: 0,
|
|
56
|
+
z: 0
|
|
57
|
+
},
|
|
58
|
+
rotation: componentData.rotation || {
|
|
59
|
+
x: 0,
|
|
60
|
+
y: 0,
|
|
61
|
+
z: 0
|
|
62
|
+
},
|
|
63
|
+
scale: componentData.scale || {
|
|
64
|
+
x: 1,
|
|
65
|
+
y: 1,
|
|
66
|
+
z: 1
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
return _context.a(2, component);
|
|
70
|
+
}
|
|
71
|
+
}, _callee);
|
|
72
|
+
}));
|
|
73
|
+
return _loadComponent.apply(this, arguments);
|
|
74
|
+
}
|
|
75
|
+
function placeComponent(component, position, rotation, scene) {
|
|
76
|
+
if (!component || !component.object) {
|
|
77
|
+
debugLogger.logger.error('Cannot place component: invalid component object');
|
|
78
|
+
return null;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// Set position
|
|
82
|
+
if (position) {
|
|
83
|
+
component.object.position.set(position.x || 0, position.y || 0, position.z || 0);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// Set rotation
|
|
87
|
+
if (rotation) {
|
|
88
|
+
component.object.rotation.set(rotation.x || 0, rotation.y || 0, rotation.z || 0);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// Add to scene if provided
|
|
92
|
+
if (scene && scene.add) {
|
|
93
|
+
scene.add(component.object);
|
|
94
|
+
}
|
|
95
|
+
return component;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Remove a component from the scene
|
|
100
|
+
*/
|
|
101
|
+
function removeComponent(componentId, scene) {
|
|
102
|
+
if (!scene) {
|
|
103
|
+
debugLogger.logger.error('Cannot remove component: scene not provided');
|
|
104
|
+
return false;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// Find the component by ID
|
|
108
|
+
var componentObject = null;
|
|
109
|
+
scene.traverse(function (object) {
|
|
110
|
+
if (object.userData && object.userData.id === componentId) {
|
|
111
|
+
componentObject = object;
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
if (componentObject && componentObject.parent) {
|
|
115
|
+
componentObject.parent.remove(componentObject);
|
|
116
|
+
debugLogger.logger.info("Component removed: ".concat(componentId));
|
|
117
|
+
return true;
|
|
118
|
+
} else {
|
|
119
|
+
debugLogger.logger.warn("Component not found: ".concat(componentId));
|
|
120
|
+
return false;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Get a component by ID
|
|
126
|
+
*/
|
|
127
|
+
function getComponentById(id, scene) {
|
|
128
|
+
if (!scene) {
|
|
129
|
+
debugLogger.logger.error('Cannot get component: scene not provided');
|
|
130
|
+
return null;
|
|
131
|
+
}
|
|
132
|
+
var component = null;
|
|
133
|
+
scene.traverse(function (object) {
|
|
134
|
+
if (object.userData && object.userData.id === id) {
|
|
135
|
+
component = object;
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
return component;
|
|
139
|
+
}
|
|
140
|
+
var componentManager = {
|
|
141
|
+
loadComponent: loadComponent,
|
|
142
|
+
placeComponent: placeComponent,
|
|
143
|
+
removeComponent: removeComponent,
|
|
144
|
+
getComponentById: getComponentById
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
exports["default"] = componentManager;
|
|
148
|
+
exports.getComponentById = getComponentById;
|
|
149
|
+
exports.loadComponent = loadComponent;
|
|
150
|
+
exports.placeComponent = placeComponent;
|
|
151
|
+
exports.removeComponent = removeComponent;
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _rollupPluginBabelHelpers = require('../_virtual/_rollupPluginBabelHelpers.js');
|
|
6
|
+
|
|
7
|
+
// Debug logging utility to reduce excessive console statements
|
|
8
|
+
// Provides conditional logging based on environment and debug levels
|
|
9
|
+
|
|
10
|
+
var DebugLogger = /*#__PURE__*/function () {
|
|
11
|
+
function DebugLogger() {
|
|
12
|
+
var namespace = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'SceneViewer';
|
|
13
|
+
var debugLevel = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'info';
|
|
14
|
+
_rollupPluginBabelHelpers.classCallCheck(this, DebugLogger);
|
|
15
|
+
this.namespace = namespace;
|
|
16
|
+
this.debugLevel = debugLevel;
|
|
17
|
+
this.isProduction = typeof process !== 'undefined' && process.env.NODE_ENV === 'production';
|
|
18
|
+
this.enabled = !this.isProduction;
|
|
19
|
+
|
|
20
|
+
// Debug levels: 'error', 'warn', 'info', 'debug', 'verbose'
|
|
21
|
+
this.levels = {
|
|
22
|
+
error: 0,
|
|
23
|
+
warn: 1,
|
|
24
|
+
info: 2,
|
|
25
|
+
debug: 3,
|
|
26
|
+
verbose: 4
|
|
27
|
+
};
|
|
28
|
+
this.currentLevel = this.levels[debugLevel] || this.levels.info;
|
|
29
|
+
}
|
|
30
|
+
return _rollupPluginBabelHelpers.createClass(DebugLogger, [{
|
|
31
|
+
key: "setLevel",
|
|
32
|
+
value: function setLevel(level) {
|
|
33
|
+
this.currentLevel = this.levels[level] || this.levels.info;
|
|
34
|
+
return this;
|
|
35
|
+
}
|
|
36
|
+
}, {
|
|
37
|
+
key: "enable",
|
|
38
|
+
value: function enable() {
|
|
39
|
+
this.enabled = true;
|
|
40
|
+
return this;
|
|
41
|
+
}
|
|
42
|
+
}, {
|
|
43
|
+
key: "disable",
|
|
44
|
+
value: function disable() {
|
|
45
|
+
this.enabled = false;
|
|
46
|
+
return this;
|
|
47
|
+
}
|
|
48
|
+
}, {
|
|
49
|
+
key: "_shouldLog",
|
|
50
|
+
value: function _shouldLog(level) {
|
|
51
|
+
return this.enabled && this.levels[level] <= this.currentLevel;
|
|
52
|
+
}
|
|
53
|
+
}, {
|
|
54
|
+
key: "_formatMessage",
|
|
55
|
+
value: function _formatMessage(level, message) {
|
|
56
|
+
var prefix = "[".concat(this.namespace, ":").concat(level.toUpperCase(), "]");
|
|
57
|
+
for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
58
|
+
args[_key - 2] = arguments[_key];
|
|
59
|
+
}
|
|
60
|
+
return [prefix, message].concat(args);
|
|
61
|
+
}
|
|
62
|
+
}, {
|
|
63
|
+
key: "error",
|
|
64
|
+
value: function error(message) {
|
|
65
|
+
if (this._shouldLog('error')) {
|
|
66
|
+
var _console;
|
|
67
|
+
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
68
|
+
args[_key2 - 1] = arguments[_key2];
|
|
69
|
+
}
|
|
70
|
+
(_console = console).error.apply(_console, _rollupPluginBabelHelpers.toConsumableArray(this._formatMessage.apply(this, ['error', message].concat(args))));
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}, {
|
|
74
|
+
key: "warn",
|
|
75
|
+
value: function warn(message) {
|
|
76
|
+
if (this._shouldLog('warn')) {
|
|
77
|
+
var _console2;
|
|
78
|
+
for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
|
|
79
|
+
args[_key3 - 1] = arguments[_key3];
|
|
80
|
+
}
|
|
81
|
+
(_console2 = console).warn.apply(_console2, _rollupPluginBabelHelpers.toConsumableArray(this._formatMessage.apply(this, ['warn', message].concat(args))));
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}, {
|
|
85
|
+
key: "info",
|
|
86
|
+
value: function info(message) {
|
|
87
|
+
if (this._shouldLog('info')) {
|
|
88
|
+
var _console3;
|
|
89
|
+
for (var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
|
|
90
|
+
args[_key4 - 1] = arguments[_key4];
|
|
91
|
+
}
|
|
92
|
+
(_console3 = console).log.apply(_console3, _rollupPluginBabelHelpers.toConsumableArray(this._formatMessage.apply(this, ['info', message].concat(args))));
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}, {
|
|
96
|
+
key: "debug",
|
|
97
|
+
value: function debug(message) {
|
|
98
|
+
if (this._shouldLog('debug')) {
|
|
99
|
+
var _console4;
|
|
100
|
+
for (var _len5 = arguments.length, args = new Array(_len5 > 1 ? _len5 - 1 : 0), _key5 = 1; _key5 < _len5; _key5++) {
|
|
101
|
+
args[_key5 - 1] = arguments[_key5];
|
|
102
|
+
}
|
|
103
|
+
(_console4 = console).debug.apply(_console4, _rollupPluginBabelHelpers.toConsumableArray(this._formatMessage.apply(this, ['debug', message].concat(args))));
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}, {
|
|
107
|
+
key: "verbose",
|
|
108
|
+
value: function verbose(message) {
|
|
109
|
+
if (this._shouldLog('verbose')) {
|
|
110
|
+
var _console5;
|
|
111
|
+
for (var _len6 = arguments.length, args = new Array(_len6 > 1 ? _len6 - 1 : 0), _key6 = 1; _key6 < _len6; _key6++) {
|
|
112
|
+
args[_key6 - 1] = arguments[_key6];
|
|
113
|
+
}
|
|
114
|
+
(_console5 = console).debug.apply(_console5, _rollupPluginBabelHelpers.toConsumableArray(this._formatMessage.apply(this, ['verbose', message].concat(args))));
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// Special methods for common patterns
|
|
119
|
+
}, {
|
|
120
|
+
key: "phase",
|
|
121
|
+
value: function phase(phaseNumber, message) {
|
|
122
|
+
for (var _len7 = arguments.length, args = new Array(_len7 > 2 ? _len7 - 2 : 0), _key7 = 2; _key7 < _len7; _key7++) {
|
|
123
|
+
args[_key7 - 2] = arguments[_key7];
|
|
124
|
+
}
|
|
125
|
+
this.info.apply(this, ["\uD83D\uDD0D PHASE ".concat(phaseNumber, ": ").concat(message)].concat(args));
|
|
126
|
+
}
|
|
127
|
+
}, {
|
|
128
|
+
key: "success",
|
|
129
|
+
value: function success(message) {
|
|
130
|
+
for (var _len8 = arguments.length, args = new Array(_len8 > 1 ? _len8 - 1 : 0), _key8 = 1; _key8 < _len8; _key8++) {
|
|
131
|
+
args[_key8 - 1] = arguments[_key8];
|
|
132
|
+
}
|
|
133
|
+
this.info.apply(this, ["\u2705 ".concat(message)].concat(args));
|
|
134
|
+
}
|
|
135
|
+
}, {
|
|
136
|
+
key: "failure",
|
|
137
|
+
value: function failure(message) {
|
|
138
|
+
for (var _len9 = arguments.length, args = new Array(_len9 > 1 ? _len9 - 1 : 0), _key9 = 1; _key9 < _len9; _key9++) {
|
|
139
|
+
args[_key9 - 1] = arguments[_key9];
|
|
140
|
+
}
|
|
141
|
+
this.error.apply(this, ["\u274C ".concat(message)].concat(args));
|
|
142
|
+
}
|
|
143
|
+
}, {
|
|
144
|
+
key: "loading",
|
|
145
|
+
value: function loading(message) {
|
|
146
|
+
for (var _len0 = arguments.length, args = new Array(_len0 > 1 ? _len0 - 1 : 0), _key0 = 1; _key0 < _len0; _key0++) {
|
|
147
|
+
args[_key0 - 1] = arguments[_key0];
|
|
148
|
+
}
|
|
149
|
+
this.debug.apply(this, ["\uD83D\uDD04 ".concat(message)].concat(args));
|
|
150
|
+
}
|
|
151
|
+
}, {
|
|
152
|
+
key: "timing",
|
|
153
|
+
value: function timing(message) {
|
|
154
|
+
for (var _len1 = arguments.length, args = new Array(_len1 > 1 ? _len1 - 1 : 0), _key1 = 1; _key1 < _len1; _key1++) {
|
|
155
|
+
args[_key1 - 1] = arguments[_key1];
|
|
156
|
+
}
|
|
157
|
+
this.debug.apply(this, ["\u23F1\uFE0F ".concat(message)].concat(args));
|
|
158
|
+
}
|
|
159
|
+
}]);
|
|
160
|
+
}();
|
|
161
|
+
|
|
162
|
+
// Create default logger instance
|
|
163
|
+
var logger = new DebugLogger('SceneViewer', 'info');
|
|
164
|
+
|
|
165
|
+
// Create specialized loggers for different subsystems
|
|
166
|
+
var transformLogger = new DebugLogger('Transform', 'warn');
|
|
167
|
+
var pathfinderLogger = new DebugLogger('Pathfinder', 'info');
|
|
168
|
+
var modelLogger = new DebugLogger('Models', 'info');
|
|
169
|
+
var materialLogger = new DebugLogger('Materials', 'warn');
|
|
170
|
+
|
|
171
|
+
exports.DebugLogger = DebugLogger;
|
|
172
|
+
exports.logger = logger;
|
|
173
|
+
exports.materialLogger = materialLogger;
|
|
174
|
+
exports.modelLogger = modelLogger;
|
|
175
|
+
exports.pathfinderLogger = pathfinderLogger;
|
|
176
|
+
exports.transformLogger = transformLogger;
|