@lv-x-software-house/x_view 1.2.4-dev.19 → 1.2.4-dev.20

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/index.js CHANGED
@@ -13161,11 +13161,26 @@ function XViewScene({
13161
13161
  if (isUiClear) {
13162
13162
  const isView = ((_c2 = viewParams == null ? void 0 : viewParams.type) == null ? void 0 : _c2.toLowerCase()) === "view";
13163
13163
  if (!isView) return;
13164
- const { graphGroup, glowTexture, controls } = stateRef.current;
13164
+ const { graphGroup, glowTexture, controls, nodeObjects } = stateRef.current;
13165
13165
  if (graphGroup) {
13166
- const basePosition = controls.target.clone();
13167
- const offset = new THREE3.Vector3((Math.random() - 0.5) * 15, (Math.random() - 0.5) * 5, 0);
13168
- const ghostPosition = basePosition.add(offset);
13166
+ let ghostPosition = controls.target.clone();
13167
+ const existingNodes = Object.values(nodeObjects);
13168
+ let isOccupied = true;
13169
+ let radius = 18;
13170
+ let angle = 0;
13171
+ let attempts = 0;
13172
+ const MIN_CLEARANCE = 15;
13173
+ while (isOccupied && attempts < 30) {
13174
+ isOccupied = existingNodes.some((mesh) => mesh.position.distanceTo(ghostPosition) < MIN_CLEARANCE);
13175
+ if (isOccupied) {
13176
+ ghostPosition.x = controls.target.x + Math.cos(angle) * radius;
13177
+ ghostPosition.y = controls.target.y + (Math.random() - 0.5) * 8;
13178
+ ghostPosition.z = controls.target.z + Math.sin(angle) * radius;
13179
+ angle += Math.PI / 3;
13180
+ radius += 2.5;
13181
+ attempts++;
13182
+ }
13183
+ }
13169
13184
  const ghostData = {
13170
13185
  id: "ghost_quest",
13171
13186
  name: "Nova Quest",
@@ -13189,9 +13204,9 @@ function XViewScene({
13189
13204
  stateRef.current.ghostElements = {
13190
13205
  node: ghostNode,
13191
13206
  line: null,
13192
- // Quests não possuem linha de conexão na criação
13193
13207
  aura: ghostNode.getObjectByName("aura")
13194
13208
  };
13209
+ context.tweenToTarget(ghostPosition, 1.6);
13195
13210
  }
13196
13211
  setQuestMode({ isActive: true });
13197
13212
  }
package/dist/index.mjs CHANGED
@@ -13161,11 +13161,26 @@ function XViewScene({
13161
13161
  if (isUiClear) {
13162
13162
  const isView = ((_c2 = viewParams == null ? void 0 : viewParams.type) == null ? void 0 : _c2.toLowerCase()) === "view";
13163
13163
  if (!isView) return;
13164
- const { graphGroup, glowTexture, controls } = stateRef.current;
13164
+ const { graphGroup, glowTexture, controls, nodeObjects } = stateRef.current;
13165
13165
  if (graphGroup) {
13166
- const basePosition = controls.target.clone();
13167
- const offset = new THREE3.Vector3((Math.random() - 0.5) * 15, (Math.random() - 0.5) * 5, 0);
13168
- const ghostPosition = basePosition.add(offset);
13166
+ let ghostPosition = controls.target.clone();
13167
+ const existingNodes = Object.values(nodeObjects);
13168
+ let isOccupied = true;
13169
+ let radius = 18;
13170
+ let angle = 0;
13171
+ let attempts = 0;
13172
+ const MIN_CLEARANCE = 15;
13173
+ while (isOccupied && attempts < 30) {
13174
+ isOccupied = existingNodes.some((mesh) => mesh.position.distanceTo(ghostPosition) < MIN_CLEARANCE);
13175
+ if (isOccupied) {
13176
+ ghostPosition.x = controls.target.x + Math.cos(angle) * radius;
13177
+ ghostPosition.y = controls.target.y + (Math.random() - 0.5) * 8;
13178
+ ghostPosition.z = controls.target.z + Math.sin(angle) * radius;
13179
+ angle += Math.PI / 3;
13180
+ radius += 2.5;
13181
+ attempts++;
13182
+ }
13183
+ }
13169
13184
  const ghostData = {
13170
13185
  id: "ghost_quest",
13171
13186
  name: "Nova Quest",
@@ -13189,9 +13204,9 @@ function XViewScene({
13189
13204
  stateRef.current.ghostElements = {
13190
13205
  node: ghostNode,
13191
13206
  line: null,
13192
- // Quests não possuem linha de conexão na criação
13193
13207
  aura: ghostNode.getObjectByName("aura")
13194
13208
  };
13209
+ context.tweenToTarget(ghostPosition, 1.6);
13195
13210
  }
13196
13211
  setQuestMode({ isActive: true });
13197
13212
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lv-x-software-house/x_view",
3
- "version": "1.2.4-dev.19",
3
+ "version": "1.2.4-dev.20",
4
4
  "description": "Pacote privado contendo os componentes e lógica de renderização 3D do X View.",
5
5
  "author": "iv.x - Engenharia de Software - ivxsoftwarehouse@gmail.com",
6
6
  "license": "UNLICENSED",