#define o gCurrentObject in object_list_processor.h

This commit is contained in:
Arceveti committed 2021-09-28 15:42:41 -07:00
1 parent 51f7679208
commit 4ec50b8123
18 files changed
+145 -186

No files matched your search

+6 -26
View File
@@ -568,9 +568,9 @@ void mtxf_to_mtx(void *dest, void *src) {
/**
* Set 'mtx' to a transformation matrix that rotates around the z axis.
*/
#define MATENTRY(a, b) \
((s16 *) mtx)[a] = ((s32) b) >> 16; \
((s16 *) mtx)[a + 16] = ((s32) b) & 0xFFFF;
#define MATENTRY(a, b) \
((s16 *) mtx)[a ] = (((s32) b) >> 16); \
((s16 *) mtx)[a + 16] = (((s32) b) & 0xFFFF);
void mtxf_rotate_xy(Mtx *mtx, s32 angle) {
register s32 i = coss(angle) * 65536;
register s32 j = sins(angle) * 65536;
@@ -580,10 +580,10 @@ void mtxf_rotate_xy(Mtx *mtx, s32 angle) {
*temp = 0;
temp++;
}
MATENTRY(0, i)
MATENTRY(1, j)
MATENTRY(0, i)
MATENTRY(1, j)
MATENTRY(4, -j)
MATENTRY(5, i)
MATENTRY(5, i)
((s16 *) mtx)[10] = 1;
((s16 *) mtx)[15] = 1;
}
@@ -1087,23 +1087,3 @@ s32 anim_spline_poll(Vec3f result) {
return hasEnded;
}
/// Multiply vector 'dest' by a
void vec3f_mul(Vec3f dest, f32 a) {
vec3_mul_val(dest, a);
}
/// Get length of vector 'a'
f32 vec3f_length(Vec3f a) {
return sqrtf(sqr(a[0]) + sqr(a[1]) + sqr(a[2]));
}
/// Get dot product of vectors 'a' and 'b'
f32 vec3f_dot(Vec3f a, Vec3f b) {
return vec3_dot(a, b);
}
/// Make 'dest' the difference of vectors a and b.
void vec3f_dif(Vec3f dest, Vec3f a, Vec3f b) {
vec3_diff(dest, a, b);
}
+6 -6
View File
@@ -690,25 +690,25 @@ void load_object_surfaces(TerrainData **data, TerrainData *vertexData) {
#ifdef AUTO_COLLISION_DISTANCE
// From Kaze
static void get_optimal_coll_dist(struct Object *o) {
static void get_optimal_coll_dist(struct Object *obj) {
register f32 thisVertDist, maxDist = 0.0f;
Vec3f v;
TerrainData *collisionData = gCurrentObject->collisionData;
o->oFlags |= OBJ_FLAG_DONT_CALC_COLL_DIST;
obj->oFlags |= OBJ_FLAG_DONT_CALC_COLL_DIST;
collisionData++;
register u32 vertsLeft = *(collisionData);
collisionData++;
// vertices = *data;
while (vertsLeft) {
v[0] = *(collisionData + 0) * o->header.gfx.scale[0];
v[1] = *(collisionData + 1) * o->header.gfx.scale[1];
v[2] = *(collisionData + 2) * o->header.gfx.scale[2];
v[0] = *(collisionData + 0) * obj->header.gfx.scale[0];
v[1] = *(collisionData + 1) * obj->header.gfx.scale[1];
v[2] = *(collisionData + 2) * obj->header.gfx.scale[2];
thisVertDist = (sqr(v[0]) + sqr(v[1]) + sqr(v[2]));
if (thisVertDist > maxDist) maxDist = thisVertDist;
collisionData += 3;
vertsLeft--;
}
o->oCollisionDistance = (sqrtf(maxDist) + 100.0f);
obj->oCollisionDistance = (sqrtf(maxDist) + 100.0f);
}
#endif