Skip to main content

bounding-box-h

source

Types


bounding-box

bounding-box: structuresource
Fields
min: vector
max: vector
Methods
add-spheres!(obj: bounding-box, spheres: inline-array, count: int) => intsource

Add count spheres.

add-point!(obj: bounding-box, arg0: vector3s) => intsource

Expand the box if needed to contain the given point

set-from-point-offset!(obj: bounding-box, arg0: vector3s, arg1: vector3s) => intsource

Set box to smallest containing the points arg0, (arg0 + arg1)

set-from-point-offset-pad!(obj: bounding-box, arg0: vector3s, arg1: vector3s, arg2: float) => intsource

Set the box size to contain pt, pt + offset, with some padding

set-from-sphere!(obj: bounding-box, arg0: sphere) => intsource

Set the box size to contain the given sphere

set-from-spheres!(obj: bounding-box, spheres: inline-array, count: int) => intsource

Reset box to hold the given spheres. Note: this implementation could be optimized.

add-box!(obj: bounding-box, arg0: bounding-box) => intsource

Expand the box if needed to contain the given box

bounding-box-both

bounding-box-both: structuresource

bounding-box4w

bounding-box4w: structuresource
Fields
min: vector4w
max: vector4w

bounding-box

source

Functions


box-vector-enside?

box-vector-enside?(box: bounding-box, pt: vector) => symbolsource

Is the point in the box? On the edge doesn't count

box-vector-inside?

box-vector-inside?(box: bounding-box, pt: vector) => symbolsource

Is the point in the box? On the edge counts.

cylinder

source

Types


cylinder-flat-verts

cylinder-flat-verts: structuresource
Fields
vert: vector

cylinder-verts

cylinder-verts: structuresource
Fields
vert: vector

Functions


ray-arbitrary-circle-intersect

ray-arbitrary-circle-intersect(probe-origin: vector, probe-dir: vector, circle-origin: vector, circle-normal: vector, radius: float) => floatsource

Intersect a ray with a non-axis-aligned circle.

geometry-h

source

Types


border-plane

border-plane: basicsource
Fields
type: type
name: symbol
action: basic
slot: int8
trans: vector
normal: vector
Methods
debug-draw!(obj: border-plane) => nonesource

Debug draw a border plane with a vector and text.

point-past-plane?(obj: border-plane, arg0: vector) => symbolsource

Which side of the plane is the given point on?
#t = on the plane, or on the side the normal points toward.

curve

curve: structuresource
Fields
cverts: inline-array
num-cverts: int32
knots: pointer
num-knots: int32
length: float

Variables


MAX_CURVE_CONTROL_POINTS

MAX_CURVE_CONTROL_POINTS: unknownsource

geometry

source

Functions


calculate-basis-functions-vector!

calculate-basis-functions-vector!(arg0: vector, arg1: int, arg2: float, arg3: pointer) => vectorsource

Calculate polynomial basis for a given control point.

circle-circle-xz-intersect

circle-circle-xz-intersect(arg0: sphere, arg1: sphere, arg2: vector, arg3: vector) => intsource

circle-test

circle-test() => nonesource

Test the circle-circle-xz-intersect function.

closest-pt-in-triangle

closest-pt-in-triangle(arg0: vector, arg1: vector, arg2: matrix, arg3: vector) => nonesource

arg2 is the vertices of the triangle, arg3 is the normal, arg1 is the input point, arg0 is the output.

curve-closest-point

curve-closest-point(arg0: curve, arg1: vector, arg2: float, arg3: float, arg4: int, arg5: float) => floatsource

Get the input value for the point on the curve. Approximate! And is O(n_knots)

curve-copy!

curve-copy!(arg0: curve, arg1: curve) => curvesource

Shallow copy a curve.

curve-evaluate!

curve-evaluate!(arg0: vector, arg1: float, arg2: inline-array, arg3: int, arg4: pointer, arg5: int) => vectorsource

Evaluate a curve.
arg0 is the output
arg1 is the input.
arg2 is control vertices
arg3 is the number of control vertices
arg4 is the knot points
arg5 is the number of knots

curve-get-pos!

curve-get-pos!(arg0: vector, arg1: float, arg2: curve) => vectorsource

Get the position on the curve at the given input.

curve-length

curve-length(arg0: curve) => floatsource

Compute the approximate curve length as the sum of distances between knots.

find-knot-span

find-knot-span(arg0: int, arg1: int, arg2: float, arg3: inline-array) => intsource

Binary serach over knots to find which contains the value float in (arg0 arg1). Unused.

forward-down->inv-matrix

forward-down->inv-matrix(arg0: matrix, arg1: vector, arg2: vector) => matrixsource

Create a matrix representing an inverse transform where arg1 is forward (+z) and arg2 is down (-y). Will have the pitch of forward

forward-down-nopitch->inv-matrix

forward-down-nopitch->inv-matrix(arg0: matrix, arg1: vector, arg2: vector) => matrixsource

Create a matrix representing an inverse transform where arg1 is forward (+z) and arg2 is down (-y). Will not use the pitch of forward

forward-up->quaternion

forward-up->quaternion(arg0: quaternion, arg1: vector, arg2: vector) => quaternionsource

Create a quaternion representing a transform where arg1 is forward (+z) and arg2 is up (+y). Will use the pitch of forward

forward-up-nopitch->inv-matrix

forward-up-nopitch->inv-matrix(arg0: matrix, arg1: vector, arg2: vector) => matrixsource

Create a matrix representing an inverse transform where arg1 is forward (+z) and arg2 is up (+y). Will not use the pitch of forward

forward-up-nopitch->quaternion

forward-up-nopitch->quaternion(arg0: quaternion, arg1: vector, arg2: vector) => quaternionsource

Create a quaternion representing a transform where arg1 is forward (+z) and arg2 is up (+y). Will not use the pitch of forward

matrix-from-two-vectors!

matrix-from-two-vectors!(arg0: matrix, arg1: vector, arg2: vector) => matrixsource

Create a rotation matrix representing the rotation between two vectors

matrix-from-two-vectors-max-angle!

matrix-from-two-vectors-max-angle!(arg0: matrix, arg1: vector, arg2: vector, arg3: float) => matrixsource

Create a rotation matrix representing the rotation between two vectors, allowing at most a rotation of arg3 degrees

matrix-from-two-vectors-max-angle-partial!

matrix-from-two-vectors-max-angle-partial!(arg0: matrix, arg1: vector, arg2: vector, arg3: float, arg4: float) => matrixsource

Create a rotation matrix representing the rotation between two vectors, allowing at most a rotation of arg3 degrees,
doing arg4 fraction of the rotation.

matrix-from-two-vectors-partial-linear!

matrix-from-two-vectors-partial-linear!(arg0: matrix, arg1: vector, arg2: vector, arg3: float) => matrixsource

Create a rotation matrix representing doing arg3 fraction of the rotation between two vectors

matrix-remove-z-rot

matrix-remove-z-rot(arg0: matrix, arg1: matrix) => matrixsource

Remove the z rotation component of a rotation.

matrix-rot-diff!

matrix-rot-diff!(arg0: vector, arg1: matrix, arg2: matrix) => floatsource

Get the difference of rotation between two matrices, expressed as a quaternion.

normal-of-plane

normal-of-plane(arg0: vector, arg1: vector, arg2: vector, arg3: vector) => vectorsource

Given three points on a plane, compute the plane's normal

point-in-plane-<-point+normal!

point-in-plane-<-point+normal!(arg0: vector, arg1: vector, arg2: vector) => vectorsource

This function looks wrong and is unused.

point-in-triangle-cross

point-in-triangle-cross(arg0: vector, arg1: vector, arg2: vector, arg3: vector, arg4: vector) => symbolsource

Check if point is in the triangle using cross product check (so you have to get the order of points right)

quaternion-from-two-vectors!

quaternion-from-two-vectors!(arg0: quaternion, arg1: vector, arg2: vector) => quaternionsource

Create a quaternion representing the rotation between two vectors

quaternion-from-two-vectors-max-angle!

quaternion-from-two-vectors-max-angle!(arg0: quaternion, arg1: vector, arg2: vector, arg3: float) => quaternionsource

Create a quaternion representing the rotation between two vectors, allowing at most a rotation of arg3 degrees

quaternion-seek

quaternion-seek(arg0: quaternion, arg1: quaternion, arg2: quaternion, arg3: float, arg4: float) => quaternionsource

Strange quaternion rotate toward function. Arg3 is ignored. Arg4 is the max seek amount.

vector-3pt-cross!

vector-3pt-cross!(arg0: vector, arg1: vector, arg2: vector, arg3: vector) => vectorsource

Cross product of 2 - 1 and 3 - 1. (will give a normal to the plane, but not of magnitude 1)

vector-circle-tangent

vector-circle-tangent(arg0: vector, arg1: vector, arg2: vector, arg3: vector) => nonesource

Also unused.

vector-circle-tangent-new

vector-circle-tangent-new(arg0: vector, arg1: vector, arg2: vector, arg3: vector) => nonesource

Unused.

vector-deg-seek

vector-deg-seek(arg0: vector, arg1: vector, arg2: vector, arg3: float) => vectorsource

Make one vector closer to another, doing at most a rotation by arg3 degrees.

vector-deg-slerp

vector-deg-slerp(arg0: vector, arg1: vector, arg2: vector, arg3: float) => vectorsource

Slerp for vectors. (imagine that they are the z axis of two frames)

vector-flatten!

vector-flatten!(dst: vector, src: vector, plane-normal: vector) => vectorsource

Get the projection of src onto a plane with the given normal
The normal should have magnitude 1.0.

vector-line-distance

vector-line-distance(arg0: vector, arg1: vector, arg2: vector) => floatsource

Weird function: given a point arg1, and an infinite line connecting arg2 and arg1, compute the distance
from arg0 to that line.

vector-line-distance-point!

vector-line-distance-point!(arg0: vector, arg1: vector, arg2: vector, arg3: vector) => floatsource

Same as above function, but returns the point on arg2/arg1 in arg3 (ignored if #f)

vector-orient-by-quat!

vector-orient-by-quat!(arg0: vector, arg1: vector, arg2: quaternion) => vectorsource

Rotate a vector by a quaternion.

vector-plane-distance

vector-plane-distance(arg0: vector, arg1: plane, arg2: vector) => floatsource

Unused.

vector-reflect!

vector-reflect!(dst: vector, src: vector, plane-normal: vector) => vectorsource

Reflect a vector off of a plane.

vector-reflect-flat!

vector-reflect-flat!(dst: vector, src: vector, plane-normal: vector) => vectorsource

This is a weird one. It doesn't care about the value of src dot normal
and it effectively replaces the component of src normal to the plane with
the plane's normal. I think this requires src/normal to both be unit vectors
in order to make sense.
NOTE: src should point from positive halfspace to negative otherwise it
doesn't work.

vector-reflect-flat-above!

vector-reflect-flat-above!(dst: vector, src: vector, plane-normal: vector) => vectorsource

A hacked up version of reflect, probably to make their collision system work.
It is a less aggressive version of reflect that also has a limit to the output
normal component

vector-reflect-true-flat!

vector-reflect-true-flat!(dst: vector, src: vector, plane-normal: vector) => vectorsource

Not really a reflect. Same as flatten

vector-segment-distance-point!

vector-segment-distance-point!(arg0: vector, arg1: vector, arg2: vector, arg3: vector) => floatsource

Compute the distance from a point to the closest point on the line segment.
arg0 is the point. arg1/arg2 are the endpoints of the line segment.
arg3 is an optional output closest point.

vector-vector-deg-slerp!

vector-vector-deg-slerp!(arg0: vector, arg1: vector, arg2: vector, arg3: float, arg4: vector) => vectorsource

unused. no clue what this does.

path-h

source

Types


curve-control

curve-control: path-controlsource
Fields
type: type
flags: path-control-flag
name: symbol
process: process-drawable
curve: curve
num-cverts: int32
cverts: inline-array

path-control

path-control: basicsource
Fields
type: type
flags: path-control-flag
name: symbol
process: process-drawable
curve: curve
num-cverts: int32
cverts: inline-array
Methods
debug-draw(obj: path-control) => nonesource
eval-path-curve-div!(obj: path-control, arg0: vector, arg1: float, arg2: symbol) => vectorsource
get-random-point(obj: path-control, arg0: vector) => vectorsource
path-control-method-12(obj: path-control, arg0: vector, arg1: float) => vectorsource
eval-path-curve!(obj: path-control, arg0: vector, arg1: float, arg2: symbol) => vectorsource
path-control-method-14(obj: path-control, arg0: vector, arg1: float) => vectorsource
length-as-float(obj: path-control) => floatsource

Get the number of edges as a float

path-distance(obj: path-control) => floatsource
get-num-verts(obj: path-control) => intsource

Get the number of vertices

should-display?(obj: path-control) => symbolsource

Should we display path marks?

path-control-method-19(obj: path-control) => floatsource
path-control-method-20(obj: path-control) => floatsource

Types


plane-volume

plane-volume: structuresource
Fields
volume-type: symbol
point-count: int16
normal-count: int16
first-point: pointer
first-normal: pointer
num-planes: int32
plane: inline-array
Methods
init-vol!(obj: plane-volume, arg0: symbol, arg1: vector-array, arg2: vector-array) => symbolsource
debug-draw(obj: plane-volume) => nonesource
point-in-vol?(obj: plane-volume, arg0: vector, arg1: float) => symbolsource

vol-control

vol-control: basicsource
Fields
type: type
flags: uint32
process: process-drawable
pos-vol-count: int32
pos-vol: plane-volume
neg-vol-count: int32
neg-vol: plane-volume
debug-point: vector-array
debug-normal: vector-array
Methods
init!(obj: vol-control) => symbolsource
point-in-vol?(obj: vol-control, arg0: vector) => symbolsource
vol-control-method-11(obj: vol-control) => symbolsource

Functions


plane-volume-intersect-dist

plane-volume-intersect-dist(arg0: vector, arg1: vector, arg2: vector) => floatsource