Forum Replies Created
-
AuthorPosts
-
Alexander Kovelenov
StaffAlexander Kovelenov
StaffIf that’s something which could be roughly build with puzzles, the type of navigation used in the VR Demo would greatly benefit from this.
Hi Thomas,
Here is how we do it. You can use this snippet as a basis for your own puzzle or with “exec script”:_handleCollisions() { if (!this._enableCollisions || this.collisionMeshes.length == 0) return; this._raycaster.ray.origin.copy(this.object.position); this._raycaster.far = this.storyHeight; const intersections = this._raycaster.intersectObjects(this.collisionMeshes, false); if (intersections.length > 0) { const intersection = intersections[0]; this.object.position.y = intersection.point.y + this.gazeLevel; this._onCollisionMesh = true; } else if (this._onCollisionMesh) { let minDistance = Infinity; for (const mesh of this.collisionMeshes) { if (!mesh.geometry.boundsTree) { console.warn('v3d.FirstPersonControls: no bounding tree found on ' + mesh.name); continue; } this._toMeshSpaceMatrix.copy(mesh.matrixWorld).invert(); this._lastIntersection.copy(this.object.position); this._lastIntersection.y -= this.gazeLevel; this._lastIntersection.applyMatrix4(this._toMeshSpaceMatrix); const target = this._ppTarget; mesh.geometry.boundsTree.closestPointToPoint(this._lastIntersection, target); if (target.distance < minDistance) { this._nearestPoint.copy(target.point); this._nearestPoint.applyMatrix4(mesh.matrixWorld); minDistance = target.distance; } } if (isFinite(minDistance)) { this.object.position.copy(this._nearestPoint); this.object.position.y += this.gazeLevel; } else { // NOTE: fallback if no bounding trees present on collision meshes this.object.position.copy(this._lastPosition); } } }
This new code is from Verge3D preview that uses closestPointToPoint() method to push the camera back to the collision map. You’ll need to modify it to handle the “camera control object” instead.
-
This reply was modified 1 week, 4 days ago by
Alexander Kovelenov.
Alexander Kovelenov
StaffHi,
the “open web page – replace url” puzzle does not operate on the URL of the parent page (so it could not be used inside iframed apps). One possible workaround is to use the “exec script” as follows:
-
This reply was modified 3 weeks ago by
Alexander Kovelenov.
2025-01-10 at 6:34 am in reply to: Implement button clicks in the built-in WordPress editor – Verge3D Plugin #79758Alexander Kovelenov
StaffAlexander Kovelenov
StaffAlexander Kovelenov
StaffI see no critical errors in the console you provided. I believe there is a logical issue in the puzzles scenario itself. There are some hints that might help in debugging it:
1. Use more print to console to find our the possible reason of this misbehavior.
2. Temporary disable blocks that are not relevant to this particular functionality. This will help you in narrowing it down.
2025-01-09 at 5:57 am in reply to: Implement button clicks in the built-in WordPress editor – Verge3D Plugin #79721Alexander Kovelenov
StaffYou might try using the Chrome Developer Tools to find that element and get it by its class… etc manually, by executing the
document.querySelector(" ... ")
right in the browser console.Regarding the upload fail, apparently there is one file that has invalid MIME type (extension). You might need to review your app folder to find it and add its MIME to the plugin settings.
2025-01-08 at 10:31 am in reply to: Implement button clicks in the built-in WordPress editor – Verge3D Plugin #79711Alexander Kovelenov
StaffHi,
There are no specific puzzles required for making it work. The most probable cause of this misbehavior might be specifying a wrong value for the “query selector” puzzle, hence it does not return anything. You might use the print to console puzzle to verify that the proper element is returned by the query selector.Alexander Kovelenov
StaffAlexander Kovelenov
StaffAlexander Kovelenov
StaffAlexander Kovelenov
Staff2024-12-24 at 6:54 am in reply to: Proposition: allow camera direction inverting without “from mouse” option #79523Alexander Kovelenov
StaffHi, this appears to be a correct behavior. The “inverted” checker inverts the 2D cursor coordinates, not the final vector returned by the puzzle, hence it has no meaning when “from mouse/touch” is disabled (basically in that mode the coords are [0, 0] – the center of the screen).
Alexander Kovelenov
StaffAlexander Kovelenov
Staff -
This reply was modified 1 week, 4 days ago by
-
AuthorPosts