![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
The Reality Accelerator Toolkit is a comprehensive WebXR utilities library that simplifies the integration of mixed reality features in WebXR applications. Compatible with the three.js 3D library, it bridges the gap between the low-level WebXR APIs and the higher-level APIs offered by three.js. Designed for extensibility, it enables the management of detected planes, meshes, anchors, and real-world hit test targets, translating them seamlessly to Object3D instances in the three.js scene.
To install the package via NPM, run:
$ npm install ratk
Each section below details how to use different features of the toolkit.
import { ARButton } from 'ratk';
const renderer = /* Three.js WebGLRenderer */;
const arButton = document.getElementById('ar-button');
ARButton.convertToARButton(arButton, renderer, {
sessionInit: {
requiredFeatures: ['hit-test', 'plane-detection', 'mesh-detection', 'anchors'],
optionalFeatures: [],
},
});
// Import the library
import { RealityAccelerator } from 'ratk';
const ratk = new RealityAccelerator(renderer.xr);
const scene = /* Three.js Scene object */;
scene.add(ratk.root);
function render() {
ratk.update();
}
Creating Anchors: Define position and orientation, then attach objects.
const ratk = /* RealityAccelerator instance */;
const anchorPosition = new Vector3(1, 2, 3);
const anchorQuaternion = new Quaternion(0, 0, 0, 1);
ratk.createAnchor(anchorPosition, anchorQuaternion, isPersistent)
.then((anchor /* RATK Anchor object extends Object3D */) => {
// Attach a new THREE.Mesh to the anchor
anchor.add(new THREE.Mesh(geometry, material));
});
Recovering Anchors: Access persistent anchors from previous sessions.
ratk.restorePersistentAnchors().then(() => {
ratk.anchors.forEach((anchor) => {
// Process each recovered anchor
anchor.add(new THREE.Mesh(geometry, material));
});
});
Processing Planes: Define a hook to handle new planes.
ratk.onPlaneAdded = (plane /* extends Object3D */) => {
if (plane.semanticLabel === 'wall art') {
const mesh = plane.planeMesh; // Three.js Plane Mesh
mesh.material = new MeshBasicMaterial(/_ parameters _/);
// Additional plane processing
}
};
Alternatively, access planes directly from the RATK instance:
ratk.planes.forEach((plane) => {
// Process each plane
});
Processing Meshes: Define a hook to handle new meshes.
ratk.onMeshAdded = (rmesh /* extends Object3D */) => {
const meshMesh = rmesh.meshMesh; /* reconstructed Three.js Mesh */
meshMesh.material = new MeshBasicMaterial(...);
meshMesh.geometry.computeBoundingBox();
// put a text label on top of the mesh
const semanticLabel = new Text();
meshMesh.add(semanticLabel);
semanticLabel.text = mesh.semanticLabel;
semanticLabel.sync();
semanticLabel.position.y = meshMesh.geometry.boundingBox.max.y;
};
Alternatively, access meshes directly from the RATK instance:
ratk.meshes.forEach((rmesh) => {
// Process each mesh
});
Controller Hit-Testing: Create HitTestTarget from controller with offset transform
const ratk = /* RealityAccelerator instance */;
const offsetPosition = new Vector3(0, 0, 0);
const offsetQuaternion = new Quaternion(0, 0, 0, 1);
ratk
.createHitTestTargetFromControllerSpace(
handedness,
offsetPosition,
offsetQuaternion,
)
.then((hitTestTarget /* extends Object3D */) => {
hitTestTarget.add(
new Mesh(...),
);
});
Alternatively, conduct hit-testing from viewer space:
ratk.createHitTestTargetFromViewerSpace(
offsetPosition,
offsetQuaternion,
).then(...);
Please read CONTRIBUTING.md for details on how to contribute to the project.
This project is licensed under the MIT License - see the LICENSE.md file for details.
FAQs
WebXR mixed reality utilities library
The npm package ratk receives a total of 61 weekly downloads. As such, ratk popularity was classified as not popular.
We found that ratk demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.