J'ai un cube avec un corps physique dynamique et un plan avec un corps physique cinématique.Lorsque je place un cube au-dessus du plan, il tombera sur le plan et un rebond est prévu.sceneKit corps physique dynamique tomber à travers le plancher
Le PROBLÈME est la suivante: lorsque le cube est petit ou léger, il suffit de passer par exemple plane.For, cube a 0,1 * 0,1 * 0,1 fin de travail, mais 0,05 * 0,05 * 0,05 sucks.In ce cas, je reçois toujours notification de contact avec le corps physique.
ceci est mon code pour créer la géométrie:
//cube
//when dimension is 0.1 everything is fine
float dimension = 0.05;
SCNBox *cube = [SCNBox boxWithWidth:dimension height:dimension length:dimension chamferRadius:0];
cube.materials = @[material];
SCNNode *node = [SCNNode nodeWithGeometry:cube];
node.physicsBody = [SCNPhysicsBody bodyWithType:SCNPhysicsBodyTypeDynamic shape:nil];
node.physicsBody.mass = 1;
node.physicsBody.categoryBitMask = phsicBodyCategoryCube;
node.physicsBody.collisionBitMask = phsicBodyCategoryPlane;
node.physicsBody.contactTestBitMask = phsicBodyCategoryPlane;
//plane
self.planeGeometry = [SCNBox boxWithWidth:100 height:0.01 length:100 chamferRadius:0
plane.physicsBody = [SCNPhysicsBody bodyWithType:SCNPhysicsBodyTypeKinematic
shape: [SCNPhysicsShape shapeWithGeometry:self.planeGeometry options:nil]];
plane.physicsBody.categoryBitMask = phsicBodyCategoryPlane;
plane.physicsBody.collisionBitMask = phsicBodyCategoryCube;
plane.physicsBody.contactTestBitMask = phsicBodyCategoryCube;
Avez-vous essayé de changer la valeur 'physicsWorld.timeStep'? –
NON, je ne l'ai pas changé. – ooOlly