Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ function App({ signOut, user }: WithAuthenticatorProps) {
/>
<Route
path="/viewer/:urlParam?"
element={<ModelViewPage />}
element={<ModelViewPage/>}
/>
<Route
path="/log_in"
Expand Down
22 changes: 10 additions & 12 deletions src/components/Components/OpenSimGUIScene.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ const OpenSimGUIScene: React.FC<OpenSimSceneProps> = ({ currentModelPath, suppor
const [currentCamera, setCurrentCamera] = useState<PerspectiveCamera>()

let curState = useModelContext();
curState.isGuiMode = true;
const modelGroup = useLoader(OpenSimLoader, currentModelPath)

//computeNormals(modelGroup as Group);
Expand Down Expand Up @@ -129,7 +128,7 @@ const OpenSimGUIScene: React.FC<OpenSimSceneProps> = ({ currentModelPath, suppor
const cameraPers = camera as PerspectiveCamera
cameraPers.aspect = aspectRatio;
cameraPers.updateProjectionMatrix();

if (envRef.current) {
envRef.current.add(camera);
}
Expand Down Expand Up @@ -346,7 +345,6 @@ const OpenSimGUIScene: React.FC<OpenSimSceneProps> = ({ currentModelPath, suppor
setUseEffectRunning(true)
};
}, [scene, supportControls, currentModelPath, curState, sceneObjectMap])


function handleClick(event: ThreeEvent<MouseEvent>): void {
//event.stopPropagation();
Expand Down Expand Up @@ -399,8 +397,15 @@ const OpenSimGUIScene: React.FC<OpenSimSceneProps> = ({ currentModelPath, suppor
shadow-camera-top={2}
shadow-camera-bottom={-2}/>
<ambientLight name="Ambient Light" intensity={0.02} color="white"/>
<directionalLight name="Dir Light2" position={[0.02, .01, .02]} intensity={1.5} color="white" castShadow={false}/>
<OpenSimFloor />
<directionalLight name="Dir Light2" position={[0.02, .01, .02]} intensity={1.5} color="grey" castShadow={false}/>
{supportControls && <OpenSimFloor />}
{supportControls && <OpenSimSkySphere
texturePath={
curState.viewerState.userPreferences?.skyTexturePath?.trim()
? curState.viewerState.userPreferences.skyTexturePath
: undefined
}
/>}
<group name='WCS' ref={csRef} visible={curState.showGlobalFrame}>
<mesh rotation={[Math.PI / 2, 0, 0]} position={[0, 0, 0.2]}>
<cylinderGeometry args={[.005, .005, 0.4, 32]}/>
Expand All @@ -416,13 +421,6 @@ const OpenSimGUIScene: React.FC<OpenSimSceneProps> = ({ currentModelPath, suppor
</mesh>
</group>
</group>
<OpenSimSkySphere
texturePath={
curState.viewerState.userPreferences?.skyTexturePath?.trim()
? curState.viewerState.userPreferences.skyTexturePath
: undefined
}
/>
<group name='Models' ref={modelsRef}
onClick={(e)=>{ handleClick(e);}}
onPointerMissed={(e)=>{clearSelection();}}
Expand Down
Loading