Skip to content

Commit 9a4929a

Browse files
authored
decomp3: some engine files (#3319)
- `vector-h` - `gravity-h` - `bounding-box-h` - `matrix-h` - `quaternion-h` - `euler-h` - `transform-h` - `geometry-h` - `trigonometry-h` - `transformq-h` - `bounding-box` - `matrix` - `matrix-compose` - `transform` - `quaternion` - `euler` - `trigonometry` Not a whole lot of changes, just a couple of new functions and one new file (`matrix-compose`).
1 parent 25c74f1 commit 9a4929a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+14865
-1018
lines changed

decompiler/config/jak3/all-types.gc

Lines changed: 929 additions & 711 deletions
Large diffs are not rendered by default.

decompiler/config/jak3/ntsc_v1/inputs.jsonc

Lines changed: 273 additions & 273 deletions
Large diffs are not rendered by default.
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
1-
{}
1+
{
2+
"math": [
3+
["L108", "(pointer float)", 32],
4+
["L109", "(pointer float)", 32]
5+
]
6+
}
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
{}
1+
{
2+
"quaternion-smooth-seek!": [[16, "quaternion"]],
3+
"eul->matrix": [[16, "vector"]]
4+
}

decompiler/config/jak3/ntsc_v1/type_casts.jsonc

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,24 @@
3333
"(method 0 process)": [
3434
// [11, "a0", "int"],
3535
// [[12, 45], "v0", "process"]
36+
],
37+
"logf": [
38+
[12, "f0", "float"],
39+
[12, "f1", "float"],
40+
[19, "f0", "float"],
41+
[19, "f1", "float"]
42+
],
43+
"log2f": [
44+
[12, "f0", "float"],
45+
[12, "f1", "float"],
46+
[19, "f0", "float"],
47+
[19, "f1", "float"]
48+
],
49+
"cube-root": [
50+
[17, "f0", "float"],
51+
[17, "f1", "float"],
52+
[18, "f0", "float"],
53+
[18, "f1", "float"],
54+
[[23, 32], "f0", "float"]
3655
]
3756
}
Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,28 @@
1-
{}
1+
{
2+
"matrix-transpose!": {
3+
"args": [
4+
"dst",
5+
"src"
6+
]
7+
},
8+
"matrix-axis-sin-cos!": {
9+
"args": [
10+
"dst",
11+
"axis",
12+
"s",
13+
"c"
14+
]
15+
},
16+
"vector-rad<-vector-deg/2!": {
17+
"args": [
18+
"out",
19+
"in"
20+
]
21+
},
22+
"vector-rad<-vector-deg!": {
23+
"args": [
24+
"out",
25+
"in"
26+
]
27+
}
28+
}

goal_src/jak3/build/all_objs.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
["transformq-h", "transformq-h", 5, ["GAME"], "engine/math"],
2323
["bounding-box", "bounding-box", 5, ["GAME"], "engine/geometry"],
2424
["matrix", "matrix", 5, ["GAME"], "engine/math"],
25-
["matrix-compose", "matrix-compose", 5, ["GAME"], "engine/common-obs"],
25+
["matrix-compose", "matrix-compose", 5, ["GAME"], "engine/math"],
2626
["transform", "transform", 5, ["GAME"], "engine/math"],
2727
["quaternion", "quaternion", 5, ["GAME"], "engine/math"],
2828
["euler", "euler", 5, ["GAME"], "engine/math"],

goal_src/jak3/engine/common-obs/matrix-compose.gc

Lines changed: 0 additions & 9 deletions
This file was deleted.

goal_src/jak3/engine/geometry/bounding-box-h.gc

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,52 @@
77

88
;; DECOMP BEGINS
99

10+
(deftype bounding-box (structure)
11+
((min vector :inline)
12+
(max vector :inline)
13+
)
14+
(:methods
15+
(add-spheres! (_type_ (inline-array sphere) int) int)
16+
(add-box! (_type_ bounding-box) int)
17+
(add-point! (_type_ vector) none)
18+
(intersects-line-segment? (_type_ vector vector) symbol)
19+
(set-from-point-offset! (_type_ vector vector) none)
20+
(set-from-point-offset-pad! (_type_ vector vector float) int)
21+
(set-to-point! (_type_ vector) none)
22+
(set-from-sphere! (_type_ sphere) none)
23+
(set-from-spheres! (_type_ (inline-array sphere) int) int)
24+
(get-bounding-sphere (_type_ vector) vector)
25+
(inside-xyz? (bounding-box vector) symbol)
26+
(inside-xz? (bounding-box vector) symbol)
27+
)
28+
)
29+
30+
31+
(deftype bounding-box2 (structure)
32+
((min vector2 :inline)
33+
(max vector2 :inline)
34+
)
35+
)
36+
37+
38+
(deftype bounding-box4w (structure)
39+
((min vector4w :inline)
40+
(max vector4w :inline)
41+
)
42+
)
43+
44+
45+
(deftype bounding-box-both (structure)
46+
((box bounding-box :inline)
47+
(box4w bounding-box4w :inline)
48+
)
49+
)
50+
51+
52+
(deftype bounding-box-array (inline-array-class)
53+
((data bounding-box :dynamic)
54+
)
55+
)
56+
57+
58+
(set! (-> bounding-box-array heap-base) (the-as uint 32))

0 commit comments

Comments
 (0)