void use_camshoot(edict_t *self, edict_t *other, edict_t *activator) { edict_t *player; edict_t *target; player = &g_edicts[1]; // Gotta be, since this is SP only if(!player->client) return; if(player->client->spycam) // already using camera return; target = camTrack(self); if(!target) return; target->owner = self; player->client->ps.stats[STAT_USEABLE] = 0; player->client->ps.stats[STAT_HINTTITLE] = 1; VectorClear (player->velocity); if (!(self->spawnflags & 1)) { target->child = CreateCamBullet(target, self); } player->client->spycam = target; player->client->monitor = self; camera_on(player); //player->client->ps.pmove.pm_time = 160>>3; // hold time //player->client->ps.pmove.pm_flags |= PMF_TIME_TELEPORT; if (self->spawnflags & 1) { //skip the bulletcam, go straight to the tracks. edict_t *nextTarget; nextTarget = NULL; nextTarget = G_Find(NULL,FOFS(targetname), self->target); if (!nextTarget) { camera_off(player); return; } FirePathTarget(nextTarget); WarpToNextPoint(target, nextTarget); } }
int main() { int i; GLOBJECT * shape; appInit(); sTick = 42000; camTrack(); drawModels(1); return 0; }
/* The tick is current time in milliseconds, width and height * are the image dimensions to be rendered. */ void appRender(long tick, int width, int height) { if (sStartTick == 0) sStartTick = tick; if (!gAppAlive) return; // Actual tick value is "blurred" a little bit. sTick = (sTick + tick - sStartTick) >> 1; // Terminate application after running through the demonstration once. if (sTick >= RUN_LENGTH) { gAppAlive = 0; return; } // Prepare OpenGL ES for rendering of the frame. prepareFrame(width, height); // Update the camera position and set the lookat. camTrack(); // Configure environment. configureLightAndMaterial(); // Draw the reflection by drawing models with negated Z-axis. glPushMatrix(); drawModels(-1); glPopMatrix(); // Blend the ground plane to the window. drawGroundPlane(); // Draw all the models normally. drawModels(1); // Draw fade quad over whole window (when changing cameras). drawFadeQuad(); }
void appRender(long tick, int width, int height) { if (sStartTick == 0) sStartTick = tick; if (!gAppAlive) return; sTick = (sTick + tick - sStartTick) >> 1; if (sTick >= RUN_LENGTH) { gAppAlive = 0; return; } prepareFrame(width, height); camTrack(); configureLightAndMaterial(); glPushMatrix(); drawModels(-1); glPopMatrix(); drawGroundPlane(); drawModels(1); drawFadeQuad(); }