mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-12-19 23:30:25 +00:00
3D:: animations; also changed PI/180 to degree, and enabled models in the menu
This commit is contained in:
parent
5d9518b9cf
commit
0f4146ac36
@ -380,10 +380,8 @@ void showDisplayMode() {
|
|||||||
dialog::addBoolItem(XLAT("paper model creator"), (false), 'n');
|
dialog::addBoolItem(XLAT("paper model creator"), (false), 'n');
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(DIM == 2)
|
|
||||||
dialog::addBoolItem(XLAT("models and projections"), pmodel, 'a');
|
dialog::addBoolItem(XLAT("models and projections"), pmodel, 'a');
|
||||||
|
|
||||||
if(DIM == 2)
|
|
||||||
dialog::addBoolItem(XLAT("animations/history"), anims::any_on(), 'A');
|
dialog::addBoolItem(XLAT("animations/history"), anims::any_on(), 'A');
|
||||||
// dialog::addBoolItem(XLAT("expansion"), viewdists, 'x');
|
// dialog::addBoolItem(XLAT("expansion"), viewdists, 'x');
|
||||||
|
|
||||||
|
@ -479,6 +479,7 @@ enum eMovementAnimation {
|
|||||||
eMovementAnimation ma;
|
eMovementAnimation ma;
|
||||||
|
|
||||||
ld shift_angle, movement_angle;
|
ld shift_angle, movement_angle;
|
||||||
|
ld normal_angle = 90;
|
||||||
ld period = 10000;
|
ld period = 10000;
|
||||||
int noframes = 30;
|
int noframes = 30;
|
||||||
ld cycle_length = 2 * M_PI;
|
ld cycle_length = 2 * M_PI;
|
||||||
@ -595,19 +596,31 @@ void apply() {
|
|||||||
fullcenter(); View = spin(rand() % 1000) * View;
|
fullcenter(); View = spin(rand() % 1000) * View;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
View = spin(movement_angle * M_PI / 180) * ypush(shift_angle * M_PI / 180) * xpush(cycle_length * t / period) * ypush(-shift_angle * M_PI / 180) *
|
View = cspin(0, DIM-1, movement_angle * degree) * ypush(shift_angle * degree) * xpush(cycle_length * t / period) * ypush(-shift_angle * degree) *
|
||||||
spin(-movement_angle * M_PI / 180) * View;
|
cspin(0, DIM-1, -movement_angle * degree) * View;
|
||||||
moved();
|
moved();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case maRotation:
|
case maRotation:
|
||||||
|
if(DIM == 3) {
|
||||||
|
View = spin(-movement_angle * degree) * View;
|
||||||
|
View = cspin(1, 2, normal_angle * degree) * View;
|
||||||
|
}
|
||||||
View = spin(2 * M_PI * t / period) * View;
|
View = spin(2 * M_PI * t / period) * View;
|
||||||
|
if(DIM == 3) {
|
||||||
|
View = cspin(2, 1, normal_angle * degree) * View;
|
||||||
|
View = spin(movement_angle * degree) * View;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
#if CAP_BT
|
#if CAP_BT
|
||||||
case maParabolic:
|
case maParabolic:
|
||||||
reflect_view();
|
reflect_view();
|
||||||
View = spin(movement_angle * M_PI / 180) * ypush(shift_angle * M_PI / 180) * binary::parabolic(parabolic_length * t / period) * ypush(-shift_angle * M_PI / 180) *
|
View = ypush(-shift_angle * degree) * spin(-movement_angle * degree) * View;
|
||||||
spin(-movement_angle * M_PI / 180) * View;
|
if(DIM == 2)
|
||||||
|
View = binary::parabolic(parabolic_length * t / period) * View;
|
||||||
|
else
|
||||||
|
View = binary::parabolic3(parabolic_length * t / period, 0) * View;
|
||||||
|
View = spin(movement_angle * degree) * ypush(shift_angle * degree) * View;
|
||||||
moved();
|
moved();
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
@ -636,9 +649,9 @@ void apply() {
|
|||||||
#if CAP_RUG
|
#if CAP_RUG
|
||||||
if(rug::rugged) {
|
if(rug::rugged) {
|
||||||
if(rug_rotation1) {
|
if(rug_rotation1) {
|
||||||
rug::apply_rotation(rotmatrix(rug_angle * M_PI / 180, 1, 2));
|
rug::apply_rotation(rotmatrix(rug_angle * degree, 1, 2));
|
||||||
rug::apply_rotation(rotmatrix(rug_rotation1 * 2 * M_PI * t / period, 0, 2));
|
rug::apply_rotation(rotmatrix(rug_rotation1 * 2 * M_PI * t / period, 0, 2));
|
||||||
rug::apply_rotation(rotmatrix(-rug_angle * M_PI / 180, 1, 2));
|
rug::apply_rotation(rotmatrix(-rug_angle * degree, 1, 2));
|
||||||
}
|
}
|
||||||
if(rug_rotation2) {
|
if(rug_rotation2) {
|
||||||
rug::apply_rotation(rug::currentrot * rotmatrix(rug_rotation2 * 2 * M_PI * t / period, 0, 1) * inverse(rug::currentrot));
|
rug::apply_rotation(rug::currentrot * rotmatrix(rug_rotation2 * 2 * M_PI * t / period, 0, 1) * inverse(rug::currentrot));
|
||||||
@ -866,6 +879,21 @@ void show() {
|
|||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case maRotation:
|
||||||
|
if(DIM == 3) {
|
||||||
|
dialog::addSelItem(XLAT("angle to screen normal"), fts(normal_angle) + "°", 's');
|
||||||
|
dialog::add_action([] () {
|
||||||
|
dialog::editNumber(normal_angle, 0, 360, 15, 0, XLAT("angle to screen normal"), "");
|
||||||
|
});
|
||||||
|
dialog::addSelItem(XLAT("movement angle"), fts(movement_angle) + "°", 'm');
|
||||||
|
dialog::add_action([] () {
|
||||||
|
dialog::editNumber(movement_angle, 0, 360, 15, 0, XLAT("movement angle"), "");
|
||||||
|
});
|
||||||
|
dialog::addBreak(100);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
dialog::addBreak(300);
|
||||||
|
break;
|
||||||
default: {
|
default: {
|
||||||
dialog::addBreak(300);
|
dialog::addBreak(300);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user