Hello Me again,
I've tried to change one ligne of your code to have ball in place of the cube. I've replaced
by: let throwable = ModelEntity(mesh: .generateSphere(radius: 0.1), materials: [SimpleMaterial(color: .red, isMetallic: true)])
and what's funny is the ball not roll when are o the ground, or, to be clear, they roll really strange :(
other test is to use my ball I've in my scene :
{
Set_Entity_Params( entity: temp, mass: 0.70, friction: kBoules_Friction, rebond: 0.0005, ralentissement: 1, mode: .static)
temp.components.set( ImageBasedLightComponent(source: .single( environmentLight!)))
temp.components.set( ImageBasedLightReceiverComponent( imageBasedLight: temp))
temp.isEnabled = true
mLesBoules.append( temp)
temp.generateCollisionShapes(recursive: true)
}
{
entity.components.set( InputTargetComponent( ))// Permet d'etre saisisable à la main
entity.components.set( GroundingShadowComponent(castsShadow: true))
var spherePhysics = PhysicsBodyComponent( massProperties: .init(mass: mass), material: .generate(staticFriction: friction, dynamicFriction: friction, restitution: rebond), mode: mode)
spherePhysics.isRotationLocked = (x:false, y:false, z:false)
spherePhysics.isContinuousCollisionDetectionEnabled = false
spherePhysics.angularDamping = 0.9 // rotation de fin de mouvement (+ il roule moins longtemps)
spherePhysics.linearDamping = ralentissement // amortissement linéaire : Plus le chiffre est haut moins la boule part loin (comme si le terrain etait sablonneux)
entity.components.set( spherePhysics)
}
And all running pretty well, I can get my ball in hand, move it, but when I release it from my hand, it disappeared :(
Linear impulse it pretty the same than I've with your cubes. But, I don't know why my ball goes very very far of me, also if I make no move, just drop it in place..
I hope you could help me because I've consumed this day and I begun to be crazy 8o(
Cheers and thanks for your help !!!
Mathis