Types
collide-cache: basicsource
Fields
type: type
num-tris: int32
num-tris-u32: uint32
num-prims: int32
num-prims-u32: uint32
ignore-mask: pat-surface
ignore-processes: process
collide-box: bounding-box
collide-box4w: bounding-box4w
collide-with: collide-spec
unused: uint32
prims: collide-cache-prim
tris: collide-cache-tri
Methods
debug-draw(obj: collide-cache) => nonesource
fill-and-probe-using-line-sphere(obj: collide-cache, arg0: collide-query) => floatsource
fill-and-probe-using-spheres(obj: collide-cache, arg0: collide-query) => symbolsource
fill-using-bounding-box(obj: collide-cache, arg0: collide-query) => nonesource
fill-using-line-sphere(obj: collide-cache, arg0: collide-query) => nonesource
fill-using-spheres(obj: collide-cache, arg0: collide-query) => nonesource
reset(obj: collide-cache) => nonesource
probe-using-line-sphere(obj: collide-cache, arg0: collide-query) => floatsource
probe-using-spheres: unknown
fill-from-bg(obj: collide-cache, arg0: function, arg1: function, arg2: collide-query) => nonesource
fill-from-fg-boxes(obj: collide-cache) => nonesource
fill-from-fg-line-sphere(obj: collide-cache, arg0: collide-query) => nonesource
fill-from-water(obj: collide-cache, arg0: water-control) => nonesource
collide-cache-method-22: unknown
collide-cache-method-23: unknown
collide-cache-method-24: unknown
collide-cache-method-25: unknown
collide-cache-prim: structuresource
Fields
prim-core: collide-prim-core
extra-quad: uint8
ccache: collide-cache
prim: collide-shape-prim
first-tri: uint16
num-tris: uint16
unused: uint8
world-sphere: vector
collide-as: collide-spec
action: collide-action
prim-type: prim-type
Methods
resolve-moving-sphere-tri: unknown
resolve-moving-sphere-sphere: unknown
collide-cache-tri: structuresource
Fields
vertex: vector
extra-quad: uint8
pat: pat-surface
collide-ptr: basic
prim-index: uint16
user16: uint16
user32: uint32
clear-flags: uint128
collide-list: structuresource
collide-list-item: structuresource
collide-puss-sphere: structuresource
collide-puss-work: structuresource
Fields
closest-pt: vector
tri-normal: vector
tri-bbox4w: bounding-box4w
spheres-bbox4w: bounding-box4w
spheres: collide-puss-sphere
Methods
collide-puss-work-method-9: unknown
collide-puss-work-method-10: unknown
Types
collide-puls-work: structuresource
lsmi-work: structuresource
Types
col-rend-filter: structuresource
Types
collide-edge-edge: structuresource
Fields
ignore: basic
etri: collide-edge-tri
vertex-ptr: inline-array
outward: vector
edge-vec-norm: vector
Methods
no-collision-at-edge(obj: collide-edge-edge, arg0: collide-edge-work, arg1: edge-grab-info) => symbolsource
collide-edge-hold-item: structuresource
Fields
next: collide-edge-hold-item
rating: float
split: int8
edge: collide-edge-edge
center-pt: vector
outward-pt: vector
collide-edge-hold-list: structuresource
Fields
num-allocs: uint32
num-attempts: uint32
head: collide-edge-hold-item
items: collide-edge-hold-item
attempts: qword
Methods
debug-draw(obj: collide-edge-hold-list) => objectsource
add-to-list!: unknown
collide-edge-spec: structuresource
Fields
split-dists: float
outward-offset: vector
flags: collide-edge-spec-flags
ignore-pat: pat-surface
max-dist-sqrd-to-outward-pt: float
max-dir-cosa-delta: float
max-dir-cosa-player: float
touching-segment: symbol
local-cache-fill-box: bounding-box
local-within-reach-box: bounding-box
local-player-spheres: sphere
local-player-hanging-spheres: sphere
local-player-leap-up-spheres: sphere
collide-edge-tri: structuresource
collide-edge-work: structuresource
Fields
ccache: collide-cache
cshape: collide-shape
num-verts: uint32
num-edges: uint32
num-tris: uint32
cache-fill-box: bounding-box
within-reach-box: bounding-box
within-reach-box4w: bounding-box4w
search-pt: vector
search-dir-vec: vector
world-player-spheres: sphere
world-player-hanging-spheres: sphere
world-player-leap-up-spheres: sphere
spec: collide-edge-spec
process: pointer
verts: vector
edges: collide-edge-edge
tris: collide-edge-tri
hold-list: collide-edge-hold-list
Methods
search-for-edges(obj: collide-edge-work, arg0: collide-edge-hold-list) => nonesource
debug-draw-edges(obj: collide-edge-work) => objectsource
debug-draw-tris(obj: collide-edge-work) => nonesource
debug-draw-sphere(obj: collide-edge-work) => nonesource
find-adjacent-edge(obj: collide-edge-work, arg0: collide-edge-hold-item, arg1: edge-grab-info) => nonesource
compute-center-point!(obj: collide-edge-work, arg0: collide-edge-edge, arg1: vector) => floatsource
get-best-hand-point(obj: collide-edge-work, arg0: vector, arg1: vector, arg2: int) => floatsource
find-grabbable-edges: unknown
find-grabbable-tris: unknown
should-add-to-list?: unknown
find-best-grab!: unknown
check-grab-for-collisions(obj: collide-edge-work, arg0: collide-edge-hold-item, arg1: edge-grab-info) => symbolsource
edge-grab-info: structuresource
Fields
world-vertex: vector
local-vertex: vector
status: uint64
actor-cshape-prim-offset: int32
actor-handle: handle
hanging-matrix: matrix
edge-vertex: vector
center-hold: vector
tri-vertex: vector
adjacent-edge-left-vertex: vector
adjacent-edge-right-vertex: vector
left-hand-hold: vector
right-hand-hold: vector
center-hold-old: vector
edge-tri-pat: uint32
found-edge?: symbol
pilot-edge-grab?: symbol
pilot-edge-grab: pilot-edge-grab-info
pilot-start-grab-pos: vector
pilot-grab-interp: float
Methods
edge-grab-info-method-9: unknown
debug-draw(obj: edge-grab-info) => nonesource
Variables
Types
faei-stack-vars: structuresource
pbhp-stack-vars: structuresource
Variables
Types
collide-frag-mesh: basicsource
collide-fragment: drawablesource
drawable-inline-array-collide-fragment: drawable-inline-arraysource
drawable-tree-collide-fragment: drawable-treesource
Expand description
This file contains the primitive intersection functions used for collision.
Most take a description of primitive and a "probe"
The probe has an origin and a direction. The length of the direction vector is the length
of the probe.
Generally, collision functions will return the fraction of the probe to reach the primitive.
For example, if the probe is 5.0 long, and hits the primitive 2.0 away from the probe origin,
the return value (u) would be 0.4.
If (u) would be > 1.0, then it counts as "not intersecting" (object too far away)
If (u) would be < 0.0, then it counts as "not intersecting" (object behind probe)
If there's a miss, return COLLISION_MISS, a large negative number.
If we are inside of the primitive, return 0.0
Most take a description of primitive and a "probe"
The probe has an origin and a direction. The length of the direction vector is the length
of the probe.
Generally, collision functions will return the fraction of the probe to reach the primitive.
For example, if the probe is 5.0 long, and hits the primitive 2.0 away from the probe origin,
the return value (u) would be 0.4.
If (u) would be > 1.0, then it counts as "not intersecting" (object too far away)
If (u) would be < 0.0, then it counts as "not intersecting" (object behind probe)
If there's a miss, return COLLISION_MISS, a large negative number.
If we are inside of the primitive, return 0.0
moving-sphere-sphere-intersect(arg0: vector, arg1: vector, arg2: vector, arg3: vector) => floatsource
pc-port-raw-ray-sphere-implementation(rad: float, vf1-val: vector, vf2-val: vector) => floatsource
This is one of the main primitives for collision.
Assumes a sphere of radius rad is at the origin.
Handles:
- miss (return MISS)
- behind (return MISS)
- too far away (return MISS)
- inside (return 0)
Assumes a sphere of radius rad is at the origin.
Handles:
- miss (return MISS)
- behind (return MISS)
- too far away (return MISS)
- inside (return 0)
raw-ray-sphere-intersect(arg0: float) => floatsource
DANGER: this function takes two arguments by vf registers.
As a result, it doesn't work properly in OpenGOAL. See the functions below.
As a result, it doesn't work properly in OpenGOAL. See the functions below.
ray-circle-intersect(ray-origin: vector, ray-dir: vector, circle-origin: vector, radius: float) => floatsource
Intersect ray with circle. Circle is on the y plane and this throws out the y components
of ray-origin, circle-origin, and ray-dir
of ray-origin, circle-origin, and ray-dir
ray-cylinder-intersect(ray-origin: vector, ray-dir: vector, cyl-origin: vector, cyl-axis: vector, cyl-rad: float, cyl-len: float, pt-out: vector) => floatsource
Intersect with a cylinder.
Currently this is untested.
Currently this is untested.
ray-plane-intersect(arg0: vector, arg1: vector, arg2: vector, arg3: vector, arg4: vector, arg5: vector, arg6: vector) => floatsource
Unused.
ray-sphere-intersect(ray-origin: vector, ray-dir: vector, sph-origin: vector, radius: float) => floatsource
Intersect a ray and sphere. Will return 0 if you are in the sphere, -huge number if you don't hit it.
Returns the length of the ray to the first intersection.
Returns the length of the ray to the first intersection.
Variables
COLLISION_MISS: unknownsource
Types
collide-query: structuresource
Fields
best-other-tri: collide-tri-result
best-my-tri: collide-tri-result
ignore-processes: process-tree
ignore-process0: process-tree
ignore-process1: process-tree
ignore-pat: pat-surface
ignore-pat-s32: int32
collide-with: collide-spec
collide-with-s32: int32
overlay-params: uint32
bbox: bounding-box
bbox4w: bounding-box4w
bsphere: sphere
start-pos: vector
move-dist: vector
rlength: vector
exit-planes: plane
radius: float
inv-mat: matrix
spheres: inline-array
num-spheres: uint32
solid-only: symbol
best-dist: float
best-other-prim: collide-shape-prim
best-my-prim: collide-shape-prim
move-vec: vector
best-u: float
action-mask: collide-action
local-box4w: bounding-box4w
search-box: bounding-box4w
search-vector: vector4w
instance-mat: matrix
instance-ptr: basic
x-addr: uint32
x-step: uint32
y-addr: uint32
y-step: uint32
z-addr: uint32
z-step: uint32
Variables
*collide-test-flag*: symbolsource
Types
collide-mesh: basicsource
Fields
type: type
joint-id: int32
num-tris: uint32
num-verts: uint32
vertex-data: inline-array
tris: collide-mesh-tri
Methods
debug-draw-tris(obj: collide-mesh, arg0: process-drawable, arg1: int) => nonesource
overlap-test(obj: collide-mesh, arg0: collide-mesh-cache-tri, arg1: vector) => symbolsource
should-push-away-test(obj: collide-mesh, arg0: collide-mesh-cache-tri, arg1: collide-tri-result, arg2: vector, arg3: float) => floatsource
sphere-on-platform-test: unknown
unpack-mesh-to-cache!(obj: collide-mesh, arg0: inline-array, arg1: matrix) => nonesource
Unpack mesh and store in cache.
Transform triangles, computes normals and bbox.
Transform triangles, computes normals and bbox.
collide-mesh-math-1: unknown
collide-mesh-math-2: unknown
collide-mesh-cache: basicsource
Fields
type: type
used-size: uint32
max-size: uint32
id: uint32
data: uint8
Methods
populate-for-prim-mesh(obj: collide-mesh-cache, arg0: collide-shape-prim-mesh) => collide-mesh-cache-entrysource
Populate the mesh cache for the given prim-mesh.
Will reuse existing data only if the transform and object are the same.
Will reuse existing data only if the transform and object are the same.
is-id?(obj: collide-mesh-cache, arg0: int) => symbolsource
next-id!(obj: collide-mesh-cache) => uintsource
Reset all used entries in the cache and increment the id.
If the id is zero, set it to 1
If the id is zero, set it to 1
allocate!(obj: collide-mesh-cache, arg0: int) => collide-mesh-cache-entrysource
Allocate room in the collide-mesh-cache for an unpacked mesh with arg0 tris.
collide-mesh-cache-entry: structuresource
collide-mesh-cache-tri: structuresource
collide-mesh-tri: structuresource
collide-tri-result: structuresource
Expand description
note: this file has patched functions
this file has functions for foreground mesh collision functions. This is for stuff like jak being on a platform, or a
platform pushing jak away.
The "collide-mesh" is the foreground collision mesh type. These can be used as part of a collide-shape.
These can be added to the normal "collide-cache" and work with the most common collision queries.
However, there are a few special case collision queries that use a separate collide-mesh-cache.
The intented use is something like this:
- a mesh is unpacked to the collide-mesh-cache
- primitive vs. mesh tests are done using the unpacked data, reusing the data.
This collide-mesh-cache is limited compared to the real collide cache - this can only hold
a single mesh, so it's limited to tests like single foreground mesh vs. sphere.
Another limitation is that triangles don't have per-tri pat info.
this file has functions for foreground mesh collision functions. This is for stuff like jak being on a platform, or a
platform pushing jak away.
The "collide-mesh" is the foreground collision mesh type. These can be used as part of a collide-shape.
These can be added to the normal "collide-cache" and work with the most common collision queries.
However, there are a few special case collision queries that use a separate collide-mesh-cache.
The intented use is something like this:
- a mesh is unpacked to the collide-mesh-cache
- primitive vs. mesh tests are done using the unpacked data, reusing the data.
This collide-mesh-cache is limited compared to the real collide cache - this can only hold
a single mesh, so it's limited to tests like single foreground mesh vs. sphere.
Another limitation is that triangles don't have per-tri pat info.
oot-work: structuresource
sopt-work: structuresource
spat-work: structuresource
Expand description
this file is unused in jak 2.
a number of functions require a bunch of annoying casts/mips2c stuff, but are unused.
a number of functions require a bunch of annoying casts/mips2c stuff, but are unused.
collide-probe-stack: structuresource
Fields
data: collide-probe-stack-elem
Functions
creates-new-method?(arg0: type, arg1: int) => symbolsource
describe-methods(arg0: type) => symbolsource
interpolate(arg0: float, arg1: float, arg2: float, arg3: float, arg4: float) => floatsource
misty-ambush-height(arg0: vector) => floatsource
misty-ambush-height-probe(arg0: vector, arg1: float) => floatsource
overrides-parent-method?(arg0: type, arg1: int) => symbolsource
pke-collide-test() => nonesource
probe-traverse-collide-fragment(arg0: drawable-tree-collide-fragment, arg1: int) => nonesource
probe-traverse-draw-node(arg0: draw-node, arg1: int) => nonesource
probe-traverse-inline-array-node(arg0: drawable-inline-array-node, arg1: int) => nonesource
Variables
const collide-vu0-block: vu-functionsource
Types
collide-prim-core: structuresource
collide-rider: structuresource
collide-rider-pool: basicsource
Fields
type: type
alloc-count: int32
riders: collide-rider
Methods
add-rider(obj: collide-rider-pool, arg0: handle) => collide-ridersource
prepare(obj: collide-rider-pool) => nonesource
Gets this pool ready to be used to allow allocations. This should be called once at the start of every frame.
collide-shape: trsqvsource
Fields
type: type
trans: vector
rot: vector
scale: vector
quat: quaternion
pause-adjust-distance: meters
nav-radius: meters
transv: vector
rotv: vector
scalev: vector
dir-targ: quaternion
angle-change-time: time-frame
old-y-angle-diff: float
actor-hash-index: int16
process: process-drawable
max-iteration-count: uint8
nav-flags: nav-flags
total-prims: uint8
num-riders: uint8
pat-ignore-mask: pat-surface
event-self: symbol
event-other: symbol
root-prim: collide-shape-prim
riders: inline-array
penetrate-using: penetrate
penetrated-by: penetrate
backup-collide-as: collide-spec
backup-collide-with: collide-spec
event-priority: uint8
rider-max-momentum: float
Methods
move-by-vector!(obj: collide-shape, arg0: vector) => nonesource
Move everything by a vector.
move-to-point!(obj: collide-shape, arg0: vector) => nonesource
Move root to a point.
debug-draw(obj: collide-shape) => nonesource
fill-cache-for-shape(obj: collide-shape, arg0: float, arg1: collide-query) => nonesource
Fill the collide cache for a collide-shape by buliding a bounding box and filling from that.
fill-cache-integrate-and-collide(obj: collide-shape, arg0: vector, arg1: collide-query, arg2: meters) => nonesource
Helper to fill the collide cache and call integrate-and-collide.
find-prim-by-id(obj: collide-shape, arg0: uint) => collide-shape-primsource
find-prim-by-id-logtest(obj: collide-shape, arg0: uint) => collide-shape-primsource
detect-riders!(obj: collide-shape) => symbolsource
build-bounding-box-for-shape(obj: collide-shape, arg0: bounding-box, arg1: float, arg2: collide-spec) => symbolsource
integrate-and-collide!(obj: collide-shape, arg0: vector) => nonesource
find-collision-meshes(obj: collide-shape) => nonesource
Find collision meshes for our collide prims.
The collide shape system is built in code, so this function should be called
to actually find the matching meshes.
The collide shape system is built in code, so this function should be called
to actually find the matching meshes.
on-platform(obj: collide-shape, arg0: collide-shape, arg1: collide-query) => symbolsource
find-overlapping-shapes(obj: collide-shape, arg0: overlaps-others-params) => symbolsource
shove-to-closest-point-on-path(obj: collide-shape, arg0: attack-info, arg1: float) => vectorsource
should-push-away(obj: collide-shape, other: collide-shape, cquery: collide-query) => symbolsource
Should this shape push away the other? Most generic implementation.
pull-rider!(obj: collide-shape, arg0: pull-rider-info) => nonesource
pull-riders!(obj: collide-shape) => symbolsource
do-push-aways(obj: collide-shape) => collide-specsource
Push away things.
update-transforms(obj: collide-shape) => nonesource
Update collisision transforms.
set-collide-with!(obj: collide-shape, arg0: collide-spec) => nonesource
Set the collide with field of everything.
set-collide-as!(obj: collide-shape, arg0: collide-spec) => nonesource
Set the collide as field of everything
modify-collide-as!(obj: collide-shape, arg0: int, arg1: collide-spec, arg2: collide-spec) => nonesource
send-shoves(obj: collide-shape, arg0: process, arg1: touching-shapes-entry, arg2: float, arg3: float, arg4: float) => symbolsource
above-ground?(obj: collide-shape, arg0: collide-query, arg1: vector, arg2: collide-spec, arg3: float, arg4: float, arg5: float) => symbolsource
water-info-init!(obj: collide-shape, arg0: water-info, arg1: collide-action) => water-infosource
Initialize a water-info with the currently loaded regions.
iterate-prims(obj: collide-shape, arg0: function) => nonesource
Call the given function for each prim.
pusher-init(obj: collide-shape) => nonesource
Initialize a collide-shape as a pusher and move it to the pusher pool.
collide-shape-moving: collide-shapesource
Fields
type: type
trans: vector
rot: vector
scale: vector
quat: quaternion
pause-adjust-distance: meters
nav-radius: meters
transv: vector
rotv: vector
scalev: vector
dir-targ: quaternion
angle-change-time: time-frame
old-y-angle-diff: float
actor-hash-index: int16
process: process-drawable
max-iteration-count: uint8
nav-flags: nav-flags
total-prims: uint8
num-riders: uint8
pat-ignore-mask: pat-surface
event-self: symbol
event-other: symbol
root-prim: collide-shape-prim
riders: inline-array
penetrate-using: penetrate
penetrated-by: penetrate
backup-collide-as: collide-spec
backup-collide-with: collide-spec
event-priority: uint8
rider-max-momentum: float
rider-time: time-frame
rider-last-move: vector
trans-old: vector
trans-old-old: vector
trans-old-old-old: vector
poly-pat: pat-surface
cur-pat: pat-surface
ground-pat: pat-surface
status: collide-status
old-status: collide-status
prev-status: collide-status
reaction-flag: cshape-reaction-flags
reaction: function
no-reaction: function
local-normal: vector
surface-normal: vector
poly-normal: vector
ground-poly-normal: vector
gspot-pos: vector
gspot-normal: vector
grount-touch-point: vector
ground-impact-vel: meters
surface-angle: float
poly-angle: float
touch-angle: float
coverage: float
dynam: dynamics
surf: surface
Methods
find-ground(obj: collide-shape-moving, arg0: collide-query, arg1: collide-spec, arg2: float, arg3: float, arg4: float) => symbolsource
Find the ground, return #t if we found it, and fill out gspot in the collide-query.
react-to-pat!(obj: collide-shape-moving, arg0: pat-surface) => intsource
React to colliding with the given 'pat'.
integrate-no-collide!(obj: collide-shape-moving, arg0: vector) => nonesource
Move, ignoring all collision.
integrate-for-enemy-no-mtg(obj: collide-shape-moving, arg0: vector, arg1: overlaps-others-params) => symbolsource
Simpler move for enemy, with no moving to ground. Will just stop if the move collides.
move-above-ground(obj: collide-shape-moving, arg0: vector, arg1: move-above-ground-params) => nonesource
Move at the given velocity, while not going through the ground
move-to-ground(obj: collide-shape-moving, arg0: float, arg1: float, arg2: symbol, arg3: collide-spec) => nonesource
Find the ground a move to it.
move-to-ground-point(obj: collide-shape-moving, arg0: vector, arg1: vector, arg2: vector) => nonesource
Move to point, and treat as ground.
compute-acc-due-to-gravity(obj: collide-shape-moving, arg0: vector, arg1: float) => vectorsource
Adjust the velocity from the acceleration of gravity.
collide-shape-moving-method-63(obj: collide-shape-moving, arg0: rigid-body, arg1: float) => nonesource
try-snap-to-surface(obj: collide-shape-moving, vel: vector, check-dist: float, amt: float, bounce-dist: float) => symbolsource
Strange function to try to find a surface and move to it.
Teleports a distance of check-dist, then moves back to the start point plus amt.
If this move hits something, moves to that surface, then an additional bounce-dist.
I have no idea what this is used for - it kinda seems like this is a hack to make sure that
projectiles that start inside something will hit that thing.
Teleports a distance of check-dist, then moves back to the start point plus amt.
If this move hits something, moves to that surface, then an additional bounce-dist.
I have no idea what this is used for - it kinda seems like this is a hack to make sure that
projectiles that start inside something will hit that thing.
fill-and-try-snap-to-surface(obj: collide-shape-moving, arg0: vector, arg1: float, arg2: float, arg3: float, arg4: collide-query) => symbolsource
Fill the collision cache and try to snap to a nearby surface.
step-collison!(obj: collide-shape-moving, arg0: vector, arg1: vector, arg2: float, arg3: int) => floatsource
Main function to move forward until we hit a single thing, then react.
collide-with-all-collide-cache-prims(obj: collide-shape-moving, arg0: matrix, arg1: collide-query) => nonesource
collide-shape-prim: basicsource
Fields
type: type
cshape: collide-shape
prim-id: uint32
transform-index: int8
unused2: int8
prim-core: collide-prim-core
local-sphere: vector
world-sphere: vector
collide-as: collide-spec
collide-with: collide-spec
action: collide-action
prim-type: int8
radius: float
specific: uint8
Methods
debug-draw(obj: collide-shape-prim) => nonesource
add-fg-prim-using-box(obj: collide-shape-prim, arg0: collide-cache) => nonesource
add-fg-prim-using-line-sphere(obj: collide-shape-prim, arg0: collide-cache, arg1: object) => nonesource
overlaps-others-test(obj: collide-shape-prim, arg0: overlaps-others-params, arg1: collide-shape-prim) => symbolsource
overlaps-others-group(obj: collide-shape-prim, arg0: overlaps-others-params, arg1: collide-shape-prim-group) => symbolsource
collide-shape-prim-method-14: unknown
collide-with-collide-cache-prim-mesh(obj: collide-shape-prim, arg0: collide-query, arg1: collide-cache-prim) => nonesource
collide-with-collide-cache-prim-sphere(obj: collide-shape-prim, arg0: collide-query, arg1: collide-cache-prim) => nonesource
on-platform-test(obj: collide-shape-prim, arg0: collide-shape-prim, arg1: collide-query, arg2: float) => nonesource
should-push-away-test(obj: collide-shape-prim, arg0: collide-shape-prim, arg1: collide-query) => nonesource
Most generic should-push-away-test - child prims are expected to override.
should-push-away-a-group-test(obj: collide-shape-prim, other: collide-shape-prim-group, cquery: collide-query) => nonesource
should-push-away-test anything vs. a group.
collide-shape-prim-group: collide-shape-primsource
Fields
type: type
cshape: collide-shape
prim-id: uint32
transform-index: int8
unused2: int8
prim-core: collide-prim-core
local-sphere: vector
world-sphere: vector
collide-as: collide-spec
collide-with: collide-spec
action: collide-action
prim-type: int8
radius: float
specific: uint8
num-children: uint8
num-alloc-children: uint8
child: inline-array
collide-shape-prim-mesh: collide-shape-primsource
Fields
type: type
cshape: collide-shape
prim-id: uint32
transform-index: int8
unused2: int8
prim-core: collide-prim-core
local-sphere: vector
world-sphere: vector
collide-as: collide-spec
collide-with: collide-spec
action: collide-action
prim-type: int8
radius: float
specific: uint8
mesh: collide-mesh
mesh-id: int32
mesh-cache-id: uint32
mesh-cache-entry: collide-mesh-cache-entry
collide-shape-prim-sphere: collide-shape-primsource
Fields
type: type
cshape: collide-shape
prim-id: uint32
transform-index: int8
unused2: int8
prim-core: collide-prim-core
local-sphere: vector
world-sphere: vector
collide-as: collide-spec
collide-with: collide-spec
action: collide-action
prim-type: int8
radius: float
specific: uint8
pat: pat-surface
nav-radius: float
move-above-ground-params: structuresource
Fields
gnd-collide-with: collide-spec
popup: float
dont-move-if-overlaps?: symbol
hover-if-no-ground?: symbol
overlaps-params: overlaps-others-params
new-pos: vector
old-gspot-pos: vector
old-gspot-normal: vector
pat: pat-surface
on-ground?: symbol
do-move?: symbol
overlaps-others-params: structuresource
Fields
options: overlaps-others-options
collide-with-filter: collide-spec
tlist: touching-list
filtered-root-collide-with: collide-spec
filtered-child-collide-with: collide-spec
filtered-other-collide-as: collide-spec
pull-rider-info: structuresource
Fields
rider: collide-rider
rider-cshape: collide-shape-moving
rider-delta-ry: float
rider-dest: vector
Variables
Expand description
## Pushers
"pushers" are things that push things out of the way. For example, if a platform hits jak, it pushes him out of the way.
Nothing can ever push back against a pusher - they move on some fixed path and cannot be disturbed.
these are done by pairs of collide-shape's, and don't involve the main collide-cache.
Using the main collide cache wouldn't really make sense because a pusher never interacts with the background
and there's just one check per pair per frame.
the do-push-aways function is what actually does all the tests for all the objects.
there's a "pusher-pool" to make all pushers run at the end of a frame.
the "should push away test" (SPAT) checks to see if the movement of a pusher should push away another collide shape.
it returns a triangle and normal direction to push in.
"pushers" are things that push things out of the way. For example, if a platform hits jak, it pushes him out of the way.
Nothing can ever push back against a pusher - they move on some fixed path and cannot be disturbed.
these are done by pairs of collide-shape's, and don't involve the main collide-cache.
Using the main collide cache wouldn't really make sense because a pusher never interacts with the background
and there's just one check per pair per frame.
the do-push-aways function is what actually does all the tests for all the objects.
there's a "pusher-pool" to make all pushers run at the end of a frame.
the "should push away test" (SPAT) checks to see if the movement of a pusher should push away another collide shape.
it returns a triangle and normal direction to push in.
do-push-aways-work: structuresource
Functions
collide-shape-draw-debug-marks() => nonesource
collide-shape-moving-angle-set!(arg0: collide-shape-moving, arg1: vector, arg2: vector) => nonesource
Update the angle parameters
cshape-reaction-default(arg0: control-info, arg1: collide-query, arg2: vector, arg3: vector) => collide-statussource
Default collision reaction. Bounce off of wall, react to things, etc.
cshape-reaction-just-move(arg0: control-info, arg1: collide-query, arg2: vector) => collide-statussource
Simple collision reaction. Just stop at the obstacle.
cshape-reaction-update-state(arg0: control-info, arg1: collide-query, arg2: vector) => nonesource
Common update for cshape reaction.
debug-report-col-stats() => intsource
find-ground-point(arg0: control-info, arg1: vector, arg2: float, arg3: float) => vectorsource
Find a safe ground point to bounce the player back to if they jump onto lava or similar.
target-attack-up(arg0: target, arg1: symbol, arg2: symbol) => nonesource
Send events to target in response to hitting a surface that launches you up.
Variables
*col-timer-enable*: symbolsource
Types
control-info: collide-shape-movingsource
Fields
type: type
trans: vector
rot: vector
scale: vector
quat: quaternion
pause-adjust-distance: meters
nav-radius: meters
transv: vector
rotv: vector
scalev: vector
dir-targ: quaternion
angle-change-time: time-frame
old-y-angle-diff: float
actor-hash-index: int16
process: process-drawable
max-iteration-count: uint8
nav-flags: nav-flags
total-prims: uint8
num-riders: uint8
pat-ignore-mask: pat-surface
event-self: symbol
event-other: symbol
root-prim: collide-shape-prim
riders: inline-array
penetrate-using: penetrate
penetrated-by: penetrate
backup-collide-as: collide-spec
backup-collide-with: collide-spec
event-priority: uint8
rider-max-momentum: float
rider-time: time-frame
rider-last-move: vector
trans-old: vector
trans-old-old: vector
trans-old-old-old: vector
poly-pat: pat-surface
cur-pat: pat-surface
ground-pat: pat-surface
status: collide-status
old-status: collide-status
prev-status: collide-status
reaction-flag: cshape-reaction-flags
reaction: function
no-reaction: function
local-normal: vector
surface-normal: vector
poly-normal: vector
ground-poly-normal: vector
gspot-pos: vector
gspot-normal: vector
grount-touch-point: vector
ground-impact-vel: meters
surface-angle: float
poly-angle: float
touch-angle: float
coverage: float
dynam: dynamics
surf: surface
unknown-float00: float
unknown-float01: float
unknown-float02: float
unknown-float03: float
transv-ctrl: vector
target-transv: vector
bent-gravity-normal: vector
quat-for-control: quaternion
override-quat: quaternion
override-quat-alpha: float
ctrl-xz-vel: float
unknown-float003: float
turn-go-the-long-way: float
velocity-after-thrust: float
turn-lockout-end-time: time-frame
turn-to-alt-heading: vector
last-transv: vector
last-quat-for-control: quaternion
trans-log-trans: vector
trans-log-times: time-frame
trans-log-idx: int32
draw-offset: vector
cspace-offset: vector
anim-collide-offset-local: vector
anim-collide-offset-world: vector
old-anim-collide-offset-world: vector
anim-collide-offset-delta-world: vector
standard-dynamics: dynamics
mod-surface: surface
current-surface: surface
prev-surf: surface
time-of-last-surface-change: time-frame
cpad: cpad-info
turn-to-angle: float
last-turn-to-angle: float
turn-to-magnitude: float
last-turn-to-magnitude: float
to-target-pt-xz: vector
last-to-target-pt-xz: vector
turn-to-target: vector
last-turn-to-target: vector
turn-history-ctrl: vector
pad-xz-dir: vector
last-pad-xz-dir: vector
pad-magnitude: float
last-pad-magnitude: float
time-of-last-pad-read: time-frame
w-R-c: matrix
c-R-w: matrix
ctrl-orientation: matrix
pre-collide-local-normal: vector
camera-pos: vector
cam-R-w: matrix
update-cam-R-w-start-time: int64
force-turn-to-direction: vector
force-turn-to-speed: float
unknown-floatiujh1bnb2n3i1: float
force-turn-to-strength: float
tongue-counter: int32
collide-extra-velocity: vector
additional-decaying-velocity: vector
additional-decaying-velocity-end-time: time-frame
additional-decaying-velocity-decay-start-time: time-frame
gravity-normal: vector
last-gravity-normal: vector
last-trans-any-surf: vector
unknown-float16: float
ground-contact-normal: vector
last-trans-on-ground: vector
ground-contact-sphere-center: vector
transv-on-last-impact: vector
list-time-on-ground: time-frame
ground-local-norm-dot-grav: float
local-slope-z: float
local-slope-x: float
surface-slope-z: float
surface-slope-x: float
last-time-on-surface: time-frame
normal-impact-vel: float
last-time-touching-actor: time-frame
wall-contact-pat: pat-surface
wall-contact-pt: vector
wall-contact-poly-normal: vector
wall-contact-normal: vector
actor-contact-pt: vector
actor-contact-normal: vector
actor-contact-handle: handle
gspot-pat-surfce: pat-surface
gspot-slope-z: float
gspot-slope-x: float
ctrl-slope-heading: float
ctrl-slope-z: float
ctrl-slope-x: float
unknown-word000: int32
unknown-float002: float
unknown-float-n12iuh3n1: float
unknown-float-ki1jhbn23hj: float
time-of-last-lc: time-frame
low-coverage-pat-next1: pat-surface
low-coverage-dist-to-next2: float
low-coverage-pat-next2: pat-surface
low-coverage-slope-to-next1: float
low-coverage-norm-of-next1: vector
low-coverage-norm-of-next2: vector
low-coverage-overhang-plane-normal: vector
low-coverage-tangent: vector
low-coverage-tangent-xz: vector
btransv: vector
blocked-factor: float
blocked-in-air-factor: float
time-of-last-clear-wall-in-jump: time-frame
time-of-last-lc-touch-edge: time-frame
collision-spheres: collide-shape-prim-sphere
unknown-word02: int32
last-roll-end-time: time-frame
last-running-attack-end-time: time-frame
last-hands-attempt-time: time-frame
last-attack-end-time: time-frame
last-feet-attempt-time: time-frame
unknown-time-frame13: time-frame
last-time-of-stuck: time-frame
bend-amount: float
bend-target: float
bend-speed: float
ctrl-to-head-offset: vector
lhand-cspace: cspace
rhand-cspace: cspace
midpoint-of-hands: vector
ctrl-to-hands-offset: vector
sidekick-root: cspace
collide-mode: symbol
collide-mode-transition: float
duck-gun-tube-transision: float
transv-history: vector
average-xz-vel: float
idx-of-fastest-xz-vel: int32
hand-to-edge-dist: float
unknown-symbol000: symbol
edge-grab-edge-dir: vector
unknown-vector35: vector
edge-grab-across-edge-dir: vector
last-successful-compute-edge-time: time-frame
edge-grab-start-time: time-frame
unknown-handle000: handle
anim-handle: handle
unknown-word04: uint32
unknown-spool-anim00: spool-anim
unknown-word05: int32
unknown-symbol01: symbol
unknown-float34: float
did-move-to-pole-or-max-jump-height: float
unknown-symbol03: float
unknown-float35: float
unknown-float36: float
unknown-float37: float
unknown-vector37: vector
unknown-vector38: vector
unknown-vector39: vector
unknown-vector40: vector
sliding-start-time: time-frame
unknown-time-frame18: time-frame
unknown-sound-id00: sound-id
unknown-handle02: handle
impact-ctrl: impact-control
unknown-word06: int32
unknown-vector41: vector
last-trans-leaving-surf: vector
unknown-float38: float
highest-jump-mark: vector
unknown-float39: float
unknown-time-frame19: time-frame
time-of-last-debug-float: time-frame
danger-mode: symbol
target-attack-id: uint32
attacked-by-id: int32
bomb-scale: float
attack-count: uint64
send-attack-dest: handle
send-attack-time: time-frame
unknown-combo-tracker00: combo-tracker
unknown-time-frame21: time-frame
unknown-dword07: int64
unknown-dword08: int64
unknown-dword09: int64
unknown-dword10: int64
jump-kind: symbol
unknown-quaternion04: quaternion
unknown-sound-id01: sound-id
unknown-float41: float
unknown-float42: float
history-idx: uint16
history-length: uint16
remaining-ctrl-iterations: int32
invul1-on-time: time-frame
invul1-off-time: time-frame
invul2-on-time: time-frame
invul2-off-time: time-frame
unknown-float43: float
unknown-float001: float
board-jump-and-swim-sound: sound-id
bubbles-sound: sound-id
unknown-time-frame26: time-frame
unknown-time-frame27: time-frame
yellow-eco-last-use-time: int64
align-xz-vel: vector
zx-vel-frac: float
unknown-sound-id04: sound-id
unknown-float45: float
default-collide-as-all: collide-spec
default-collide-as-fgnd: collide-spec
default-collide-with-all: collide-spec
default-collide-with-fgnd: collide-spec
time-of-last-zero-input: time-frame
time-of-last-nonzero-input: time-frame
time-between-zero-inputs: time-frame
time-of-last-debug-heal: time-frame
last-nonzero-input-dir-targ: quaternion
time-of-last-wall-hide-first-check-pass: time-frame
time-of-first-wall-hide-first-check-pass: time-frame
pad: uint8
Types
touching-list: structuresource
Fields
num-touching-shapes: int32
resolve-u: int8
touching-shapes: touching-shapes-entry
Methods
add-touching-prims(obj: touching-list, arg0: collide-shape-prim, arg1: collide-shape-prim, arg2: float, arg3: collide-tri-result, arg4: collide-tri-result) => nonesource
free-nodes(obj: touching-list) => nonesource
update-from-step-size(obj: touching-list, arg0: float) => nonesource
send-events-for-touching-shapes(obj: touching-list) => nonesource
get-shapes-entry(obj: touching-list, shape1: collide-shape, shape2: collide-shape) => touching-shapes-entrysource
touching-prim: structuresource
touching-prims-entry: structuresource
Fields
next: touching-prims-entry
prev: touching-prims-entry
allocated?: symbol
u: float
prim1: touching-prim
prim2: touching-prim
Methods
get-middle-of-bsphere-overlap(obj: touching-prims-entry, arg0: vector) => vectorsource
get-touched-prim(obj: touching-prims-entry, arg0: collide-shape, arg1: touching-shapes-entry) => collide-shape-primsource
get-touched-tri(obj: touching-prims-entry, arg0: collide-shape, arg1: touching-shapes-entry) => collide-tri-resultsource
touching-prims-entry-pool: structuresource
Fields
head: touching-prims-entry
nodes: touching-prims-entry
Methods
get-free-node-count(obj: touching-prims-entry-pool) => intsource
init-list!(obj: touching-prims-entry-pool) => nonesource
touching-shapes-entry: structuresource
Fields
cshape1: collide-shape
cshape2: collide-shape
resolve-u: int8
head: touching-prims-entry
handle1: handle
handle2: handle
Methods
get-next(obj: touching-shapes-entry, arg0: touching-shapes-entry) => touching-prims-entrysource
get-touched-shape(obj: touching-shapes-entry, arg0: collide-shape) => collide-shapesource
prims-touching?(obj: touching-shapes-entry, arg0: collide-shape, arg1: uint) => touching-prims-entrysource
prims-touching-action?(obj: touching-shapes-entry, arg0: collide-shape, arg1: collide-action, arg2: collide-action) => basicsource
free-touching-prims-list(obj: touching-shapes-entry) => nonesource
Types
add-prims-touching-work: structuresource
Functions
get-intersect-point(arg0: vector, arg1: touching-prims-entry, arg2: collide-shape, arg3: touching-shapes-entry) => vectorsource
Expand description
this is some vif setup stuff that was in jak 1 as well - some code in collide-cache
uses VIF's unpack/upload to modify collision data. This gets ported to c++, just
keeping it here for reference.
uses VIF's unpack/upload to modify collision data. This gets ported to c++, just
keeping it here for reference.