Skip to content

Commit

Permalink
Merge pull request #97 from pmndrs/impulseSource
Browse files Browse the repository at this point in the history
Motion source
  • Loading branch information
DennisSmolek authored Apr 29, 2024
2 parents a114966 + 7eb775a commit 909822b
Show file tree
Hide file tree
Showing 10 changed files with 1,127 additions and 296 deletions.
11 changes: 10 additions & 1 deletion apps/examples/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import { CubeHeap } from "./examples/CubeHeap";
import { FourWheelDemo } from "./examples/FourWheelsWithHeightmap";
import { CharacterVirtualDemo } from "./examples/CharacterVirtualDemo";
import { Impulses } from "./examples/Impulses";
import { MotionSources } from "./examples/motionSources";
const demoContext = createContext<{
debug: boolean;
paused: boolean;
Expand Down Expand Up @@ -84,6 +85,7 @@ type Routes = {
target?: number[];
background?: string;
element: JSX.Element;
label?: string;
};
};

Expand Down Expand Up @@ -137,6 +139,13 @@ const routes: Routes = {
target: [0, 0, 0],
background: "#141622",
element: <Impulses />
},
MotionSources: {
label: "Motion Sources",
position: [0, 25, 15],
target: [0, 1, -15],
background: "#C1839F",
element: <MotionSources />
}
};

Expand Down Expand Up @@ -222,7 +231,7 @@ export const App = () => {
>
{Object.keys(routes).map((key) => (
<Link key={key} to={key} end>
{key.replace(/-/g, " ") || "Raycaster"}
{routes[key].label || key.replace(/-/g, " ") || "Raycaster"}
</Link>
))}

Expand Down
2 changes: 1 addition & 1 deletion apps/examples/src/examples/Impulses.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ function Pointer() {
);
//apply the camera space to the vector
pointerVector.applyMatrix4(camera.matrixWorld);
// move the pointer with kinematic force
//@ts-ignore move the pointer with kinematic force
body.moveKinematic(pointerVector, undefined, deltaTime);
});
return (
Expand Down
Loading

0 comments on commit 909822b

Please sign in to comment.