summaryrefslogtreecommitdiff
path: root/src/code/sys_math3d.c
diff options
context:
space:
mode:
authorplayerskel <97991990+playerskel@users.noreply.github.com>2022-03-10 21:21:46 +0100
committerGitHub <noreply@github.com>2022-03-10 21:21:46 +0100
commita160fb96c86a191f887bea1ec7e078218902922c (patch)
tree152c3adae636602d5941940a94525c6e4b9e7b17 /src/code/sys_math3d.c
parentc55a8530eea7da8a73eb8c7b5f2d340ac686ed7a (diff)
Naming1 (#1113)
* typo * rename 800636C0 to gameinfo_init * fix incorrect casing in cup button * some constants * add item00_none enum value * rename 80009460 to gdmaverbose * fix typos * Revert "some constants" This reverts commit 27a07204d79c91c508e896ccdc766afb31119059. * rename gdmaverbose to gdmamgrverbose * Revert "rename 800636C0 to gameinfo_init" This reverts commit c74e255929fb9d46be146ee66d37ddb7585b9c9d. * Revert "fix incorrect casing in cup button" This reverts commit ac313b3965591302936d9f5ae0ba0a8f69569f73. * a couple of typos * minor changes based on clang-format
Diffstat (limited to 'src/code/sys_math3d.c')
-rw-r--r--src/code/sys_math3d.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/src/code/sys_math3d.c b/src/code/sys_math3d.c
index d0b286c19..12b59fb5c 100644
--- a/src/code/sys_math3d.c
+++ b/src/code/sys_math3d.c
@@ -239,7 +239,7 @@ f32 Math3D_Cos(Vec3f* a, Vec3f* b) {
}
/**
- * Calculates the cosine between bectors `a` and `b` and places the result in `ret`
+ * Calculates the cosine between vectors `a` and `b` and places the result in `ret`
* returns true if the cosine cannot be calculated because the product of the magnitudes is zero
*/
s32 Math3D_CosOut(Vec3f* a, Vec3f* b, f32* dst) {
@@ -876,9 +876,9 @@ void Math3D_RotateXZPlane(Vec3f* pointOnPlane, s16 angle, f32* a, f32* c, f32* d
}
/*
- * Defines a plane from verticies `va`, `vb`, and `vc`. Normal components are output to
+ * Defines a plane from vertices `va`, `vb`, and `vc`. Normal components are output to
* `nx`, `ny`, and `nz`. Distance from the origin is output to `originDist`
- * Satisifes the plane equation NxVx + NyVy + NzVz + D = 0
+ * Satisfies the plane equation NxVx + NyVy + NzVz + D = 0
*/
void Math3D_DefPlane(Vec3f* va, Vec3f* vb, Vec3f* vc, f32* nx, f32* ny, f32* nz, f32* originDist) {
static Vec3f normal;
@@ -1340,7 +1340,7 @@ s32 Math3D_LineSegFindPlaneIntersect(f32 pointADist, f32 pointBDist, Vec3f* poin
}
/**
- * Determines if the line segement from `linePointA` to `linePointB` crosses the plane
+ * Determines if the line segment from `linePointA` to `linePointB` crosses the plane
* from `nx` + `ny` + `nz` + `originDist` = 0. If fromFront is set, then detection will only
* be true if point A crosses from the front of the plane
*/
@@ -1366,7 +1366,7 @@ s32 Math3D_LineSegVsPlane(f32 nx, f32 ny, f32 nz, f32 originDist, Vec3f* linePoi
}
/*
- * Determines if the line formed by `linePiontA` and `linePointB` intersect with Triangle formed from
+ * Determines if the line formed by `linePointA` and `linePointB` intersect with Triangle formed from
* vertices `v0`, `v1`, and `v2` with normal vector `nx`, `ny`, and `nz` with plane distance from origin
* `originDist` Outputs the intersection point at to `intersect`
* Returns 1 if the line intersects with the triangle, 0 otherwise
@@ -1404,7 +1404,6 @@ void Math3D_TriNorm(TriNorm* tri, Vec3f* va, Vec3f* vb, Vec3f* vc) {
* Determines if point `point` lies within `sphere`
*/
s32 Math3D_PointInSph(Sphere16* sphere, Vec3f* point) {
-
if (Math3D_DistXYZ16toF(&sphere->center, point) < sphere->radius) {
return true;
}
@@ -1412,9 +1411,9 @@ s32 Math3D_PointInSph(Sphere16* sphere, Vec3f* point) {
}
/**
- * Determines the distance from point (`x0`,`y0`) to the line fromed from (`x1`,`y1`) and (`x2`,`y2`)
+ * Determines the distance from point (`x0`,`y0`) to the line formed from (`x1`,`y1`) and (`x2`,`y2`)
* Distance squared is output to `lineLenSq`, returns true if the point perpendicular from (`x0`,`y0`)
- * is contained within the segement between (`x1`,`y1`) and (`x2`,`y2`)
+ * is contained within the segment between (`x1`,`y1`) and (`x2`,`y2`)
*/
s32 Math3D_PointDistToLine2D(f32 x0, f32 y0, f32 x1, f32 y1, f32 x2, f32 y2, f32* lineLenSq) {
static Vec3f perpendicularPoint;
@@ -1832,7 +1831,7 @@ s32 Math3D_CylTriVsIntersect(Cylinder16* cyl, TriNorm* tri, Vec3f* intersect) {
if (((tri->vtx[0].y < cylBottom) && (tri->vtx[1].y < cylBottom) && (tri->vtx[2].y < cylBottom)) ||
((cylTop < tri->vtx[0].y) && (cylTop < tri->vtx[1].y) && (cylTop < tri->vtx[2].y))) {
- // If all of the verticies are below or all of the verticies are above the cylinder.
+ // If all of the vertices are below or all of the vertices are above the cylinder.
return false;
}
@@ -1912,7 +1911,7 @@ s32 Math3D_CylVsTri(Cylinder16* cyl, TriNorm* tri) {
}
/*
- * Deteremines if two spheres are touching.
+ * Determines if two spheres are touching.
*/
s32 Math3D_SphVsSph(Sphere16* sphereA, Sphere16* sphereB) {
f32 overlapSize;
@@ -2021,7 +2020,7 @@ s32 Math3D_CylOutsideCyl(Cylinder16* ca, Cylinder16* cb, f32* deadSpace) {
/*
* returns 1 if cylinder `ca` is outside cylinder `cb`.
* Sets `xzDist` to the xz distance between the centers of the cylinders.
- * Sets `deadSpace` to the mininum space between the cylinders not occupied by the other.
+ * Sets `deadSpace` to the minimum space between the cylinders not occupied by the other.
*/
s32 Math3D_CylOutsideCylDist(Cylinder16* ca, Cylinder16* cb, f32* deadSpace, f32* xzDist) {
static Cylinderf caf;
@@ -2059,7 +2058,6 @@ s32 Math3D_CylOutsideCylDist(Cylinder16* ca, Cylinder16* cb, f32* deadSpace, f32
* intersection is output to `intersect.
* Returns 1 is the triangles intersect, 0 otherwise
*/
-
s32 Math3D_TriVsTriIntersect(TriNorm* ta, TriNorm* tb, Vec3f* intersect) {
f32 dist0;
f32 dist1;