ChrisOS Research ProjectOperating systems · language systems · graphics · machine emulation
DOCUMENTATION ARCHIVEMAIN BRANCH
ChrisOS/Source reference: GAMES/PHYS.CC

Source reference: GAMES/PHYS.CC

Deterministic source record. The complete textual file is reproduced below; this page does not replace architectural interpretation in the authored chapters.

File identity

Field Value
Path GAMES/PHYS.CC
Lines 34
Bytes 762
SHA-256 9d3f7ce3795b9ad7b2fa56dbd74e741c877468ec3c73357139975d160066825c
ChrisOS revision da3df29cb397932c43d32373871fb9380e688ade

Detected syntactic dependencies

Line Include
1 LIB/BODY.CC
2 LIB/CLIP.CC
3 LIB/ANIM.CC

Detected symbols

Line Symbol
5 main

Complete source

The following block is the complete textual file at the recorded revision. No lines are elided, abbreviated or paraphrased.

#include "LIB/BODY.CC"
#include "LIB/CLIP.CC"
#include "LIB/ANIM.CC"

void main() {
    float x;
    float y;
    float z;
    float vy;
    float ax;
    int frames;
    x = 0.0;
    y = 8.0;
    z = 0.0;
    vy = 0.0;
    viewport(320, 200);
    frames = 0;
    while (1) {
        if (key(1))
            return;
        vy = body_step_vy(y, vy, 0.05, -20.0, 1.0);
        y = body_step_y(y, vy, 0.05, -20.0, 1.0);
        ax = anim_eval1(0.0, 0.0, 1.0, 2.0, 0.5);
        clear(1);
        meshf(0, 8, 12, x, y, z, frames, 14);
        frames = frames + 2;
        if (frames > 359)
            frames = 0;
        wait(16);
        x = x + clip_aabb(0.0, 0.0, 0.0, 1.0, ax, 0.0, 0.0, 1.0);
        x = x + body_hit(x, y, z, 1.0, ax, 0.0, 0.0, 1.0);
    }
}

Role of this record

The atlas guarantees file-by-file traceability. Responsibility, invariants, ownership, concurrency, security, performance and subsystem interactions belong in authored chapters and must cite this file when applicable.

Document record ID: source-9d3f7ce3795b9ad7 Reviewed source: da3df29cb397 Class: generated-source-reference