/ Garbo
/ Garbo.cdr / mac / util / raytracr.sit / find.c.bin ![]() | < prev | next > |
MacBinary | 1989-09-14 | 2.1 KB | [TEXT/KAHL] |
Confidence | Program | Detection | Match Type | Support |
---|---|---|---|---|
66% | dexvert | AMOS Picture Packer (image/amosPicturePacker) | ext | Supported |
10% | dexvert | Jesper Olsen Module (music/jesperOlsen) | magic | Supported |
1% | dexvert | Debian floppy split (archive/debianFloppySplit) | ext | Unsupported |
1% | dexvert | Sound Images sound sample (audio/soundImagesSoundSample) | ext | Unsupported |
1% | dexvert | DESI-III drawing (image/desiIIIDrawing) | ext | Unsupported |
1% | dexvert | MS-DOS PMODE extender executable (executable/msdosPMODEExtenderExecutable) | ext | Unsupported |
1% | dexvert | Alien Trilogytextures (other/alienTrilogyTextures) | ext | Unsupported |
1% | dexvert | APT cache data (other/aptCacheData) | ext | Unsupported |
1% | dexvert | CorelTRACE configuration (other/corelTRACEConfiguration) | ext | Unsupported |
1% | dexvert | Dreamcast Disc (other/dreamcastDisc) | ext | Unsupported |
1% | dexvert | EST flat binary (other/estFlatBinary) | ext | Unsupported |
1% | dexvert | Finale Enigma Binary Format (other/finaleEnigmaBinaryFormat) | ext | Unsupported |
1% | dexvert | Sega Genesis/Megadrive/32x ROM (other/genesisROM) | ext | Unsupported |
1% | dexvert | Myth: The Fallen Lords game archive (other/mythTheFallenLordsGameArchive) | ext | Unsupported |
1% | dexvert | Sound Images Sound Driver (other/soundImagesSoundDriver) | ext | Unsupported |
1% | dexvert | Symantec/Norton Config (other/symantecNortonConfig) | ext | Unsupported |
1% | dexvert | Vectrex ROM (other/vectrexROM) | ext | Unsupported |
1% | dexvert | BIS raP encoded format (other/bisraPEncoded) | ext | Unsupported |
1% | dexvert | Pascal Script binary (other/pascalScriptBinary) | ext | Unsupported |
1% | dexvert | 7th Level game data archive (other/seventhLevelGameDataArchive) | ext | Unsupported |
1% | dexvert | MacBinary (archive/macBinary) | fallback | Supported |
1% | dexvert | Text File (text/txt) | fallback | Supported |
100% | file | MacBinary, Sun Nov 13 05:02:06 1988, modified Tue Nov 15 10:03:57 1988, creator Think C, type ASCII, 1959 bytes "find.c" | default (weak) | |
99% | file | data | default | |
49% | TrID | Macintosh plain text (MacBinary) | default | |
33% | TrID | TTComp archive compressed (bin-4K) | default (weak) | |
17% | TrID | MacBinary 1 | default (weak) | |
100% | lsar | MacBinary | default | |
100% | gt2 | MAC Bilddatei | default (weak) |
id metadata | |
---|---|
key | value |
macFileType | [TEXT] |
macFileCreator | [KAHL] |
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 06 66 69 6e 64 2e 63 | 00 00 00 00 00 00 00 00 |..find.c|........|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4b 41 48 | 4c 00 00 00 00 00 00 00 |.TEXTKAH|L.......|
|00000050| 00 00 00 00 00 07 a7 00 | 00 00 00 9f a3 0e 1e 9f |........|........|
|00000060| a5 f7 dd 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000080| 23 64 65 66 69 6e 65 20 | 5f 4d 43 36 38 38 38 31 |#define |_MC68881|
|00000090| 5f 0d 0d 23 69 6e 63 6c | 75 64 65 20 3c 6d 61 74 |_..#incl|ude <mat|
|000000a0| 68 2e 68 3e 0d 23 69 6e | 63 6c 75 64 65 20 22 72 |h.h>.#in|clude "r|
|000000b0| 74 64 2e 68 22 0d 23 69 | 6e 63 6c 75 64 65 20 22 |td.h".#i|nclude "|
|000000c0| 65 78 74 65 72 6e 2e 68 | 22 0d 23 69 6e 63 6c 75 |extern.h|".#inclu|
|000000d0| 64 65 20 22 6d 61 63 72 | 6f 73 2e 68 22 0d 0d 64 |de "macr|os.h"..d|
|000000e0| 6f 75 62 6c 65 20 20 66 | 69 6e 64 6f 20 28 6d 2c |ouble f|indo (m,|
|000000f0| 20 73 29 20 2f 2a 20 66 | 69 6e 64 73 20 77 68 65 | s) /* f|inds whe|
|00000100| 72 65 20 61 20 72 61 79 | 20 69 6e 73 69 64 65 20 |re a ray| inside |
|00000110| 74 68 65 20 62 61 6c 6c | 20 65 78 69 74 73 2e 20 |the ball| exits. |
|00000120| 2a 2f 0d 73 74 72 75 63 | 74 20 6d 61 74 20 2a 6d |*/.struc|t mat *m|
|00000130| 3b 0d 73 74 72 75 63 74 | 20 73 70 68 65 72 65 20 |;.struct| sphere |
|00000140| 20 2a 73 3b 0d 7b 0d 2f | 2a 20 66 6f 6f 70 73 20 | *s;.{./|* foops |
|00000150| 69 64 20 74 68 65 20 72 | 6f 74 61 74 65 64 20 70 |id the r|otated p|
|00000160| 6f 73 69 74 69 6f 6e 20 | 76 65 63 74 6f 72 2e 20 |osition |vector. |
|00000170| 2a 2f 0d 20 20 20 20 73 | 74 72 75 63 74 20 76 65 |*/. s|truct ve|
|00000180| 63 74 6f 72 20 20 20 66 | 6f 6f 70 73 3b 0d 20 20 |ctor f|oops;. |
|00000190| 20 20 64 6f 75 62 6c 65 | 20 20 74 3b 0d 20 20 20 | double| t;. |
|000001a0| 20 4d 54 56 20 28 66 6f | 6f 70 73 2c 20 28 2a 6d | MTV (fo|ops, (*m|
|000001b0| 29 2c 20 73 20 2d 3e 20 | 63 65 6e 74 29 3b 0d 2f |), s -> |cent);./|
|000001c0| 2a 20 73 65 65 20 69 66 | 20 69 74 20 68 69 74 73 |* see if| it hits|
|000001d0| 20 74 68 65 20 62 61 6c | 6c 20 28 69 74 20 62 65 | the bal|l (it be|
|000001e0| 74 74 65 72 29 2a 2f 0d | 20 20 20 20 74 20 3d 20 |tter)*/.| t = |
|000001f0| 73 20 2d 3e 20 72 61 64 | 20 2a 20 73 20 2d 3e 20 |s -> rad| * s -> |
|00000200| 72 61 64 20 2d 20 66 6f | 6f 70 73 2e 79 20 2a 20 |rad - fo|ops.y * |
|00000210| 66 6f 6f 70 73 2e 79 20 | 2d 20 66 6f 6f 70 73 2e |foops.y |- foops.|
|00000220| 7a 20 2a 20 66 6f 6f 70 | 73 2e 7a 3b 0d 20 20 20 |z * foop|s.z;. |
|00000230| 20 69 66 20 28 74 20 3e | 20 30 29 0d 09 74 20 3d | if (t >| 0)..t =|
|00000240| 20 66 6f 6f 70 73 2e 78 | 20 2b 20 73 71 72 74 20 | foops.x| + sqrt |
|00000250| 28 74 29 3b 0d 20 20 20 | 20 65 6c 73 65 0d 09 74 |(t);. | else..t|
|00000260| 20 3d 20 30 3b 0d 2f 2a | 20 72 65 74 75 72 6e 20 | = 0;./*| return |
|00000270| 68 6f 77 20 66 61 72 20 | 61 6c 6f 6e 67 20 74 68 |how far |along th|
|00000280| 65 20 72 61 79 20 79 6f | 75 20 77 65 72 65 20 77 |e ray yo|u were w|
|00000290| 68 65 6e 20 79 6f 75 20 | 68 69 74 20 2a 2f 0d 20 |hen you |hit */. |
|000002a0| 20 20 20 72 65 74 75 72 | 6e 20 28 74 29 3b 0d 7d | retur|n (t);.}|
|000002b0| 0d 0d 64 6f 75 62 6c 65 | 20 20 66 69 6e 64 20 28 |..double| find (|
|000002c0| 6d 2c 20 73 29 2f 2a 20 | 66 69 6e 64 73 20 77 68 |m, s)/* |finds wh|
|000002d0| 65 74 68 65 72 20 61 20 | 72 61 79 20 68 69 74 73 |ether a |ray hits|
|000002e0| 20 61 20 62 61 6c 6c 2a | 2f 0d 73 74 72 75 63 74 | a ball*|/.struct|
|000002f0| 20 6d 61 74 20 2a 6d 3b | 0d 73 74 72 75 63 74 20 | mat *m;|.struct |
|00000300| 73 70 68 65 72 65 20 20 | 2a 73 3b 0d 7b 0d 20 20 |sphere |*s;.{. |
|00000310| 20 20 73 74 72 75 63 74 | 20 76 65 63 74 6f 72 20 | struct| vector |
|00000320| 20 20 66 6f 6f 70 73 3b | 0d 20 20 20 20 64 6f 75 | foops;|. dou|
|00000330| 62 6c 65 20 20 74 3b 0d | 20 20 20 20 4d 54 56 20 |ble t;.| MTV |
|00000340| 28 66 6f 6f 70 73 2c 20 | 28 2a 6d 29 2c 20 73 20 |(foops, |(*m), s |
|00000350| 2d 3e 20 63 65 6e 74 29 | 3b 0d 20 20 20 20 74 20 |-> cent)|;. t |
|00000360| 3d 20 73 20 2d 3e 20 72 | 61 64 20 2a 20 73 20 2d |= s -> r|ad * s -|
|00000370| 3e 20 72 61 64 20 2d 20 | 66 6f 6f 70 73 2e 79 20 |> rad - |foops.y |
|00000380| 2a 20 66 6f 6f 70 73 2e | 79 20 2d 20 66 6f 6f 70 |* foops.|y - foop|
|00000390| 73 2e 7a 20 2a 20 66 6f | 6f 70 73 2e 7a 3b 0d 20 |s.z * fo|ops.z;. |
|000003a0| 20 20 20 69 66 20 28 74 | 20 3e 20 30 29 0d 09 74 | if (t| > 0)..t|
|000003b0| 20 3d 20 66 6f 6f 70 73 | 2e 78 20 2d 20 73 71 72 | = foops|.x - sqr|
|000003c0| 74 20 28 74 29 3b 0d 20 | 20 20 20 65 6c 73 65 0d |t (t);. | else.|
|000003d0| 09 74 20 3d 20 30 3b 0d | 20 20 20 20 72 65 74 75 |.t = 0;.| retu|
|000003e0| 72 6e 20 28 74 29 3b 0d | 7d 0d 0d 64 6f 75 62 6c |rn (t);.|}..doubl|
|000003f0| 65 20 20 66 69 6e 64 73 | 20 28 6d 2c 20 73 29 2f |e finds| (m, s)/|
|00000400| 2a 20 66 69 6e 64 73 20 | 69 66 20 61 20 62 61 6c |* finds |if a bal|
|00000410| 6c 20 69 73 20 62 65 74 | 77 65 65 6e 20 61 20 70 |l is bet|ween a p|
|00000420| 6f 69 6e 74 20 61 6e 64 | 20 61 20 0d 09 09 09 6c |oint and| a ....l|
|00000430| 69 67 68 74 73 6f 75 72 | 63 65 2e 20 52 65 74 75 |ightsour|ce. Retu|
|00000440| 72 6e 73 20 68 6f 77 20 | 6f 62 73 63 75 72 69 6e |rns how |obscurin|
|00000450| 67 20 74 68 65 20 62 61 | 6c 6c 20 69 73 20 2a 2f |g the ba|ll is */|
|00000460| 0d 73 74 72 75 63 74 20 | 6d 61 74 20 2a 6d 3b 0d |.struct |mat *m;.|
|00000470| 73 74 72 75 63 74 20 73 | 70 68 65 72 65 20 20 2a |struct s|phere *|
|00000480| 73 3b 0d 7b 0d 20 20 20 | 20 73 74 72 75 63 74 20 |s;.{. | struct |
|00000490| 76 65 63 74 6f 72 20 20 | 20 66 6f 6f 70 73 3b 0d |vector | foops;.|
|000004a0| 20 20 20 20 64 6f 75 62 | 6c 65 20 20 74 3b 0d 20 | doub|le t;. |
|000004b0| 20 20 20 4d 54 56 20 28 | 66 6f 6f 70 73 2c 20 28 | MTV (|foops, (|
|000004c0| 2a 6d 29 2c 20 73 20 2d | 3e 20 63 65 6e 74 29 3b |*m), s -|> cent);|
|000004d0| 0d 20 20 20 20 74 20 3d | 20 73 20 2d 3e 20 72 61 |. t =| s -> ra|
|000004e0| 64 20 2d 20 73 71 72 74 | 20 28 66 6f 6f 70 73 2e |d - sqrt| (foops.|
|000004f0| 79 20 2a 20 66 6f 6f 70 | 73 2e 79 20 2b 20 66 6f |y * foop|s.y + fo|
|00000500| 6f 70 73 2e 7a 20 2a 20 | 66 6f 6f 70 73 2e 7a 29 |ops.z * |foops.z)|
|00000510| 3b 0d 20 20 20 20 69 66 | 20 28 74 20 3e 20 30 29 |;. if| (t > 0)|
|00000520| 0d 09 74 20 3d 20 74 20 | 2f 20 66 6f 6f 70 73 2e |..t = t |/ foops.|
|00000530| 78 3b 0d 20 20 20 20 65 | 6c 73 65 0d 09 74 20 3d |x;. e|lse..t =|
|00000540| 20 30 3b 0d 20 20 20 20 | 72 65 74 75 72 6e 20 28 | 0;. |return (|
|00000550| 74 29 3b 0d 7d 0d 0d 0d | 0d 0d 64 6f 75 62 6c 65 |t);.}...|..double|
|00000560| 20 20 53 68 61 64 6f 77 | 20 28 70 29 2f 2a 20 66 | Shadow| (p)/* f|
|00000570| 69 6e 64 73 20 69 66 20 | 61 20 70 6f 69 6e 74 20 |inds if |a point |
|00000580| 69 73 20 69 6e 20 61 20 | 53 68 61 64 6f 77 2c 20 |is in a |Shadow, |
|00000590| 6f 72 20 69 66 20 69 74 | 20 69 73 20 6f 6e 20 65 |or if it| is on e|
|000005a0| 64 67 65 20 2a 2f 0d 73 | 74 72 75 63 74 20 76 65 |dge */.s|truct ve|
|000005b0| 63 74 6f 72 20 20 2a 70 | 3b 0d 7b 0d 20 20 20 20 |ctor *p|;.{. |
|000005c0| 73 74 72 75 63 74 20 6d | 61 74 20 20 74 72 61 6e |struct m|at tran|
|000005d0| 73 3b 0d 20 20 20 20 73 | 74 72 75 63 74 20 73 70 |s;. s|truct sp|
|000005e0| 68 65 72 65 20 20 20 73 | 73 3b 0d 20 20 20 20 73 |here s|s;. s|
|000005f0| 74 72 75 63 74 20 76 65 | 63 74 6f 72 20 20 20 64 |truct ve|ctor d|
|00000600| 3b 0d 20 20 20 20 69 6e | 74 20 20 20 20 20 63 2c |;. in|t c,|
|00000610| 0d 20 20 20 20 20 20 20 | 20 20 20 20 20 69 3b 0d |. | i;.|
|00000620| 20 20 20 20 64 6f 75 62 | 6c 65 20 20 6c 2c 0d 20 | doub|le l,. |
|00000630| 20 20 20 20 20 20 20 20 | 20 20 20 6b 2c 0d 20 20 | | k,. |
|00000640| 20 20 20 20 20 20 20 20 | 20 20 78 2c 0d 20 20 20 | | x,. |
|00000650| 20 20 20 20 20 20 20 20 | 20 79 2c 0d 20 20 20 20 | | y,. |
|00000660| 20 20 20 20 20 20 20 20 | 7a 2c 0d 20 20 20 20 20 | |z,. |
|00000670| 20 20 20 20 20 20 20 66 | 69 6e 64 73 20 28 29 3b | f|inds ();|
|00000680| 0d 20 20 20 20 6c 20 3d | 20 30 2e 30 3b 0d 20 20 |. l =| 0.0;. |
|00000690| 20 20 63 20 3d 20 2d 31 | 3b 0d 20 20 20 20 53 56 | c = -1|;. SV|
|000006a0| 20 28 64 2c 20 6c 73 2e | 63 65 6e 74 2c 20 28 2a | (d, ls.|cent, (*|
|000006b0| 70 29 29 3b 0d 20 20 20 | 20 64 2e 6c 20 3d 20 4c |p));. | d.l = L|
|000006c0| 45 4e 20 28 64 29 3b 0d | 20 20 20 20 64 2e 78 7a |EN (d);.| d.xz|
|000006d0| 6c 20 3d 20 58 5a 4c 20 | 28 64 29 3b 0d 20 20 20 |l = XZL |(d);. |
|000006e0| 20 6d 74 20 28 26 28 64 | 29 2c 20 26 74 72 61 6e | mt (&(d|), &tran|
|000006f0| 73 29 3b 0d 0d 20 20 20 | 20 66 6f 72 20 28 69 20 |s);.. | for (i |
|00000700| 3d 20 30 3b 20 69 20 3c | 20 6e 6f 62 3b 20 69 2b |= 0; i <| nob; i+|
|00000710| 2b 29 20 7b 0d 09 73 73 | 2e 72 61 64 20 3d 20 62 |+) {..ss|.rad = b|
|00000720| 6c 5b 69 5d 20 2d 3e 20 | 73 2e 72 61 64 3b 0d 09 |l[i] -> |s.rad;..|
|00000730| 53 56 20 28 73 73 2e 63 | 65 6e 74 2c 20 62 6c 5b |SV (ss.c|ent, bl[|
|00000740| 69 5d 20 2d 3e 20 73 2e | 63 65 6e 74 2c 20 28 2a |i] -> s.|cent, (*|
|00000750| 70 29 29 3b 0d 09 69 66 | 20 28 28 6b 20 3d 20 66 |p));..if| ((k = f|
|00000760| 69 6e 64 73 20 28 26 74 | 72 61 6e 73 2c 20 26 73 |inds (&t|rans, &s|
|00000770| 73 29 29 20 3e 20 6c 29 | 20 7b 0d 09 20 20 20 20 |s)) > l)| {.. |
|00000780| 63 20 3d 20 69 3b 0d 09 | 20 20 20 20 6c 20 3d 20 |c = i;..| l = |
|00000790| 6b 3b 0d 09 7d 0d 20 20 | 20 20 7d 0d 20 20 20 20 |k;..}. | }. |
|000007a0| 69 66 20 28 63 20 3d 3d | 20 2d 31 29 0d 09 6b 20 |if (c ==| -1)..k |
|000007b0| 3d 20 32 30 30 2e 30 3b | 0d 20 20 20 20 65 6c 73 |= 200.0;|. els|
|000007c0| 65 20 7b 0d 09 6b 20 3d | 20 31 2e 30 20 2d 20 6c |e {..k =| 1.0 - l|
|000007d0| 20 2f 20 28 28 6c 73 2e | 72 61 64 29 20 2f 20 28 | / ((ls.|rad) / (|
|000007e0| 64 2e 6c 29 29 3b 0d 09 | 69 66 20 28 6b 20 3c 20 |d.l));..|if (k < |
|000007f0| 30 2e 30 29 0d 09 20 20 | 20 20 6b 20 3d 20 30 2e |0.0).. | k = 0.|
|00000800| 30 3b 0d 09 6b 20 2a 3d | 20 32 30 30 2e 30 3b 0d |0;..k *=| 200.0;.|
|00000810| 20 20 20 20 7d 0d 20 20 | 20 20 72 65 74 75 72 6e | }. | return|
|00000820| 20 28 6b 29 3b 0d 7d 00 | 00 00 00 00 00 00 00 00 | (k);.}.|........|
|00000830| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000840| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000850| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000860| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000870| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+