mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 18:57:03 +02:00
fix: armor mesh rotation dysync
This commit is contained in:
1 parent
e33ae0f81b
commit
bc211822aa
7 files changed
+17
-24
No files matched your search
@@ -1,10 +1,11 @@
|
||||
import { MeshProps } from '@react-three/fiber';
|
||||
import { Mesh, Object3D } from 'three';
|
||||
|
||||
export function jsxTree(node: Object3D, mesh?: MeshProps) {
|
||||
export function jsxTree(node: Object3D, mesh?: MeshProps, key?: string) {
|
||||
if (node instanceof Mesh) {
|
||||
return (
|
||||
<mesh
|
||||
key={key}
|
||||
geometry={node.geometry}
|
||||
material={node.material}
|
||||
position={node.position}
|
||||
@@ -16,11 +17,12 @@ export function jsxTree(node: Object3D, mesh?: MeshProps) {
|
||||
} else if (node instanceof Object3D) {
|
||||
return (
|
||||
<group
|
||||
key={key}
|
||||
position={node.position}
|
||||
rotation={node.rotation}
|
||||
scale={node.scale}
|
||||
>
|
||||
{node.children.map((child) => jsxTree(child, mesh))}
|
||||
{node.children.map((child) => jsxTree(child, mesh, child.uuid))}
|
||||
</group>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user