-
-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sleep problem's and margin #107
Comments
show some of your code please. no, there is no margin on a body, it's unnecessary since you can create your body a bit larger then your display game object so that it looks like there is margin. |
Hi mm no body.sleep don't work at start object should sleep but i see original rapier have same problem's cause by gravity |
const bdDesc = RigidBodyDesc.dynamic();
bdDesc.setCanSleep(true);
bdDesc.setTranslation(4, 0);
const coDesc = ColliderDesc.ball(.3);
const bd = context.world.createRigidBody(bdDesc);
const co = context.world.createCollider(coDesc, bd.handle);
let i = 0;
setInterval(function() {
if (i % 2) {
bd.sleep();
console.log("sleep");
}
else {
bd.wakeUp();
console.log("wakeup");
}
i++;
}, 100); and result: sleep.mp4(ball in grey means it's sleeping) so it just works normally. |
btw, set world's gravity as 0, the same result. it will blink normally. |
ah, i know what you mean now, you wanna make it sleeping when it's just created, right? @sebcrozet i think we need to add |
That’s correct, this needs to be added. |
yes cool |
2d & 3d used the shared code, so it was added for both. for collision, if you mean penetration, try enable CCD, and limit velocity etc. |
yes thank's i will release my phy engin soon |
Hi i can't set sleep at start ? work with gravity 0
body.sleep() don't work i guess ?
also what about margin ? are the shape have margin ?
The text was updated successfully, but these errors were encountered: