Types
bone-calculation: structuresource
Fields
flags: bone-calc-flags
num-bones: uint16
matrix-area: inline-array
joints: inline-array
bones: inline-array
ripple-scale: float
ripple-y-scale: float
ripple-normal-scale: float
ripple-area: inline-array
ripple-vec: vector
next: bone-calculation
dummy-1: uint32
dummy-2: uint32
dummy-3: uint32
bone-layout: structuresource
bone-memory: structuresource
bone-regs: structuresource
Fields
dma-buf: basic
wait-count: uint32
in-count: uint32
sp-size: uint32
sp-bufnum: uint32
joint-ptr: inline-array
bone-ptr: inline-array
num-bones: uint32
mtxs: inline-array
bone-work: structuresource
Expand description
bones, joints, cspace, matrix, joint-anim-frames...
The "joints" define the structure of the skeleton, just storing a bind pose, and parent info. These don't change,
and are loaded as part of the skeleton. The actual joint objects are stored in the art-joint-geo.
The "do-joint-math" method of process-drawable is responsible for computing the joint-anim-frame and the bones.
The "cspace" system is used to compute bones from joint-anim-frames.
The "joint-anim-frame" is a list of transformqs for the relative transform between bones.
The "bones" are the world space transform of each 'bone'
The "do-joint-math" function does:
- call the generate-frame-function callback to generate a joint-anim-frame (does the joint anim decompress/blending)
- call the prebind-function which can modify the relative transforms (eg: joint-mods)
- walk the tree of joints, computing bones using the cspace
- call the postbind-function, for other effects.
The "bones" system creates matrices for foreground renderers from bones/joints.
The inputs are bones/joints, and the output is pris-mtx, which is a 4x4 "t-mtx" for transforming, and a 3x3 (stored in 3 vec4's)
n-mtx for rotating normals.
all matrices are calculated at once, and shared between merc/emerc/gmerc/shadow
this is done by a linked list of "bone calculations", which is stashed in the dma buffer.
Types
bone-calculation-list: structuresource
Functions
bone-list-init() => nonesource
Reset bone calculation list to have nothing in it.
bones-debug() => nonesource
bones-init(arg0: dma-buffer) => nonesource
Initialize scratchpad/vu0 for BONE MATH.
bones-mtx-calc-execute() => nonesource
Execute all bone matrix calculations.
bones-reset-sqwc() => nonesource
Reset sqwc so DMA works normally again (see bones-set-sqwc)
bones-set-sqwc() => nonesource
Set the sqwc register so the DMA transfer of joints skips the metadata and just transfers the bind-pose.
dump-bone-mem() => nonesource
dump-qword(arg0: qword) => nonesource
Variables
const bones-vu0-block: vu-functionsource
Types
eye: structuresource
eye-control: structuresource
eye-control-array: basicsource
eye-control-arrays: basicsource
eye-work: structuresource
Fields
sprite-tmpl: dma-gif-packet
sprite-tmpl2: dma-gif-packet
adgif-tmpl: dma-gif-packet
blink-table: float
Variables
Functions
convert-eye-data(arg0: eye, arg1: uint) => floatsource
get-eye-block(arg0: int, arg1: int) => intsource
merc-eye-anim(arg0: process-drawable) => nonesource
render-eyes-32(arg0: dma-buffer, arg1: eye-control, arg2: int) => pointersource
render-eyes-32-different(arg0: dma-buffer, arg1: eye-control, arg2: int) => pointersource
render-eyes-64(arg0: dma-buffer, arg1: eye-control, arg2: int) => pointersource
render-eyes-64-different(arg0: dma-buffer, arg1: eye-control, arg2: int) => pointersource
set-eye-draw-flag(arg0: symbol, arg1: int, arg2: int) => nonesource
update-eyes() => nonesource
Variables
Types
foreground-bucket: structuresource
foreground-bucket-grid: structuresource
foreground-globals: structuresource
Fields
foreground-grid: foreground-bucket-grid
merc-bucket-info: merc-bucket-info
texscroll: texscroll-globals
foreground-level-buckets: structuresource
Fields
data: foreground-bucket
foreground-regs: structuresource
Fields
dist: float
merc-used: uint32
emerc-used: uint32
mercneric-used: uint32
use-isometric: uint32
base-start: dma-packet
joint-ptr: inline-array
bone-ptr: inline-array
num-bones: uint32
mtxs: inline-array
dma-buf: dma-buffer
default-texture-index: uint32
mercneric-chain: mercneric-chain
level-buckets: foreground-level-buckets
foreground-work: structuresource
Fields
regs: foreground-regs
draw-index-map: uint8
grid: foreground-bucket-grid
bounds: sphere
lights: vu-lights
distance: vector
next-tmpl: dma-packet
merc-bucket-info: structuresource
Fields
light: vu-lights
needs-clip: int32
need-mercprime-if-merc: int32
must-use-mercneric-for-clip: int32
effect: merc-effect-bucket-info
merc-chain: structuresource
merc-effect-bucket-info: structuresource
mercneric-chain: structuresource
shadow-dma-packet: structuresource
Fields
tag: generic-merc-tag
settings: shadow-settings
geo-ref: dma-packet
mtx-ref: dma-packet
end-tag: dma-packet
texscroll-globals: structuresource
Functions
invalidate-cache-line(arg0: pointer) => intsource
Variables
Types
pc-merc-flags: structuresource
Functions
foreground-add-mtx-calc(arg0: bone-calculation, arg1: inline-array, arg2: bone-calc-flags) => bone-calculationsource
foreground-draw(dc: draw-control, dma-buf: dma-buffer, dist-in: float) => nonesource
foreground-emerc(arg0: draw-control, arg1: inline-array, arg2: pointer, arg3: object, arg4: int, arg5: int) => pointersource
foreground-generic-merc-add-fragments(arg0: merc-effect, arg1: pointer, arg2: mercneric-chain) => pointersource
Add fragments from a merc-effect to the generic chain.
foreground-generic-merc-death(arg0: draw-control, arg1: generic-merc-ctrl) => nonesource
Modify a generic-merc-ctrl to set up merc-death effect.
foreground-init() => nonesource
foreground-ripple(arg0: draw-control, arg1: merc-ctrl, arg2: pointer, arg3: int) => pointersource
foreground-shadow(draw-ctrl: draw-control, arg1: inline-array, arg2: pointer) => pointersource
foreground-wrapup() => nonesource
generic-bucket-state-init(arg0: generic-bucket-state) => nonesource
Generic buckets double buffer across models and store their state in generic-bucket-state.
Reset a state for the first transfer
mercneric-chain-init(arg0: mercneric-chain, arg1: bucket-id) => nonesource
Initialize a mercneric chain. (generic chain specific to merc)
pc-draw-bones(dc: draw-control, dma-buf: pointer, matrix-buf: pointer) => pointersource
Add a dma packet to tell the PC renderer which model we are renderering.
pc-merc-draw-request(dc: draw-control, dma-buf: pointer, matrix-buf: pointer, tex-idx: int, update-verts: symbol) => pointersource
Send a request to PC Merc2 to draw the given object.
Only draws the effects which match this texture index.
Just places a single big dma packet, you have to patch the end yourself.
texscroll-execute() => nonesource
texscroll-make-request(arg0: merc-effect) => nonesource
vu-lights<-light-group!(arg0: vu-lights, arg1: light-group) => nonesource
vu1-bucket-map(arg0: int, arg1: int, arg2: merc-mode) => bucket-idsource
level, tex, mode -> bucket.
Variables
*bucket-map*: pointersource
const foreground-vu0-block: vu-functionsource
Types
ripple-globals: structuresource
ripple-request: structuresource
Functions
ripple-add-debug-sphere(arg0: process-drawable, arg1: vector, arg2: float, arg3: float) => nonesource
ripple-execute() => nonesource
Iterate through ripple-globals requests, from the end to index 0
For each request, if it has a waveform
create the wave-table via ripple-create-wave-table
Then for each waveform
apply the effect
using ripple-apply-wave-table
Once completed, all requests
have been processed and the count
is reset to 0
ripple-find-height(arg0: process-drawable, arg1: int, arg2: vector) => floatsource
ripple-make-request(waveform: ripple-wave, effect: merc-effect) => nonesource
Iterate through ripple-globals requests
looking for the one that matches the provided effect
If NOT found, append a new ripple-request with the providded effect
and waveform
to the end of the requests
.
NOTE: There can only be 16 effects at a given time, NOOP if already at that limit!
ripple-slow-add-sine-waves(arg0: ripple-wave-set, arg1: float, arg2: float) => floatsource
ripple-update-waveform-offs(arg0: ripple-wave-set, arg1: clock) => nonesource
Variables
*ripple-globals*: ripple-globalssource
A collection of ripple-request (max of 16)