mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2026-01-07 12:19:03 +00:00
3d::racing:: 3d racing (partial)
This commit is contained in:
17
racing.cpp
17
racing.cpp
@@ -426,19 +426,19 @@ void generate_track() {
|
||||
|
||||
for(cell *sc: track) {
|
||||
straight = calc_relative_matrix(sc, track[0], C0);
|
||||
if(straight[2][2] > 1e8) break;
|
||||
if(straight[DIM][DIM] > 1e8) break;
|
||||
}
|
||||
straight = rspintox(straight * C0);
|
||||
|
||||
ld& a = start_line_width;
|
||||
for(a=0; a<10; a += .1) {
|
||||
if(DIM == 2) for(a=0; a<10; a += .1) {
|
||||
hyperpoint h = straight * parabolic1(a) * C0;
|
||||
cell *at = s;
|
||||
virtualRebase(at, h, true);
|
||||
if(!rti_id.count(at) || get_info(at).from_track >= TWIDTH) break;
|
||||
}
|
||||
|
||||
for(ld cleaner=0; cleaner<a*.75; cleaner += .2) for(int dir=-1; dir<=1; dir+=2) {
|
||||
if(DIM == 2) for(ld cleaner=0; cleaner<a*.75; cleaner += .2) for(int dir=-1; dir<=1; dir+=2) {
|
||||
transmatrix T = straight * parabolic1(cleaner * dir);
|
||||
cell *at = s;
|
||||
virtualRebase(at, T, true);
|
||||
@@ -469,7 +469,10 @@ void generate_track() {
|
||||
// this is intentionally not hrand
|
||||
|
||||
for(int j=0; j<100; j++) {
|
||||
who->at = straight * parabolic1(start_line_width * (rand() % 20000 - 10000) / 40000) * spin(rand() % 360);
|
||||
if(DIM == 3)
|
||||
who->at = Id; // straight * cspin(0, 2, rand() % 360) * cspin(1, 2, rand() % 360);
|
||||
else
|
||||
who->at = straight * parabolic1(start_line_width * (rand() % 20000 - 10000) / 40000) * spin(rand() % 360);
|
||||
who->base = s;
|
||||
bool ok = true;
|
||||
for(const transmatrix& t: forbidden) if(hdist(t*C0, who->at * C0) < 10. / (j+10)) ok = false;
|
||||
@@ -638,6 +641,7 @@ int current_player;
|
||||
void set_view() {
|
||||
|
||||
if(race_start_tick == 0) race_start_tick = ticks + 5000;
|
||||
if(DIM == 3) return;
|
||||
|
||||
if(subscreen_split(set_view)) return;
|
||||
|
||||
@@ -1247,6 +1251,7 @@ void draw_ghost_state(ghost& ghost) {
|
||||
void drawStats() {
|
||||
|
||||
if(!racing::on) return;
|
||||
if(DIM == 3) return;
|
||||
|
||||
initquickqueue();
|
||||
|
||||
@@ -1272,13 +1277,13 @@ void drawStats() {
|
||||
|
||||
void markers() {
|
||||
if(!racing::on) return;
|
||||
if(guiding) for(int i=0; i<multi::players; i++) {
|
||||
if(guiding && DIM == 2) for(int i=0; i<multi::players; i++) {
|
||||
shmup::monster *m = shmup::pc[i];
|
||||
if(!m) continue;
|
||||
for(int j=0; j<5; j++)
|
||||
queueline(m->pat * xpush0(j), m->pat * xpush0(j+1), multi::scs[i].uicolor, 2);
|
||||
}
|
||||
if(racing::player_relative || racing::standard_centering) {
|
||||
if(racing::player_relative || racing::standard_centering || DIM == 3) {
|
||||
using namespace racing;
|
||||
cell *goal = NULL;
|
||||
for(cell *c: track) if(inscreenrange(c)) goal = c;
|
||||
|
||||
Reference in New Issue
Block a user