reverted geo bone (#474)

This commit is contained in:
thecozies
2022-09-21 19:14:12 -05:00
committed by GitHub
parent d5019ffd78
commit c09f178df0
6 changed files with 3 additions and 131 deletions

View File

@@ -58,7 +58,6 @@ enum GeoLayoutCommands {
/*0x1E*/ GEO_CMD_NOP_1E,
/*0x1F*/ GEO_CMD_NOP_1F,
/*0x20*/ GEO_CMD_NODE_CULLING_RADIUS,
/*0x21*/ GEO_CMD_BONE,
};
// geo layout macros
@@ -468,20 +467,4 @@ enum GeoLayoutCommands {
#define GEO_CULLING_RADIUS(cullingRadius) \
CMD_BBH(GEO_CMD_NODE_CULLING_RADIUS, 0x00, cullingRadius)
/**
* 0x21: Create a scene graph node that is rotated by the object's animation + an initial rotation.
* u8 drawingLayer
* s16 xTranslation
* s16 yTranslation
* s16 zTranslation
* s16 xRotation
* s16 yRotation
* s16 zRotation
* u32 displayList: dislay list segmented address
*/
#define GEO_BONE(layer, tx, ty, tz, rx, ry, rz, displayList) \
CMD_BBH(GEO_CMD_BONE, layer, 0x0000), \
CMD_HHHHHH(tx, ty, tz, rx, ry, rz), \
CMD_PTR(displayList)
#endif // GEO_COMMANDS_H

View File

@@ -42,7 +42,6 @@ GeoLayoutCommandProc GeoLayoutJumpTable[] = {
/*GEO_CMD_NOP_1E */ geo_layout_cmd_nop2,
/*GEO_CMD_NOP_1F */ geo_layout_cmd_nop3,
/*GEO_CMD_NODE_CULLING_RADIUS */ geo_layout_cmd_node_culling_radius,
/*GEO_CMD_NODE_BONE */ geo_layout_cmd_bone,
};
struct GraphNode gObjParentGraphNode;
@@ -751,30 +750,6 @@ void geo_layout_cmd_node_culling_radius(void) {
gGeoLayoutCommand += 0x04 << CMD_SIZE_SHIFT;
}
/*
Create a scene graph node that is rotated by the object's animation + an initial rotation.
*/
void geo_layout_cmd_bone(void) {
struct GraphNodeBone *graphNode;
Vec3s translation;
Vec3s rotation;
s32 drawingLayer = cur_geo_cmd_u8(0x01);
void *displayList;
s16 *cmdPos = (s16 *) gGeoLayoutCommand;
cmdPos = read_vec3s(translation, &cmdPos[2]);
cmdPos = read_vec3s(rotation, &cmdPos[0]);
displayList = *(void **) &cmdPos[0];
cmdPos += 2 << CMD_SIZE_SHIFT;
graphNode =
init_graph_node_bone(gGraphNodePool, NULL, drawingLayer, displayList, translation, rotation);
register_scene_graph_node(&graphNode->node);
gGeoLayoutCommand = (u8 *) cmdPos;
}
struct GraphNode *process_geo_layout(struct AllocOnlyPool *pool, void *segptr) {
// set by register_scene_graph_node when gCurGraphNodeIndex is 0
// and gCurRootGraphNode is NULL

View File

@@ -82,7 +82,6 @@ void geo_layout_cmd_nop(void);
void geo_layout_cmd_copy_view(void);
void geo_layout_cmd_node_held_obj(void);
void geo_layout_cmd_node_culling_radius(void);
void geo_layout_cmd_bone(void);
struct GraphNode *process_geo_layout(struct AllocOnlyPool *pool, void *segptr);

View File

@@ -356,28 +356,6 @@ struct GraphNodeAnimatedPart *init_graph_node_animated_part(struct AllocOnlyPool
return graphNode;
}
/**
* Allocates and returns a newly created bone node with initial rotation/translation
*/
struct GraphNodeBone *init_graph_node_bone(struct AllocOnlyPool *pool,
struct GraphNodeBone *graphNode,
s32 drawingLayer, void *displayList,
Vec3s translation, Vec3s rotation) {
if (pool != NULL) {
graphNode = alloc_only_pool_alloc(pool, sizeof(struct GraphNodeBone));
}
if (graphNode != NULL) {
init_scene_graph_node_links(&graphNode->node, GRAPH_NODE_TYPE_BONE);
vec3s_copy(graphNode->translation, translation);
vec3s_copy(graphNode->rotation, rotation);
SET_GRAPH_NODE_LAYER(graphNode->node.flags, drawingLayer);
graphNode->displayList = displayList;
}
return graphNode;
}
/**
* Allocates and returns a newly created billboard node
*/

View File

@@ -64,7 +64,6 @@ enum GraphNodeTypes {
GRAPH_NODE_TYPE_ROTATION,
GRAPH_NODE_TYPE_OBJECT,
GRAPH_NODE_TYPE_ANIMATED_PART,
GRAPH_NODE_TYPE_BONE,
GRAPH_NODE_TYPE_BILLBOARD,
GRAPH_NODE_TYPE_DISPLAY_LIST,
GRAPH_NODE_TYPE_SCALE,
@@ -96,10 +95,9 @@ enum GraphNodeTypes {
GRAPH_NODE_TYPE_ROTATION = 0x17,
GRAPH_NODE_TYPE_OBJECT = 0x18,
GRAPH_NODE_TYPE_ANIMATED_PART = 0x19,
GRAPH_NODE_TYPE_BONE = 0x1A,
GRAPH_NODE_TYPE_BILLBOARD = 0x1B,
GRAPH_NODE_TYPE_DISPLAY_LIST = 0x1C,
GRAPH_NODE_TYPE_SCALE = 0x1D,
GRAPH_NODE_TYPE_BILLBOARD = 0x1A,
GRAPH_NODE_TYPE_DISPLAY_LIST = 0x1B,
GRAPH_NODE_TYPE_SCALE = 0x1C,
GRAPH_NODE_TYPE_SHADOW = 0x28,
GRAPH_NODE_TYPE_OBJECT_PARENT = 0x29,
GRAPH_NODE_TYPE_GENERATED_LIST = (0x2A | GRAPH_NODE_TYPE_FUNCTIONAL),
@@ -293,13 +291,6 @@ struct GraphNodeAnimatedPart {
/*0x18*/ Vec3s translation;
};
struct GraphNodeBone {
struct GraphNode node;
void *displayList;
Vec3s translation;
Vec3s rotation;
};
/** A GraphNode that draws a display list rotated in a way to always face the
* camera. Note that if the entire object is a billboard (like a coin or 1-up)
* then it simply sets the billboard flag for the entire object, this node is
@@ -424,7 +415,6 @@ struct GraphNodeScale *init_graph_node_scale (struct
struct GraphNodeObject *init_graph_node_object (struct AllocOnlyPool *pool, struct GraphNodeObject *graphNode, struct GraphNode *sharedChild, Vec3f pos, Vec3s angle, Vec3f scale);
struct GraphNodeCullingRadius *init_graph_node_culling_radius (struct AllocOnlyPool *pool, struct GraphNodeCullingRadius *graphNode, s16 radius);
struct GraphNodeAnimatedPart *init_graph_node_animated_part (struct AllocOnlyPool *pool, struct GraphNodeAnimatedPart *graphNode, s32 drawingLayer, void *displayList, Vec3s translation);
struct GraphNodeBone *init_graph_node_bone (struct AllocOnlyPool *pool, struct GraphNodeBone *graphNode, s32 drawingLayer, void *displayList, Vec3s translation, Vec3s rotation);
struct GraphNodeBillboard *init_graph_node_billboard (struct AllocOnlyPool *pool, struct GraphNodeBillboard *graphNode, s32 drawingLayer, void *displayList, Vec3s translation);
struct GraphNodeDisplayList *init_graph_node_display_list (struct AllocOnlyPool *pool, struct GraphNodeDisplayList *graphNode, s32 drawingLayer, void *displayList);
struct GraphNodeShadow *init_graph_node_shadow (struct AllocOnlyPool *pool, struct GraphNodeShadow *graphNode, s16 shadowScale, u8 shadowSolidity, u8 shadowType);

View File

@@ -844,58 +844,6 @@ void geo_process_animated_part(struct GraphNodeAnimatedPart *node) {
append_dl_and_return(((struct GraphNodeDisplayList *)node));
}
/**
* Render an animated part that has an initial rotation value
*/
void geo_process_bone(struct GraphNodeBone *node) {
Vec3s rotation = { node->rotation[0], node->rotation[1], node->rotation[2] };
Vec3f translation = { node->translation[0], node->translation[1], node->translation[2] };
if (gCurrAnimType == ANIM_TYPE_TRANSLATION) {
translation[0] += gCurrAnimData[retrieve_animation_index(gCurrAnimFrame, &gCurrAnimAttribute)]
* gCurrAnimTranslationMultiplier;
translation[1] += gCurrAnimData[retrieve_animation_index(gCurrAnimFrame, &gCurrAnimAttribute)]
* gCurrAnimTranslationMultiplier;
translation[2] += gCurrAnimData[retrieve_animation_index(gCurrAnimFrame, &gCurrAnimAttribute)]
* gCurrAnimTranslationMultiplier;
gCurrAnimType = ANIM_TYPE_ROTATION;
} else {
if (gCurrAnimType == ANIM_TYPE_LATERAL_TRANSLATION) {
translation[0] +=
gCurrAnimData[retrieve_animation_index(gCurrAnimFrame, &gCurrAnimAttribute)]
* gCurrAnimTranslationMultiplier;
gCurrAnimAttribute += 2;
translation[2] +=
gCurrAnimData[retrieve_animation_index(gCurrAnimFrame, &gCurrAnimAttribute)]
* gCurrAnimTranslationMultiplier;
gCurrAnimType = ANIM_TYPE_ROTATION;
} else {
if (gCurrAnimType == ANIM_TYPE_VERTICAL_TRANSLATION) {
gCurrAnimAttribute += 2;
translation[1] +=
gCurrAnimData[retrieve_animation_index(gCurrAnimFrame, &gCurrAnimAttribute)]
* gCurrAnimTranslationMultiplier;
gCurrAnimAttribute += 2;
gCurrAnimType = ANIM_TYPE_ROTATION;
} else if (gCurrAnimType == ANIM_TYPE_NO_TRANSLATION) {
gCurrAnimAttribute += 6;
gCurrAnimType = ANIM_TYPE_ROTATION;
}
}
}
if (gCurrAnimType == ANIM_TYPE_ROTATION) {
rotation[0] += gCurrAnimData[retrieve_animation_index(gCurrAnimFrame, &gCurrAnimAttribute)];
rotation[1] += gCurrAnimData[retrieve_animation_index(gCurrAnimFrame, &gCurrAnimAttribute)];
rotation[2] += gCurrAnimData[retrieve_animation_index(gCurrAnimFrame, &gCurrAnimAttribute)];
}
mtxf_rotate_xyz_and_translate_and_mul(rotation, translation, gMatStack[gMatStackIndex + 1], gMatStack[gMatStackIndex]);
inc_mat_stack();
append_dl_and_return((struct GraphNodeDisplayList *)node);
}
/**
* Initialize the animation-related global variables for the currently drawn
* object's animation.
@@ -1282,7 +1230,6 @@ void geo_process_node_and_siblings(struct GraphNode *firstNode) {
case GRAPH_NODE_TYPE_GENERATED_LIST: geo_process_generated_list ((struct GraphNodeGenerated *) curGraphNode); break;
case GRAPH_NODE_TYPE_BACKGROUND: geo_process_background ((struct GraphNodeBackground *) curGraphNode); break;
case GRAPH_NODE_TYPE_HELD_OBJ: geo_process_held_object ((struct GraphNodeHeldObject *) curGraphNode); break;
case GRAPH_NODE_TYPE_BONE: geo_process_bone ((struct GraphNodeBone *) curGraphNode); break;
default: geo_try_process_children ((struct GraphNode *) curGraphNode); break;
}
}