merge the new developmentbranch into the test branch #39

Closed
j23f0712 wants to merge 431 commits from development2 into dev/test
114 changed files with 3402 additions and 655 deletions
Showing only changes of commit 4430b37581 - Show all commits

View File

@@ -39,14 +39,15 @@ public DiceControl(AssetManager assetManager){
@Override
protected void controlUpdate(float tpf) {
float clampedTpf = Math.min(tpf, 0.05f); // Max 50 ms per frame
if (isRolling) {
if(!slerp) {
// Apply rotational velocity to the dice
spinWithAngularVelocity(tpf);
spinWithAngularVelocity(clampedTpf);
// Gradually reduce rotational velocity (simulate deceleration)
angularVelocity.subtractLocal(
angularVelocity.mult(deceleration * tpf)
angularVelocity.mult(deceleration * clampedTpf)
);
// Stop rolling when angular velocity is close to zero
@@ -55,7 +56,7 @@ protected void controlUpdate(float tpf) {
}
}
else {
timeElapsed += tpf * rollDuration;
timeElapsed += clampedTpf * rollDuration;
if (timeElapsed > 1.0f) timeElapsed = 1.0f;
@@ -71,7 +72,7 @@ protected void controlUpdate(float tpf) {
}
}
}else if(spin){
spinWithAngularVelocity(tpf);
spinWithAngularVelocity(clampedTpf);
}
}