orbix-engine 1.0.3 → 1.0.4

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/dist/orbix.js CHANGED
@@ -27967,6 +27967,20 @@ Class((function AppStateOperators(_default) {
27967
27967
  lastChange: "2025-05-11T21:43:09.306Z"
27968
27968
  }], Class((function Antimatter(_num, _config, _renderer = World.RENDERER, _pointData = null) {
27969
27969
  Inherit(this, AntimatterFBO);
27970
+ // Options-style API: new Antimatter({ count, width, height, depth, ... })
27971
+ if (typeof _num === 'object' && _num !== null) {
27972
+ var _opts = _num;
27973
+ _num = _opts.count || _opts.num || _opts.particleCount || 1000;
27974
+ _config = {
27975
+ w: _opts.width || [-1, 1],
27976
+ h: _opts.height || [-1, 1],
27977
+ d: _opts.depth || [-1, 1],
27978
+ pot: _opts.pot || false
27979
+ };
27980
+ _renderer = _opts.renderer || World.RENDERER;
27981
+ _pointData = _opts.pointData || null;
27982
+ }
27983
+ if (!_config) _config = { w: [-1, 1], h: [-1, 1], d: [-1, 1] };
27970
27984
  var _geometry, _this = this,
27971
27985
  _drawLimit = _num,
27972
27986
  _size = function findSize() {
@@ -27979,7 +27993,9 @@ Class((function AppStateOperators(_default) {
27979
27993
  attribs: attribs,
27980
27994
  usedDepth: usedDepth
27981
27995
  } = await AntimatterUtil.createBufferArray(_size, _num, _config, _pointData);
27982
- _this.vertices = _this.cloneVertices ? vertices.clone() : vertices, (_geometry = geometry.clone(!0)).drawRange.end = _drawLimit, _this.vertices.geometry = _geometry, _this.attribs = _this.random = attribs, _this.textureUsedDepth = usedDepth, _this.init(_geometry, _renderer, _size)
27996
+ _this.vertices = _this.cloneVertices ? vertices.clone() : vertices, (_geometry = geometry.clone(!0)).drawRange.end = _drawLimit, _this.vertices.geometry = _geometry, _this.attribs = _this.random = attribs, _this.textureUsedDepth = usedDepth, _this.init(_geometry, _renderer, _size);
27997
+ // Auto-create mesh for standalone usage (CDN users)
27998
+ if (!_this.mesh) { try { _this.mesh = _this.getMesh(); } catch(e){} }
27983
27999
  }
27984
28000
  defer(createBuffer), this.createFloatArray = function(components = 3) {
27985
28001
  return new Float32Array(_size * _size * components)
@@ -28288,6 +28304,15 @@ Class((function AppStateOperators(_default) {
28288
28304
  }
28289
28305
  })), Class((function AntimatterSpawn(_proton, _group, _input) {
28290
28306
  Inherit(this, Component);
28307
+ // Guard: AntimatterSpawn requires a valid Proton parent with .antimatter
28308
+ if (!_proton || !_proton.antimatter || typeof _proton.antimatter.createFloatArrayAsync !== 'function') {
28309
+ console.warn('AntimatterSpawn: requires a Proton parent instance. Cannot be created standalone.');
28310
+ this.canEmit = false;
28311
+ this.emit = function(){};
28312
+ this.release = function(){};
28313
+ this.ready = function(){ return Promise.resolve(); };
28314
+ return;
28315
+ }
28291
28316
  const _this = this;
28292
28317
  var _life, _pass, _velocity, _color, _index = -1,
28293
28318
  _total = _proton.particleCount,
@@ -61342,7 +61367,22 @@ window._BUILT_ = false;
61342
61367
  HE.Frustum = window.Frustum;
61343
61368
  HE.MathTween = window.MathTween;
61344
61369
  HE.MatrixWasm = window.MatrixWasm;
61345
- HE.MathUtils = { radians: Math.radians, lerp: Math.lerp, clamp: Math.clamp, range: Math.range, smoothStep: Math.smoothStep };
61370
+ HE.MathUtils = {
61371
+ radians: Math.radians,
61372
+ degrees: Math.degrees,
61373
+ lerp: Math.lerp,
61374
+ clamp: Math.clamp,
61375
+ range: Math.range,
61376
+ map: Math.map,
61377
+ mix: Math.mix,
61378
+ step: Math.step,
61379
+ smoothStep: Math.smoothStep,
61380
+ fract: Math.fract,
61381
+ randFloat: function(min, max) { return Math.random(min, max, 10); },
61382
+ randInt: function(min, max) { return Math.random(min, max, 0); },
61383
+ random: function(min, max, precision) { return Math.random(min, max, precision); }
61384
+ };
61385
+ window.MathUtils = HE.MathUtils;
61346
61386
 
61347
61387
  // ── 3D OBJECTS ──────────────────────────────────────────────────────────
61348
61388
  HE.Object3D = window.Object3D;