Skip to content

Commit 90c337f

Browse files
authored
Merge pull request #66 from spacesvr/dev
v1.8.5
2 parents 0fc2afd + 6e9a744 commit 90c337f

4 files changed

Lines changed: 19 additions & 22 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "spacesvr",
3-
"version": "1.8.3",
3+
"version": "1.8.5",
44
"private": true,
55
"description": "An Environment for WebXR Spaces",
66
"keywords": [

src/ideas/components/Video.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { useEffect, useMemo, useRef, useState } from "react";
22
import * as THREE from "three";
33
import { useThree } from "@react-three/fiber";
44
import Frame from "../misc/Frame";
5-
import { Material, Vector2 } from "three";
5+
import { DoubleSide, LinearEncoding, Material, Vector2 } from "three";
66

77
type Props = JSX.IntrinsicElements["group"] & {
88
src: string;
@@ -111,8 +111,8 @@ export const Video = (props: Props) => {
111111
<group {...props}>
112112
<mesh>
113113
<planeBufferGeometry attach="geometry" args={[width, height]} />
114-
<meshBasicMaterial>
115-
<videoTexture attach="map" args={[video]} />
114+
<meshBasicMaterial side={DoubleSide}>
115+
<videoTexture attach="map" args={[video]} encoding={LinearEncoding} />
116116
</meshBasicMaterial>
117117
</mesh>
118118
{speaker && <primitive object={speaker} />}

src/layers/reality/players/colliders/CapsuleCollider.tsx

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,26 +17,23 @@ export const useCapsuleCollider = (pos = [0, 0, 0]) => {
1717
const vPos = pos as Triplet;
1818

1919
const { paused } = useEnvironment();
20-
const [mass, setMass] = useState(0);
21-
22-
const compoundBody = useCompoundBody(
23-
() => ({
24-
mass: mass,
25-
position: vPos,
26-
segments: 8,
27-
fixedRotation: true,
28-
type: "Dynamic",
29-
shapes: [sphere1, sphere2, sphere3],
30-
}),
31-
undefined,
32-
[mass]
33-
);
20+
const [setup, setSetup] = useState(false);
21+
22+
const compoundBody = useCompoundBody(() => ({
23+
mass: 0,
24+
position: vPos,
25+
segments: 8,
26+
fixedRotation: true,
27+
type: "Dynamic",
28+
shapes: [sphere1, sphere2, sphere3],
29+
}));
3430

3531
useEffect(() => {
36-
if (!paused && mass === 0) {
37-
setMass(62);
32+
if (!paused && !setup) {
33+
compoundBody[1].mass?.set(62);
34+
setSetup(true);
3835
}
39-
}, [mass, paused]);
36+
}, [setup, paused, compoundBody]);
4037

4138
return compoundBody;
4239
};

src/layers/reality/ui/PauseMenu.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ export default function PauseMenu(props: PauseMenuProps) {
186186
)}`,
187187
},
188188
{
189-
text: "v1.8.3",
189+
text: "v1.8.5",
190190
action: () => {
191191
console.log("");
192192
},

0 commit comments

Comments
 (0)