@react-three/rapier 2.0.0 → 2.0.1
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.
@@ -608,8 +608,11 @@ const Debug = /*#__PURE__*/React.memo(() => {
|
|
608
608
|
const mesh = ref.current;
|
609
609
|
if (!mesh) return;
|
610
610
|
const buffers = world.debugRender();
|
611
|
-
|
612
|
-
|
611
|
+
const geometry = new three.BufferGeometry();
|
612
|
+
geometry.setAttribute("position", new three.BufferAttribute(buffers.vertices, 3));
|
613
|
+
geometry.setAttribute("color", new three.BufferAttribute(buffers.colors, 4));
|
614
|
+
mesh.geometry.dispose();
|
615
|
+
mesh.geometry = geometry;
|
613
616
|
});
|
614
617
|
return /*#__PURE__*/React__default["default"].createElement("group", null, /*#__PURE__*/React__default["default"].createElement("lineSegments", {
|
615
618
|
ref: ref,
|
@@ -608,8 +608,11 @@ const Debug = /*#__PURE__*/React.memo(() => {
|
|
608
608
|
const mesh = ref.current;
|
609
609
|
if (!mesh) return;
|
610
610
|
const buffers = world.debugRender();
|
611
|
-
|
612
|
-
|
611
|
+
const geometry = new three.BufferGeometry();
|
612
|
+
geometry.setAttribute("position", new three.BufferAttribute(buffers.vertices, 3));
|
613
|
+
geometry.setAttribute("color", new three.BufferAttribute(buffers.colors, 4));
|
614
|
+
mesh.geometry.dispose();
|
615
|
+
mesh.geometry = geometry;
|
613
616
|
});
|
614
617
|
return /*#__PURE__*/React__default["default"].createElement("group", null, /*#__PURE__*/React__default["default"].createElement("lineSegments", {
|
615
618
|
ref: ref,
|
@@ -2,7 +2,7 @@ import { Vector3 as Vector3$1, Quaternion as Quaternion$1, ActiveEvents, Collide
|
|
2
2
|
export { CoefficientCombineRule, Collider as RapierCollider, RigidBody as RapierRigidBody } from '@dimforge/rapier3d-compat';
|
3
3
|
import { useFrame, useThree } from '@react-three/fiber';
|
4
4
|
import React, { useRef, useEffect, memo, useMemo, useContext, useState, createContext, useCallback, Fragment } from 'react';
|
5
|
-
import { Quaternion, Euler, Vector3, Object3D, Matrix4, BufferAttribute, MathUtils, DynamicDrawUsage } from 'three';
|
5
|
+
import { Quaternion, Euler, Vector3, Object3D, Matrix4, BufferGeometry, BufferAttribute, MathUtils, DynamicDrawUsage } from 'three';
|
6
6
|
import { suspend } from 'suspend-react';
|
7
7
|
import { mergeVertices } from 'three-stdlib';
|
8
8
|
|
@@ -583,8 +583,11 @@ const Debug = /*#__PURE__*/memo(() => {
|
|
583
583
|
const mesh = ref.current;
|
584
584
|
if (!mesh) return;
|
585
585
|
const buffers = world.debugRender();
|
586
|
-
|
587
|
-
|
586
|
+
const geometry = new BufferGeometry();
|
587
|
+
geometry.setAttribute("position", new BufferAttribute(buffers.vertices, 3));
|
588
|
+
geometry.setAttribute("color", new BufferAttribute(buffers.colors, 4));
|
589
|
+
mesh.geometry.dispose();
|
590
|
+
mesh.geometry = geometry;
|
588
591
|
});
|
589
592
|
return /*#__PURE__*/React.createElement("group", null, /*#__PURE__*/React.createElement("lineSegments", {
|
590
593
|
ref: ref,
|