Skip to content

Commit

Permalink
Fixed missing shadows when base scene enabled
Browse files Browse the repository at this point in the history
Fixed bug happening on events because of missing div
  • Loading branch information
sachamorgese committed Nov 17, 2023
1 parent 5f4220f commit f7e7e1c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/components/ExampleView/ExampleFloatingClient.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,12 @@ export const ExampleFloatingClient = React.memo(function ExampleClient(props: {
if (props.baseScene) {
const pointLight = new THREE.PointLight(0xffffff, 1, 100);
pointLight.position.set(10, 10, 10);
pointLight.castShadow = true;
const plane = new THREE.Mesh(
new THREE.PlaneGeometry(20, 20),
new THREE.MeshPhongMaterial({ color: 0xffffff }),
new THREE.MeshStandardMaterial({ color: 0xffffff }),
);
plane.receiveShadow = true;
plane.rotation.x = -Math.PI / 2;
mmlScene.getThreeScene().add(plane);
mmlScene.getThreeScene().add(pointLight);
Expand Down
5 changes: 2 additions & 3 deletions src/pages/docs/reference/events/[event-id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,20 +111,19 @@ const DocsPage = ({ eventId }: { eventId: string }) => {
<TypeDocComment comment={eventClassDefinition.comment} />
)}
{primaryExample && (
<>
<div>
<h2 className="mb-4 mt-8 scroll-m-20 text-3xl font-medium" id="try it">
Try it
</h2>
<ExampleView
description={primaryExample.description}
key={`${eventId}-primary`}
baseScene={
primaryExample.baseSceneOn !== undefined ? primaryExample.baseSceneOn : true
}
code={primaryExample.code}
initialClients={primaryExample.clients ?? [CLIENT_TYPES.FLOATING]}
/>
</>
</div>
)}
<h2 className="mb-4 mt-6 scroll-m-20 text-3xl font-medium" id="properties">
Properties
Expand Down

0 comments on commit f7e7e1c

Please sign in to comment.