Skip to content

Instantly share code, notes, and snippets.

@Franckapik
Created June 19, 2020 18:55
Show Gist options
  • Save Franckapik/0540c44ca05e07ae5573178ff5eb6793 to your computer and use it in GitHub Desktop.
Save Franckapik/0540c44ca05e07ae5573178ff5eb6793 to your computer and use it in GitHub Desktop.
const [wheelShape, wheelApi] = useSphere(() => ({
radius: 1.2,
}));
const [chassisShape, chassisApi] = useBox(() => ({
args: [5, 2, 0.5],
mass: 1,
}));
const zero = [0, 0, 0];
const leftAxis = [0,1,0]
const rightAxis = [0,-1,0]
const rightFrontAxis = [0,-1,0]
const leftFrontAxis = [0,1,0]
const cont = useHingeConstraint(()=> ( {
bodyA: chassisShape,
bodyB: wheelShape,
optns: {
pivotA: [5,5,0],
axisA: leftFrontAxis,
pivotB:zero,
axisB:leftAxis
}}))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment