Skip to main content

collide-cache-h

source

Types


collide-cache

collide-cache: basicsource
Fields
type: type
num-tris: int32
num-prims: int32
num-prims-u: uint32
ignore-mask: pat-surface
proc: process-drawable
collide-box: bounding-box
collide-box4w: bounding-box4w
collide-with: collide-kind
prims: collide-cache-prim
tris: collide-cache-tri
Methods
debug-draw(obj: collide-cache) => nonesource

Debug draw all the things in the collide cache!

fill-and-probe-using-line-sphere(obj: collide-cache, arg0: vector, arg1: vector, arg2: float, arg3: collide-kind, arg4: process, arg5: collide-tri-result, arg6: pat-surface) => floatsource
fill-and-probe-using-spheres(obj: collide-cache, arg0: collide-using-spheres-params) => symbolsource
fill-and-probe-using-y-probe(obj: collide-cache, arg0: vector, arg1: float, arg2: collide-kind, arg3: process-drawable, arg4: collide-tri-result, arg5: pat-surface) => floatsource
fill-using-bounding-box(obj: collide-cache, arg0: bounding-box, arg1: collide-kind, arg2: process-drawable, arg3: pat-surface) => nonesource
fill-using-line-sphere(obj: collide-cache, arg0: vector, arg1: vector, arg2: float, arg3: collide-kind, arg4: process-drawable, arg5: pat-surface) => nonesource
fill-using-spheres(obj: collide-cache, arg0: collide-using-spheres-params) => nonesource
fill-using-y-probe(obj: collide-cache, arg0: vector, arg1: float, arg2: collide-kind, arg3: process-drawable, arg4: pat-surface) => nonesource
initialize(obj: collide-cache) => nonesource

Clear the collide-cache.

probe-using-line-sphere(obj: collide-cache, arg0: vector, arg1: vector, arg2: float, arg3: collide-kind, arg4: collide-tri-result, arg5: pat-surface) => floatsource
probe-using-spheres(obj: collide-cache, arg0: collide-using-spheres-params) => symbolsource
probe-using-y-probe(obj: collide-cache, arg0: vector, arg1: float, arg2: collide-kind, arg3: collide-tri-result, arg4: pat-surface) => floatsource
fill-from-background(obj: collide-cache, bsp-find-mesh-func: function, import-mesh-func: function) => nonesource

This terrible function fills the collide cache with background tris from a bounding box.

fill-from-foreground-using-box(obj: collide-cache) => nonesource
fill-from-foreground-using-line-sphere(obj: collide-cache) => nonesource
fill-from-foreground-using-y-probe(obj: collide-cache) => nonesource
fill-from-water(obj: collide-cache, arg0: water-control) => nonesource
load-mesh-from-spad-in-box: unknown
collide-cache-method-27: unknown
collide-cache-method-28: unknown
collide-cache-method-29: unknown
puyp-mesh: unknown
puyp-sphere(obj: collide-cache, arg0: collide-puyp-work, arg1: collide-cache-prim) => vectorsource
unpack-background-collide-mesh: unknown

collide-cache-prim

collide-cache-prim: structuresource
Fields
prim-core: collide-prim-core
extra-quad: uint128
ccache: collide-cache
prim: collide-shape-prim
first-tri: uint16
num-tris: uint16
unused: uint8
world-sphere: vector
collide-as: collide-kind
action: collide-action
offense: collide-offense
prim-type: int8
Methods
resolve-moving-sphere-tri: unknown
resolve-moving-sphere-sphere: unknown

collide-cache-tri

collide-cache-tri: structuresource
Fields
vertex: vector
extra-quad: uint128
pat: pat-surface
prim-index: uint16
user16: uint16
user32: uint32

collide-list

collide-list: structuresource
Fields
num-items: int32
items: collide-list-item

collide-list-item

collide-list-item: structuresource
Fields
mesh: collide-frag-mesh
inst: basic

collide-puss-sphere

collide-puss-sphere: structuresource
Fields
bsphere: sphere
bbox4w: bounding-box4w

collide-puss-work

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

collide-puyp-work

collide-puyp-work: structuresource
Fields
best-u: float
ignore-pat: pat-surface
tri-out: collide-tri-result
start-pos: vector
move-dist: vector

collide-using-spheres-params

collide-using-spheres-params: structuresource
Fields
spheres: inline-array
num-spheres: uint32
collide-with: collide-kind
proc: process-drawable
ignore-pat: pat-surface
solid-only: basic

collide-work

collide-work: structuresource
Fields
collide-sphere-neg-r: sphere
collide-box4w: bounding-box4w
inv-mat: matrix

Variables


*collide-cache-max-tris*

*collide-cache-max-tris*: intsource

BIG_COLLIDE_CACHE_SIZE

BIG_COLLIDE_CACHE_SIZE: unknownsource

collide-cache

source

Types


collide-puls-work

collide-puls-work: structuresource
Fields
ignore-pat: pat-surface
tri-out: collide-tri-result
bsphere: sphere
move-dist: vector

pc-fffuls-work

pc-fffuls-work: structuresource
Fields
reg-vf28: vector
reg-vf29: vector
reg-vf30: vector
reg-vf31: vector

Functions


collide-cache-using-box-test

collide-cache-using-box-test(arg0: vector) => symbolsource

collide-cache-using-line-sphere-test

collide-cache-using-line-sphere-test(arg0: vector) => symbolsource

Check if the input sphere is in the rotated bounding box volume of the current
line-sphere query.

collide-cache-using-y-probe-test

collide-cache-using-y-probe-test(arg0: vector) => symbolsource

make-collide-list-using-line-sphere-inst-test

make-collide-list-using-line-sphere-inst-test(arg0: collide-fragment, arg1: instance-tie) => symbolsource

Check if a collide-fragment at a given instance is in the rotated bounding box volume
of the current line-sphere query.

Variables


*already-printed-exeeded-max-cache-tris*

*already-printed-exeeded-max-cache-tris*: symbolsource

*pc-fffuls-work*

*pc-fffuls-work*: pc-fffuls-worksource

collide-edge-grab-h

source

Types


collide-edge-edge

collide-edge-edge: structuresource
Fields
ignore: basic
etri: collide-edge-tri
vertex-ptr: inline-array
outward: vector
edge-vec-norm: vector

collide-edge-hold-item

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

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-tri

collide-edge-tri: structuresource
Fields
ctri: collide-cache-tri
normal: vector

collide-edge-work

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
max-dist-sqrd-to-outward-pt: float
max-dir-cosa-delta: float
split-dists: float
outward-offset: vector
local-cache-fill-box: bounding-box
local-within-reach-box: bounding-box
local-player-spheres: sphere
world-player-spheres: sphere
local-player-hanging-spheres: sphere
world-player-hanging-spheres: sphere
local-player-leap-up-spheres: sphere
world-player-leap-up-spheres: sphere
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) => symbolsource

Iterate through edges, adding them to the collide-edge-hold-list, if they are good

debug-draw-edges(obj: collide-edge-work) => objectsource
debug-draw-tris(obj: collide-edge-work) => nonesource
debug-draw-sphere(obj: collide-edge-work) => symbolsource
compute-center-point!(obj: collide-edge-work, arg0: collide-edge-edge, arg1: vector) => floatsource
collide-edge-work-method-14(obj: collide-edge-work, arg0: vector, arg1: vector, arg2: int) => floatsource
find-grabbable-edges!: unknown
find-grabbable-tris!: unknown
should-add-to-list?(obj: collide-edge-work, arg0: collide-edge-hold-item, arg1: collide-edge-edge) => symbolsource
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

edge-grab-info: structuresource
Fields
world-vertex: vector
local-vertex: vector
actor-cshape-prim-offset: int32
actor-handle: handle
hanging-matrix: matrix
edge-vertex: vector
center-hold: vector
tri-vertex: vector
left-hand-hold: vector
right-hand-hold: vector
center-hold-old: vector
edge-tri-pat: uint32
Methods
edge-grab-info-method-9(obj: edge-grab-info) => symbolsource
debug-draw(obj: edge-grab-info) => symbolsource

Variables


*collide-edge-work*

*collide-edge-work*: collide-edge-worksource

collide-edge-grab

source

Types


pbhp-stack-vars

pbhp-stack-vars: structuresource
Fields
edge: collide-edge-edge
allocated: basic
neg-hold-pt: vector
split-vec: vector

Variables


*no-walk-surface*

*no-walk-surface*: surfacesource

*rotate-surface*

*rotate-surface*: surfacesource

collide-frag-h

source

Types


collide-frag-mesh

collide-frag-mesh: basicsource
Fields
type: type
packed-data: uint32
pat-array: uint32
strip-data-len: uint16
poly-count: uint16
base-trans: vector
vertex-count: uint8
vertex-data-qwc: uint8
total-qwc: uint8
unused: uint8

collide-frag-vertex

collide-frag-vertex: vectorsource
Fields
x: float
y: float
z: float
w: float
data: float
quad: uint128

collide-fragment

collide-fragment: drawablesource
Fields
type: type
id: int16
bsphere: vector
mesh: collide-frag-mesh

drawable-inline-array-collide-fragment

drawable-inline-array-collide-fragment: drawable-inline-arraysource
Fields
type: type
id: int16
bsphere: vector
length: int16
data: collide-fragment
pad: uint32

drawable-tree-collide-fragment

drawable-tree-collide-fragment: drawable-treesource
Fields
type: type
id: int16
bsphere: vector
length: int16
data: drawable
data-override: drawable-inline-array

collide-func

source

Functions


moving-sphere-sphere-intersect

moving-sphere-sphere-intersect(arg0: vector, arg1: vector, arg2: vector, arg3: vector) => floatsource

pc-port-raw-ray-sphere-implementation

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)

raw-ray-sphere-intersect

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.

ray-circle-intersect

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

ray-cylinder-intersect

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.

ray-plane-intersect

ray-plane-intersect(arg0: vector, arg1: vector, arg2: vector, arg3: vector, arg4: vector, arg5: vector, arg6: vector) => floatsource

Unused.

ray-sphere-intersect

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.

Variables


COLLISION_MISS

COLLISION_MISS: unknownsource

collide-h

source

Variables


*collide-test-flag*

*collide-test-flag*: symbolsource

collide-mesh-h

source

Types


collide-mesh

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

Draw a collide-mesh.

overlap-test(obj: collide-mesh, arg0: collide-mesh-cache-tri, arg1: vector) => symbolsource
should-push-away-test: unknown
sphere-on-platform-test: unknown
populate-cache!(obj: collide-mesh, arg0: collide-mesh-cache-tri, arg1: matrix) => nonesource
collide-mesh-math-1: unknown
collide-mesh-math-2: unknown

collide-mesh-cache

collide-mesh-cache: basicsource
Fields
type: type
used-size: uint32
max-size: uint32
id: uint64
data: uint8
Methods
allocate!(obj: collide-mesh-cache, arg0: int) => intsource
is-id?(obj: collide-mesh-cache, arg0: int) => symbolsource

Is this our id?

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

collide-mesh-cache-tri

collide-mesh-cache-tri: structuresource
Fields
vertex: vector
normal: vector
bbox4w: bounding-box4w
pat: pat-surface

collide-mesh-tri

collide-mesh-tri: structuresource
Fields
vertex-index: uint8
unused: uint8
pat: pat-surface

collide-tri-result

collide-tri-result: structuresource
Fields
vertex: vector
intersect: vector
normal: vector
pat: pat-surface

Variables


COLLIDE_MESH_CACHE_SIZE

COLLIDE_MESH_CACHE_SIZE: unknownsource

collide-mesh

source

Types


sopt-work

sopt-work: structuresource
Fields
intersect: vector
sphere-bbox4w: bounding-box4w

spat-work

spat-work: structuresource
Fields
intersect: vector
sphere-bbox4w: bounding-box4w

collide-probe

source

Types


collide-probe-stack

collide-probe-stack: structuresource

collide-probe-stack-elem

collide-probe-stack-elem: structuresource
Fields
child: uint32
count: uint32

Functions


collide-probe-collide-fragment-tree-make-list

collide-probe-collide-fragment-tree-make-list(arg0: drawable-tree-collide-fragment, arg1: collide-list) => nonesource

Given a collide fragment tree, make a list.
Note: you must have more than 8 collide fragments, so you have more than 1 level in the tree.

collide-probe-instance-tie-collide-frags

collide-probe-instance-tie-collide-frags() => nonesource

collide-probe-instance-tie-tree-make-list

collide-probe-instance-tie-tree-make-list(arg0: drawable-tree-instance-tie, arg1: collide-list) => intsource

Given a TIE instance tree, make a list.
Unlike tfrag, they explicitly support the < 8 node case

collide-probe-make-list

collide-probe-make-list(arg0: level, arg1: collide-list) => nonesource

Run the probe algorithm on an entire level.

collide-upload-vu0

collide-upload-vu0() => nonesource

Upload the probe program to VU0.

creates-new-method?

creates-new-method?(arg0: type, arg1: int) => symbolsource

Is the method with the given ID in the given type a new method for this type?

describe-methods

describe-methods(arg0: type) => symbolsource

Print information about the methods of a type.

distc

distc(arg0: vector, arg1: vector) => floatsource

indent-to

indent-to(arg0: int) => nonesource

Print out arg0 spaces

interpolate

interpolate(arg0: float, arg1: float, arg2: float, arg3: float, arg4: float) => floatsource

misty-ambush-height

misty-ambush-height(arg0: vector) => floatsource

misty-ambush-height-probe

misty-ambush-height-probe(arg0: vector, arg1: float) => floatsource

Hack to manually compute the ground height in misty ambush.

overrides-parent-method?

overrides-parent-method?(arg0: type, arg1: int) => symbolsource

Does the method with the given ID in the given type override a method of its parent?

pke-collide-test

pke-collide-test() => nonesource
print-out(arg0: int) => objectsource

probe-traverse-collide-fragment

probe-traverse-collide-fragment(arg0: drawable-tree-collide-fragment, arg1: int) => nonesource

Print out all levels of a drawabl-tree-collide-fragment.

probe-traverse-draw-node

probe-traverse-draw-node(arg0: draw-node, arg1: int) => nonesource

Print out info for a draw node, and recursively its children. They forgot to finish this one.

probe-traverse-inline-array-node

probe-traverse-inline-array-node(arg0: drawable-inline-array-node, arg1: int) => nonesource

Print out a drawable-inline-array-node, and recursively all children

Variables


*collide-probe-stack*

*collide-probe-stack*: collide-probe-stacksource

collide-vu0-block

const collide-vu0-block: vu-functionsource

collide-shape-h

source

Types


collide-overlap-result

collide-overlap-result: structuresource
Fields
best-dist: float
best-from-prim: collide-shape-prim
best-to-prim: collide-shape-prim
best-from-tri: collide-tri-result
Methods
reset!(obj: collide-overlap-result) => nonesource

Reset the result.

collide-prim-core

collide-prim-core: structuresource
Fields
world-sphere: vector
collide-as: collide-kind
action: collide-action
offense: collide-offense
prim-type: int8
extra: uint8
quad: uint128

collide-shape

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
process: process-drawable
max-iteration-count: uint8
nav-flags: nav-flags
pad-byte: uint8
pat-ignore-mask: pat-surface
event-self: symbol
event-other: symbol
root-prim: collide-shape-prim
riders: collide-sticky-rider-group
backup-collide-as: collide-kind
backup-collide-with: collide-kind
Methods
move-by-vector!(obj: collide-shape, arg0: vector) => nonesource

Adjust our position by the given vector

alloc-riders(obj: collide-shape, arg0: int) => nonesource
move-to-point!(obj: collide-shape, arg0: vector) => nonesource

Move us to exactly the given position.

debug-draw(obj: collide-shape) => nonesource

Draw a collide shape

fill-cache-for-shape!(obj: collide-shape, arg0: float, arg1: collide-kind) => nonesource

Fill cache for a box.

fill-cache-integrate-and-collide!(obj: collide-shape, arg0: vector, arg1: collide-kind) => nonesource

Fill the collide cache for the object, integrate, and handle collisions!

find-prim-by-id(obj: collide-shape, arg0: uint) => collide-shape-primsource

Find a prim in this shape with the given id.

detect-riders!(obj: collide-shape) => symbolsource

See who is riding us.

build-bounding-box-for-shape(obj: collide-shape, arg0: bounding-box, arg1: float, arg2: collide-kind) => symbolsource

Build a bounding box containing the whole shape.
If the box is empty, returns #f.

integrate-and-collide!(obj: collide-shape, arg0: vector) => nonesource

For a non-moving collide shape, we just move ourself. We have no reaction to anything we hit.

find-collision-meshes(obj: collide-shape) => symbolsource
on-platform(obj: collide-shape, arg0: collide-shape, arg1: collide-overlap-result) => symbolsource

Are we on the platform? Returns #t/#f and also sets an overlap result.

find-overlapping-shapes(obj: collide-shape, arg0: overlaps-others-params) => symbolsource
calc-shove-up(obj: collide-shape, arg0: attack-info, arg1: float) => vectorsource
should-push-away(obj: collide-shape, arg0: collide-shape, arg1: collide-overlap-result) => symbolsource

Find the overlap between two collide shapes. This is the main entry point for the overlap algorithm.
The result is returned in arg1. The obj is collided with arg0 (meaning obj uses its collide-with, arg0 uses colide-as).
The best-dist is only valid if the result is #t (it should be negative then)

pull-rider!(obj: collide-shape, arg0: pull-rider-info) => nonesource

Move a rider.

pull-riders!(obj: collide-shape) => symbolsource

Move our riders.

do-push-aways!(obj: collide-shape) => symbolsource

This is the main function to call to respond

set-root-prim!(obj: collide-shape, arg0: collide-shape-prim) => collide-shape-primsource
update-transforms!(obj: collide-shape) => symbolsource

Update all transforms for this shape. After this is called, you can use the
world-spheres.

clear-collide-with-as(obj: collide-shape) => nonesource
restore-collide-with-as(obj: collide-shape) => nonesource
backup-collide-with-as(obj: collide-shape) => nonesource
set-root-prim-collide-with!(obj: collide-shape, arg0: collide-kind) => nonesource
set-root-prim-collide-as!(obj: collide-shape, arg0: collide-kind) => nonesource
set-collide-kinds(obj: collide-shape, arg0: int, arg1: collide-kind, arg2: collide-kind) => nonesource
set-collide-offense(obj: collide-shape, arg0: int, arg1: collide-offense) => nonesource
send-shove-back(obj: collide-shape, arg0: process, arg1: touching-shapes-entry, arg2: float, arg3: float, arg4: float) => nonesource

collide-shape-intersect

collide-shape-intersect: basicsource
Fields
type: type
move-vec: vector
best-u: float
best-tri: collide-tri-result
best-from-prim: collide-shape-prim
best-to-prim: collide-shape-prim
Methods
init!(obj: collide-shape-intersect, arg0: vector) => symbolsource

Initialize the intersection in the given direction.

collide-shape-moving

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
process: process-drawable
max-iteration-count: uint8
nav-flags: nav-flags
pad-byte: uint8
pat-ignore-mask: pat-surface
event-self: symbol
event-other: symbol
root-prim: collide-shape-prim
riders: collide-sticky-rider-group
backup-collide-as: collide-kind
backup-collide-with: collide-kind
rider-time: time-frame
rider-last-move: vector
trans-old: vector
poly-pat: pat-surface
cur-pat: pat-surface
ground-pat: pat-surface
status: cshape-moving-flags
old-status: cshape-moving-flags
prev-status: cshape-moving-flags
reaction-flag: cshape-reaction-flags
reaction: function
no-reaction: function
local-normal: vector
surface-normal: vector
poly-normal: vector
ground-poly-normal: vector
ground-touch-point: vector
shadow-pos: vector
ground-impact-vel: meters
surface-angle: float
poly-angle: float
touch-angle: float
coverage: float
dynam: dynamics
surf: surface
Methods
set-and-handle-pat!(obj: collide-shape-moving, arg0: pat-surface) => nonesource

Handle landing on the given pat-surface. This is likely target-specific.

integrate-no-collide!(obj: collide-shape-moving, arg0: vector) => nonesource

Integrate, but ignore all collisions.
Will set both trans and shadow-pos

collide-shape-moving-method-58(obj: collide-shape-moving, arg0: vector) => symbolsource
integrate-for-enemy-with-move-to-ground!(obj: collide-shape-moving, arg0: vector, arg1: collide-kind, arg2: float, arg3: symbol, arg4: symbol, arg5: symbol) => nonesource

This is likely the main method for stepping an enemy.
arg0: velocity
arg1: ground collision
arg2: ground height probe start
arg3: revert move if blocked
arg4: hover if ran off the ground
arg5: use misty hack

move-to-ground(obj: collide-shape-moving, arg0: float, arg1: float, arg2: symbol, arg3: collide-kind) => symbolsource

Move to the ground now.

move-to-ground-point!(obj: collide-shape-moving, arg0: vector, arg1: vector, arg2: vector) => nonesource

Move the collide shape to the ground immediately:
arg0: ground point
arg1: velocity (will be modified)
arg2: ground normal.
Even if the ground is sloped, transv.y is set to 0.

compute-acc-due-to-gravity(obj: collide-shape-moving, arg0: vector, arg1: float) => vectorsource

Compute the acceleration due to gravity.

step-collison!(obj: collide-shape-moving, arg0: vector, arg1: vector, arg2: float) => floatsource

Take 1 step in the collision. Attempt to move at velocity of arg1, for arg2 of a step.
The resulting velocity is stored in arg0. The amount of a step actually taken is returned.

move-to-tri!(obj: collide-shape-moving, arg0: collide-tri-result, arg1: vector) => nonesource

Move us to tri arg0, at point arg1.

collide-shape-prim

collide-shape-prim: basicsource
Fields
type: type
cshape: collide-shape
prim-id: uint32
transform-index: int8
prim-core: collide-prim-core
local-sphere: vector
collide-with: collide-kind
world-sphere: vector
collide-as: collide-kind
action: collide-action
offense: collide-offense
prim-type: int8
radius: meters
Methods
move-by-vector!(obj: collide-shape-prim, arg0: vector) => nonesource

Adjust our position by the given vector

find-prim-by-id(obj: collide-shape-prim, arg0: uint) => collide-shape-primsource

Find a prim in this shape or its children with the given id.

debug-draw-world-sphere(obj: collide-shape-prim) => symbolsource

Draw our sphere

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) => nonesource
add-fg-prim-using-y-probe(obj: collide-shape-prim, arg0: collide-cache) => 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

Overlap, from group.

unused-17: unknown
collide-with-collide-cache-prim-mesh(obj: collide-shape-prim, arg0: collide-shape-intersect, arg1: collide-cache-prim) => nonesource

abstract base class version.

collide-with-collide-cache-prim-sphere(obj: collide-shape-prim, arg0: collide-shape-intersect, arg1: collide-cache-prim) => nonesource
add-to-bounding-box(obj: collide-shape-prim, arg0: collide-kind) => symbolsource

Add a single prim to the bounding box. (just adds the bsphere)

num-mesh(obj: collide-shape-prim, arg0: collide-shape-prim) => intsource
on-platform-test(obj: collide-shape-prim, arg0: collide-shape-prim, arg1: collide-overlap-result, arg2: float) => nonesource
should-push-away-test(obj: collide-shape-prim, arg0: collide-shape-prim, arg1: collide-overlap-result) => nonesource

Should be impossible to call - collide-shape-prim is abstract.

should-push-away-reverse-test(obj: collide-shape-prim, arg0: collide-shape-prim-group, arg1: collide-overlap-result) => nonesource

This is a flipped version of should-push-away-test.
the group uses their collide-as

update-transforms!(obj: collide-shape-prim, arg0: process-drawable) => symbolsource

Update our world sphere, and our children's world sphere's too.

set-collide-as!(obj: collide-shape-prim, arg0: collide-kind) => nonesource
set-collide-with!(obj: collide-shape-prim, arg0: collide-kind) => nonesource

collide-shape-prim-group

collide-shape-prim-group: collide-shape-primsource
Fields
type: type
cshape: collide-shape
prim-id: uint32
transform-index: int8
prim-core: collide-prim-core
local-sphere: vector
collide-with: collide-kind
world-sphere: vector
collide-as: collide-kind
action: collide-action
offense: collide-offense
prim-type: int8
radius: meters
num-prims: int32
num-prims-u: uint32
allocated-prims: int32
prim: collide-shape-prim
prims: collide-shape-prim
Methods
append-prim(obj: collide-shape-prim-group, arg0: collide-shape-prim) => nonesource
add-to-non-empty-bounding-box(obj: collide-shape-prim-group, arg0: collide-kind) => nonesource

collide-shape-prim-mesh

collide-shape-prim-mesh: collide-shape-primsource
Fields
type: type
cshape: collide-shape
prim-id: uint32
transform-index: int8
prim-core: collide-prim-core
local-sphere: vector
collide-with: collide-kind
world-sphere: vector
collide-as: collide-kind
action: collide-action
offense: collide-offense
prim-type: int8
radius: meters
mesh: collide-mesh
mesh-id: int32
mesh-cache-id: uint64
mesh-cache-tris: inline-array
Methods
change-mesh(obj: collide-shape-prim-mesh, arg0: int) => nonesource

Change our mesh to the given mesh ID.

collide-shape-prim-sphere

collide-shape-prim-sphere: collide-shape-primsource
Fields
type: type
cshape: collide-shape
prim-id: uint32
transform-index: int8
prim-core: collide-prim-core
local-sphere: vector
collide-with: collide-kind
world-sphere: vector
collide-as: collide-kind
action: collide-action
offense: collide-offense
prim-type: int8
radius: meters
pat: pat-surface

collide-sticky-rider

collide-sticky-rider: structuresource
Fields
rider-handle: handle
sticky-prim: collide-shape-prim
prim-ry: float
rider-local-pos: vector
Methods
set-rider!(obj: collide-sticky-rider, arg0: handle) => symbolsource

Set the rider and clear the primitive.

collide-sticky-rider-group

collide-sticky-rider-group: basicsource
Fields
type: type
num-riders: int32
allocated-riders: int32
rider: collide-sticky-rider
Methods
add-rider!(obj: collide-sticky-rider-group, arg0: process-drawable) => collide-sticky-ridersource

Add a rider to this platform.

reset!(obj: collide-sticky-rider-group) => intsource

Reset all active riders

overlaps-others-params

overlaps-others-params: structuresource
Fields
options: uint32
tlist: touching-list

pull-rider-info

pull-rider-info: structuresource
Fields
rider: collide-sticky-rider
rider-cshape: collide-shape-moving
rider-delta-ry: float
rider-dest: vector

Variables


*collide-hit-by-others-list*

*collide-hit-by-others-list*: enginesource

*collide-hit-by-player-list*

*collide-hit-by-player-list*: enginesource

*collide-player-list*

*collide-player-list*: enginesource

*collide-shape-prim-backgnd*

*collide-shape-prim-backgnd*: collide-shape-prim-meshsource

*collide-shape-prim-water*

*collide-shape-prim-water*: collide-shape-prim-meshsource

*collide-usually-hit-by-player-list*

*collide-usually-hit-by-player-list*: enginesource

collide-shape

source

Types


pc-bounding-box-work

pc-bounding-box-work: structuresource
Fields
reg-vf29: vector
reg-vf30: vector
reg-vf31: vector

Functions


collide-shape-draw-debug-marks

collide-shape-draw-debug-marks() => nonesource

debug-report-col-stats

debug-report-col-stats() => intsource

default-collision-reaction

default-collision-reaction(arg0: collide-shape-moving, arg1: collide-shape-intersect, arg2: vector, arg3: vector) => cshape-moving-flagssource

Move into collision!

find-ground-point

find-ground-point(target-ctrl: control-info, ground-result: vector, start-len: float, max-len: float) => vectorsource

Find somewhere safe to land. This is used to find where to bounce back the player if you jump on fire canyon.
It's a nice example function for the collision system.

simple-collision-reaction

simple-collision-reaction(arg0: collide-shape-moving, arg1: collide-shape-intersect, arg2: vector, arg3: vector) => cshape-moving-flagssource

A much simpler collide reaction.

target-attack-up

target-attack-up(arg0: target, arg1: symbol, arg2: symbol) => nonesource

Handle an attack up. This launches the player in the air, forcing them back to a safe location.

Variables


*col-timer-enable*

*col-timer-enable*: symbolsource

*col-timer*

*col-timer*: stopwatchsource

*frame-timer*

*frame-timer*: stopwatchsource

*pc-bounding-box-work*

*pc-bounding-box-work*: pc-bounding-box-worksource

collide-target-h

source

Types


collide-history

collide-history: structuresource
Fields
intersect: vector
trans: vector
transv: vector
transv-out: vector
local-normal: vector
surface-normal: vector
time: time-frame
status: cshape-moving-flags
pat: pat-surface
reaction-flag: cshape-reaction-flags
Methods
update!(obj: collide-history, cshape: collide-shape-moving, xs: vector, transv: vector, transv-out: vector) => _type_source

Update the collide-history element.

control-info

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
process: process-drawable
max-iteration-count: uint8
nav-flags: nav-flags
pad-byte: uint8
pat-ignore-mask: pat-surface
event-self: symbol
event-other: symbol
root-prim: collide-shape-prim
riders: collide-sticky-rider-group
backup-collide-as: collide-kind
backup-collide-with: collide-kind
rider-time: time-frame
rider-last-move: vector
trans-old: vector
poly-pat: pat-surface
cur-pat: pat-surface
ground-pat: pat-surface
status: cshape-moving-flags
old-status: cshape-moving-flags
prev-status: cshape-moving-flags
reaction-flag: cshape-reaction-flags
reaction: function
no-reaction: function
local-normal: vector
surface-normal: vector
poly-normal: vector
ground-poly-normal: vector
ground-touch-point: vector
shadow-pos: vector
ground-impact-vel: meters
surface-angle: float
poly-angle: float
touch-angle: float
coverage: float
dynam: dynamics
surf: surface
unknown-vector00: vector
unknown-vector01: vector
unknown-vector02: vector
unknown-quaternion00: quaternion
unknown-quaternion01: quaternion
unknown-float00: float
unknown-float01: float
unknown-float02: float
unknown-vector10: vector
unknown-vector11: vector
unknown-vector12: vector
unknown-vector13: vector
unknown-vector14: vector
unknown-vector15: vector
unknown-vector16: vector
unknown-dynamics00: dynamics
unknown-surface00: surface
unknown-surface01: surface
unknown-cpad-info00: cpad-info
unknown-float10: float
unknown-float11: float
unknown-float12: float
unknown-float13: float
unknown-vector20: vector
unknown-vector21: vector
unknown-vector22: vector
unknown-vector23: vector
unknown-vector-array00: vector
unknown-vector30: vector
unknown-vector31: vector
unknown-float20: float
unknown-float21: float
unknown-dword00: uint64
unknown-matrix00: matrix
unknown-matrix01: matrix
unknown-matrix02: matrix
unknown-qword00: uint128
unknown-float30: float
unknown-vector40: vector
unknown-float40: float
unknown-float41: float
unknown-int00: int32
unknown-float50: float
unknown-vector50: vector
unknown-vector51: vector
unknown-vector52: vector
unknown-vector53: vector
last-known-safe-ground: vector
unknown-vector55: vector
unknown-dword10: time-frame
unknown-dword11: time-frame
unknown-float60: float
unknown-float61: float
unknown-float62: float
unknown-float63: float
unknown-float64: float
unknown-dword20: time-frame
unknown-dword21: time-frame
unknown-dword-coverage: int64
unknown-float-coverage-0: float
unknown-float-coverage-1: float
unknown-float-coverage-2: float
unknown-u32-coverage-0: uint32
unknown-vector-coverage-0: vector
unknown-vector-coverage-1: vector
unknown-vector-coverage-2: vector
unknown-vector-coverage-3: vector
unknown-vector60: vector
unknown-vector61: vector
unknown-float70: float
unknown-float71: float
unknown-vector70: vector
unknown-vector71: vector
unknown-vector72: vector
unknown-vector73: vector
unknown-handle00: handle
unknown-sphere-array00: collide-shape-prim-sphere
unknown-sphere00: collide-shape-prim-sphere
unknown-sphere01: collide-shape-prim-sphere
unknown-sphere02: collide-shape-prim-sphere
unknown-int50: int32
unknown-dword30: time-frame
unknown-dword31: time-frame
unknown-dword32: time-frame
unknown-dword33: time-frame
unknown-dword34: time-frame
unknown-dword35: time-frame
unknown-dword36: time-frame
unknown-float80: float
unknown-float81: float
unknown-float82: float
unknown-vector80: vector
unknown-cspace00: cspace
unknown-vector90: vector
unknown-vector91: vector
unknown-vector92: vector
unknown-cspace10: cspace
unknown-symbol00: symbol
unknown-float90: float
unknown-float91: float
unknown-vector-array10: vector
unknown-float100: float
unknown-int10: int32
unknown-float110: float
unknown-vector100: vector
unknown-vector101: vector
unknown-dword40: time-frame
unknown-dword41: time-frame
unknown-handle10: handle
unknown-uint20: uint32
unknown-spoolanim00: spool-anim
unknown-int20: int32
unknown-symbol20: symbol
unknown-float120: float
unknown-int21: int32
unknown-uint30: uint32
unknown-float121: float
unknown-uint31: uint32
unknown-int37: int32
unknown-float122: float
unknown-float123: float
unknown-float124: float
unknown-vector102: vector
unknown-vector103: vector
unknown-quaternion02: quaternion
unknown-quaternion03: quaternion
unknown-smush00: smush-control
unknown-vector110: vector
unknown-vector111: vector
unknown-symbol30: symbol
unknown-int31: uint32
unknown-dword50: int64
unknown-dword51: int64
unknown-pointer00: pointer
unknown-symbol40: symbol
unknown-dword60: int64
unknown-dword61: int64
unknown-dword62: int64
unknown-dword63: int64
unknown-halfword00: int16
history-length: int16
history-data: collide-history
unknown-float140: float
unknown-dword70: time-frame
unknown-int40: int32
unknown-dword80: time-frame
unknown-dword81: time-frame
unknown-float130: float
unknown-float131: float
unknown-dword82: time-frame
unknown-vector120: vector
unknown-float150: float
unknown-vector121: vector
wall-pat: pat-surface
unknown-soundid00: sound-id
unknown-float141: float
unknown-soundid01: sound-id
unknown-int34: int32
unknown-int35: int32
unknown-int36: int32

collide-touch-h

source

Types


touching-list

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

Tell the touching list that if we end taking a step of at least arg2, the prims arg0/arg1 will collide.
However, you don't have to know for sure if you're going to take this big of a step yet.
You can provide triangles if you want, but you don't have to.
The logic for calling this twice for the same prims in between calls to update-from-step-size is a little weird
so I suspect this never happens (and it's probably cheaper to avoid this duplication in the actual prim collision code).

touching-list-method-10: unknown
update-from-step-size(obj: touching-list, arg0: float) => nonesource

Given that we actually will take a step size of arg0, remove things we won't actually hit.

send-events-for-touching-shapes(obj: touching-list) => nonesource

Send all events for touching shapes.
Note that the order of event sending is basically random.
(this could explain lava walks's unreliable behavior)

get-shapes-entry(obj: touching-list, arg0: collide-shape, arg1: collide-shape) => touching-shapes-entrysource

Get a touching-shapes-entry for the two shapes. If one exists, it will be returned. Otherwise a new one will be made.

free-all-prim-nodes(obj: touching-list) => nonesource

Free all prim nodes used by all touching shapes in this touching-list.

touching-prim

touching-prim: structuresource
Fields
cprim: collide-shape-prim
has-tri?: symbol
tri: collide-tri-result

touching-prims-entry

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-touched-prim(obj: touching-prims-entry, arg0: trsqv, arg1: touching-shapes-entry) => collide-shape-primsource

Get the primitive belonging to the collide shape that is touching.

touching-prims-entry-method-10: unknown
get-middle-of-bsphere-overlap(obj: touching-prims-entry, arg0: vector) => vectorsource

This is a bit weird...
But assuming the the bounding spheres overlap, draw a line between their centers, consider the line segment
that is inside of both spheres, and get the midpoint of that.

get-touched-tri(obj: touching-prims-entry, arg0: collide-shape, arg1: touching-shapes-entry) => collide-tri-resultsource

Get the triangle belonging to the the collide shape that is touching (if it has one, otherwise #f)

touching-prims-entry-pool

touching-prims-entry-pool: structuresource
Fields
head: touching-prims-entry
nodes: touching-prims-entry
Methods
alloc-node(obj: touching-prims-entry-pool) => touching-prims-entrysource

Allocate a node. Will return #f if there are none left.

get-free-node-count(obj: touching-prims-entry-pool) => intsource

Get the number of nodes that are not in use.

init-list!(obj: touching-prims-entry-pool) => nonesource

Initialize all entries to be not allocated and in a linked list.

free-node(obj: touching-prims-entry-pool, arg0: touching-prims-entry) => touching-prims-entrysource

Free a node allocated with alloc-node

touching-shapes-entry

touching-shapes-entry: structuresource
Fields
cshape1: collide-shape
cshape2: collide-shape
resolve-u: int8
head: touching-prims-entry
Methods
touching-shapes-entry-method-9: unknown
get-touched-shape(obj: touching-shapes-entry, arg0: collide-shape) => collide-shapesource

Get the other shape in a pair of shapes.

touching-shapes-entry-method-11: unknown
prims-touching?(obj: touching-shapes-entry, arg0: collide-shape-moving, arg1: uint) => touching-prims-entrysource

In a pair of collide shapes, is a prim from the given collide shape with the given prim-id mask touching the other shape?

prims-touching-action?(obj: touching-shapes-entry, arg0: collide-shape, arg1: collide-action, arg2: collide-action) => touching-prims-entrysource

In a pair of collide shapes, find a pair of colliding prims where the prim from the given collide shape has at least one of the actions in arg1
and none of the actions in arg2.

touching-shapes-entry-method-14: unknown
free-touching-prims-list(obj: touching-shapes-entry) => symbolsource

Return all nodes used by this touching-shapes-entry to the touching-prims-entry-pool

get-head(obj: touching-shapes-entry) => touching-prims-entrysource

Get the first pair of touching prims in a touching-shapes-entry

get-next(obj: touching-shapes-entry, arg0: touching-prims-entry) => touching-prims-entrysource

Get the next pair of touching prims.

Variables


TOUCHING_LIST_LENGTH

TOUCHING_LIST_LENGTH: unknownsource

collide-touch

source

Types


add-prims-touching-work

add-prims-touching-work: structuresource

collide

source

Variables


*collide-vif0-init*

*collide-vif0-init*: arraysource

main-collide

source

Functions


drawable-sphere-box-intersect?

drawable-sphere-box-intersect?(arg0: drawable, arg1: bounding-box4w) => symbolsource

instance-sphere-box-intersect?

instance-sphere-box-intersect?(arg0: drawable, arg1: instance-tie, arg2: bounding-box4w) => symbolsource

instance-tfragment-add-debug-sphere

instance-tfragment-add-debug-sphere(arg0: drawable, arg1: instance-tie) => symbolsource

Types


pat-mode-info

pat-mode-info: structuresource
Fields
name: string
wall-angle: float
color: rgba
hilite-color: rgba

pat-surface

pat-surface: uint32source

Functions


pat-event->string

pat-event->string(pat: pat-surface) => stringsource

pat-material->string

pat-material->string(pat: pat-surface) => stringsource

pat-mode->string

pat-mode->string(pat: pat-surface) => stringsource

Variables


*pat-mode-info*

*pat-mode-info*: inline-arraysource

surface-h

source

Types


surface

surface: basicsource
Fields
type: type
name: symbol
turnv: float
turnvv: float
tiltv: float
tiltvv: float
transv-max: float
target-speed: float
seek0: float
seek90: float
seek180: float
fric: float
nonlin-fric-dist: float
slip-factor: float
slide-factor: float
slope-up-factor: float
slope-down-factor: float
slope-slip-angle: float
impact-fric: float
bend-factor: float
bend-speed: float
alignv: float
slope-up-traction: float
align-speed: float
active-hook: function
touch-hook: function
impact-hook: function
mult-hook: function
mode: symbol
flags: surface-flags
data: float
hook: function
dataw: uint32

Functions


calc-terminal-vel

calc-terminal-vel(arg0: float, arg1: float, arg2: float) => floatsource

calc-terminal2-vel

calc-terminal2-vel(arg0: float, arg1: float, arg2: float, arg3: float) => floatsource

calc-terminal4-vel

calc-terminal4-vel(arg0: float, arg1: float, arg2: float) => floatsource

surface-clamp-speed

surface-clamp-speed(arg0: surface, arg1: surface, arg2: surface, arg3: int) => nonesource

When arg3 is 1, clamp speed of arg0 to the mins of arg0/arg1

surface-interp!

surface-interp!(dst: surface, src0: surface, src1: surface, amount: float) => surfacesource

Create a surface between src0 and src1. For things like hooks/mode, src1 wins.

surface-mult!

surface-mult!(dst: surface, src0: surface, src1: surface) => surfacesource

Multiply src0 by src1, and store the result in dst.

Variables


*attack-mods*

*attack-mods*: surfacesource

*dive-bottom-mods*

*dive-bottom-mods*: surfacesource

*dive-mods*

*dive-mods*: surfacesource

*double-jump-mods*

*double-jump-mods*: surfacesource

*duck-attack-mods*

*duck-attack-mods*: surfacesource

*duck-mods*

*duck-mods*: surfacesource

*edge-grab-mods*

*edge-grab-mods*: surfacesource

*edge-surface*

*edge-surface*: surfacesource

*empty-mods*

*empty-mods*: surfacesource

*flip-jump-mods*

*flip-jump-mods*: surfacesource

*flop-land-mods*

*flop-land-mods*: surfacesource

*flop-mods*

*flop-mods*: surfacesource

*forward-high-jump-mods*

*forward-high-jump-mods*: surfacesource

*forward-jump-mods*

*forward-jump-mods*: surfacesource

*forward-pole-jump-mods*

*forward-pole-jump-mods*: surfacesource

*grab-mods*

*grab-mods*: surfacesource

*grass-surface*

*grass-surface*: surfacesource

*high-jump-mods*

*high-jump-mods*: surfacesource

*ice-surface*

*ice-surface*: surfacesource

*jump-attack-mods*

*jump-attack-mods*: surfacesource

*jump-mods*

*jump-mods*: surfacesource

*launch-jump-mods*

*launch-jump-mods*: surfacesource

*neutral-mods*

*neutral-mods*: surfacesource

*pole-mods*

*pole-mods*: surfacesource

*quicksand-surface*

*quicksand-surface*: surfacesource

*run-attack-mods*

*run-attack-mods*: surfacesource

*slope-surface*

*slope-surface*: surfacesource

*smack-jump-mods*

*smack-jump-mods*: surfacesource

*standard-ground-surface*

*standard-ground-surface*: surfacesource

*stone-surface*

*stone-surface*: surfacesource

*swim-mods*

*swim-mods*: surfacesource

*swim-surface*

*swim-surface*: surfacesource

*tar-surface*

*tar-surface*: surfacesource

*tread-surface*

*tread-surface*: surfacesource

*turn-around-mods*

*turn-around-mods*: surfacesource

*uppercut-jump-mods*

*uppercut-jump-mods*: surfacesource

*wade-mods*

*wade-mods*: surfacesource

*wade-surface*

*wade-surface*: surfacesource

*walk-mods*

*walk-mods*: surfacesource

*walk-no-turn-mods*

*walk-no-turn-mods*: surfacesource

*wheel-flip-mods*

*wheel-flip-mods*: surfacesource

*wheel-mods*

*wheel-mods*: surfacesource