27 #define GRAPH_RENDER_ACTIVE (1 << 0) 28 #define GRAPH_RENDER_CHILDREN_FIRST (1 << 1) 29 #define GRAPH_RENDER_BILLBOARD (1 << 2) 30 #define GRAPH_RENDER_Z_BUFFER (1 << 3) 31 #define GRAPH_RENDER_INVISIBLE (1 << 4) 32 #define GRAPH_RENDER_HAS_ANIMATION (1 << 5) 35 #define GRAPH_NODE_TYPE_FUNCTIONAL 0x100 38 #define GRAPH_NODE_TYPE_ROOT 0x001 39 #define GRAPH_NODE_TYPE_ORTHO_PROJECTION 0x002 40 #define GRAPH_NODE_TYPE_PERSPECTIVE (0x003 | GRAPH_NODE_TYPE_FUNCTIONAL) 41 #define GRAPH_NODE_TYPE_MASTER_LIST 0x004 42 #define GRAPH_NODE_TYPE_START 0x00A 43 #define GRAPH_NODE_TYPE_LEVEL_OF_DETAIL 0x00B 44 #define GRAPH_NODE_TYPE_SWITCH_CASE (0x00C | GRAPH_NODE_TYPE_FUNCTIONAL) 45 #define GRAPH_NODE_TYPE_CAMERA (0x014 | GRAPH_NODE_TYPE_FUNCTIONAL) 46 #define GRAPH_NODE_TYPE_TRANSLATION_ROTATION 0x015 47 #define GRAPH_NODE_TYPE_TRANSLATION 0x016 48 #define GRAPH_NODE_TYPE_ROTATION 0x017 49 #define GRAPH_NODE_TYPE_OBJECT 0x018 50 #define GRAPH_NODE_TYPE_ANIMATED_PART 0x019 51 #define GRAPH_NODE_TYPE_BILLBOARD 0x01A 52 #define GRAPH_NODE_TYPE_DISPLAY_LIST 0x01B 53 #define GRAPH_NODE_TYPE_SCALE 0x01C 54 #define GRAPH_NODE_TYPE_SHADOW 0x028 55 #define GRAPH_NODE_TYPE_OBJECT_PARENT 0x029 56 #define GRAPH_NODE_TYPE_GENERATED_LIST (0x02A | GRAPH_NODE_TYPE_FUNCTIONAL) 57 #define GRAPH_NODE_TYPE_BACKGROUND (0x02C | GRAPH_NODE_TYPE_FUNCTIONAL) 58 #define GRAPH_NODE_TYPE_HELD_OBJ (0x02E | GRAPH_NODE_TYPE_FUNCTIONAL) 59 #define GRAPH_NODE_TYPE_CULLING_RADIUS 0x02F 63 #define GFX_NUM_MASTER_LISTS 8 67 #define GEO_CONTEXT_CREATE 0 // called when node is created from a geo command 68 #define GEO_CONTEXT_RENDER 1 // called from rendering_graph_node.c 69 #define GEO_CONTEXT_AREA_UNLOAD 2 // called when unloading an area 70 #define GEO_CONTEXT_AREA_LOAD 3 // called when loading an area 71 #define GEO_CONTEXT_AREA_INIT 4 // called when initializing the 8 areas 72 #define GEO_CONTEXT_HELD_OBJ 5 // called when processing a GraphNodeHeldObj s32 preset
Definition: graph_node.h:195
struct GraphNodeLevelOfDetail * init_graph_node_render_range(struct AllocOnlyPool *pool, struct GraphNodeLevelOfDetail *graphNode, s16 minDistance, s16 maxDistance)
Allocates and returns a newly created render range node.
Definition: graph_node.c:137
Vec3f from
Definition: graph_node.h:198
struct GraphNodeShadow * init_graph_node_shadow(struct AllocOnlyPool *pool, struct GraphNodeShadow *sp1c, s16 sp22, u8 sp27, u8 sp2b)
Allocates and returns a newly created shadow node.
Definition: graph_node.c:392
struct GraphNode * sharedChild
Definition: graph_node.h:313
void * displayList
Definition: graph_node.h:254
f32 Vec3f[3]
Definition: types.h:23
#define GFX_NUM_MASTER_LISTS
Definition: graph_node.h:63
A node that allows an object to specify a different culling radius than the default one of 300...
Definition: graph_node.h:355
Vec3f to
Definition: graph_node.h:199
GraphNode that draws a background image or a rectangle of a color.
Definition: graph_node.h:333
u8 areaIndex
Definition: graph_node.h:96
struct GraphNode ** views
Definition: graph_node.h:103
Vec3s translation
Definition: graph_node.h:215
signed char s8
Definition: ultratypes.h:11
struct GraphNodeMasterList * gCurGraphNodeMasterList
Definition: rendering_graph_node.c:119
struct GraphNodeRoot * geo_find_root(struct GraphNode *graphNode)
Unused function to find the root of the geo node tree, which should be a GraphNodeRoot.
Definition: graph_node.c:844
void register_scene_graph_node(struct GraphNode *)
Add the given graph node as a child to the current top of the gfx stack: 'gCurGraphNodeList'.
Definition: graph_node_manager.c:48
s16 near
Definition: graph_node.h:124
s16 far
Definition: graph_node.h:125
The very root of the geo tree.
Definition: graph_node.h:93
unsigned short int u16
Definition: ultratypes.h:14
void geo_obj_init(struct GraphNodeObject *sp18, void *sp1c, Vec3f sp20, Vec3s sp24)
Initialize an object node using the given parameters.
Definition: graph_node.c:662
GraphNode part that scales itself and its children.
Definition: graph_node.h:287
s32 unused
Definition: graph_node.h:345
signed short int s16
Definition: ultratypes.h:13
void * transform
Definition: graph_node.h:133
void geo_retreive_animation_translation(struct GraphNodeObject *sp28, Vec3f sp2c)
Unused function to retrieve an object's current animation translation Assumes that it has x...
Definition: graph_node.c:814
void * displayList
Definition: graph_node.h:214
void * displayList
Definition: graph_node.h:266
void init_scene_graph_node_links(struct GraphNode *, s32)
Initialize a geo node with a given type.
Definition: graph_node.c:24
s8 unk15
Definition: graph_node.h:97
A GraphNode that simply draws a display list without doing any transformation beforehand.
Definition: graph_node.h:273
s16 selectedCase
Definition: graph_node.h:181
f32 fov
Definition: graph_node.h:123
void geo_call_global_function_nodes_helper(struct GraphNode *, s32)
Helper function for geo_call_global_function_nodes that recursively traverses the scene graph and cal...
Definition: graph_node.c:585
A node that sets up a perspective projection.
Definition: graph_node.h:119
s32(* GraphNodeFunc)(s32 callContext, struct GraphNode *node, void *context)
Definition: graph_node.h:79
s16 shadowScale
Definition: graph_node.h:302
Renders the object that Mario is holding.
Definition: graph_node.h:342
struct GraphNodeSwitchCase * init_graph_node_switch_case(struct AllocOnlyPool *pool, struct GraphNodeSwitchCase *graphNode, s16 numCases, s16 sp26, GraphNodeFunc nodeFunc, s32 sp2c)
Allocates and returns a newly created switch case node.
Definition: graph_node.c:155
GraphNode that draws display lists not directly in memory but generated by a function.
Definition: graph_node.h:324
struct GraphNodeCullingRadius * init_graph_node_culling_radius(struct AllocOnlyPool *pool, struct GraphNodeCullingRadius *sp1c, s16 sp22)
Allocates and returns a newly created frustum culling radius node.
Definition: graph_node.c:317
s16 minDistance
Definition: graph_node.h:167
struct GraphNode gObjParentGraphNode
Definition: geo_layout.c:101
struct GraphNodeObject * objNode
Definition: graph_node.h:346
s16 Vec3s[3]
Definition: types.h:24
struct GraphNodeCamera * init_graph_node_camera(struct AllocOnlyPool *pool, struct GraphNodeCamera *sp1c, f32 *sp20, f32 *sp24, GraphNodeFunc sp28, s32 sp2c)
Allocates and returns a newly created camera node.
Definition: graph_node.c:180
Simply used as a parent to group multiple children.
Definition: graph_node.h:153
struct GraphNode * gCurGraphNodeList[]
Definition: geo_layout.c:95
void geo_obj_init_spawninfo(struct GraphNodeObject *sp18, struct SpawnInfo *sp1c)
Initialize and object node using the given SpawnInfo struct.
Definition: graph_node.c:680
s32 unused
Definition: graph_node.h:122
Vec3s angle
Definition: types.h:106
Vec3s translation
Definition: graph_node.h:347
struct GraphNodeRoot * init_graph_node_root(struct AllocOnlyPool *, struct GraphNodeRoot *, s16, s16 x, s16 y, s16 width, s16 height)
Allocated and returns a newly created root node.
Definition: graph_node.c:35
u8 shadowSolidity
Definition: graph_node.h:303
s16 cullingRadius
Definition: graph_node.h:358
void * matrixPtr
Definition: graph_node.h:200
float f32
Definition: ultratypes.h:29
Vec3f gVec3fZero
Definition: graph_node.c:16
void * displayList
Definition: graph_node.h:134
GraphNode that renders exactly one of its children.
Definition: graph_node.h:176
void geo_call_global_function_nodes(struct GraphNode *graphNode, s32 sp1c)
Call the update functions of geo nodes that are stored in global variables.
Definition: graph_node.c:639
s32 retrieve_animation_index(s32 a0, u16 **a1)
Retrieves an index into animation data based on the attribute pointer An attribute is an x-...
Definition: graph_node.c:738
struct LevelCamera * levelCamera
Definition: graph_node.h:196
struct GraphNodeOrthoProjection * init_graph_node_ortho_projection(struct AllocOnlyPool *, struct GraphNodeOrthoProjection *, f32)
Allocates and returns a newly created otrhographic projection node.
Definition: graph_node.c:60
s16 x
Definition: graph_node.h:98
Vec3s translation
Definition: graph_node.h:267
struct GraphNodeObjectParent * init_graph_node_object_parent(struct AllocOnlyPool *pool, struct GraphNodeObjectParent *sp1c, struct GraphNode *sp20)
Allocates and returns a newly created object parent node.
Definition: graph_node.c:411
Vec3s gVec3sOne
Definition: graph_node.c:19
GraphNodeFunc func
Definition: graph_node.h:88
s16 y
Definition: graph_node.h:99
struct GraphNode * geo_remove_child(struct GraphNode *)
Remove a node from the scene graph.
Definition: graph_node.c:529
An entry in the master list.
Definition: graph_node.h:131
s16 numViews
Definition: graph_node.h:102
struct GraphNodeCamera * gCurGraphNodeCamera
Definition: rendering_graph_node.c:121
struct GraphNodePerspective * gCurGraphNodeCamFrustum
Definition: rendering_graph_node.c:120
struct GraphNode * geo_make_first_child(struct GraphNode *a0)
Reorders the given node so it's the first child of its parent.
Definition: graph_node.c:558
Vec3s rotation
Definition: graph_node.h:240
struct GraphNodeGenerated * init_graph_node_generated(struct AllocOnlyPool *pool, struct GraphNodeGenerated *sp1c, GraphNodeFunc sp20, s32 sp24)
Allocates and returns a newly created generated node.
Definition: graph_node.c:428
s16 maxDistance
Definition: graph_node.h:168
GraphNode that draws a shadow under an object.
Definition: graph_node.h:299
s16 * read_vec3s_angle(Vec3s dst, s16 *src)
Takes a pointer to three angles in degrees (supplied by a geo layout script) and converts it to a vec...
Definition: graph_node_manager.c:37
Vec3s gVec3sZero
Definition: graph_node.c:17
s16 roll
Definition: graph_node.h:201
GraphNode that translates and rotates its children.
Definition: graph_node.h:211
struct GraphNodeRotation * init_graph_node_rotation(struct AllocOnlyPool *pool, struct GraphNodeRotation *graphNode, s32 drawingLayer, void *displayList, Vec3s sp28)
Allocates and returns a newly created rotation node.
Definition: graph_node.c:249
struct GraphNodeStart * init_graph_node_start(struct AllocOnlyPool *pool, struct GraphNodeStart *sp1c)
Allocates and returns a newly created start node.
Definition: graph_node.c:103
struct DisplayListNode * next
Definition: graph_node.h:135
Vec3f pos
Definition: types.h:107
Vec3s translation
Definition: graph_node.h:227
void * displayList
Definition: graph_node.h:276
struct GraphNodePerspective * init_graph_node_perspective(struct AllocOnlyPool *pool, struct GraphNodePerspective *sp1c, f32 sp20, s16 sp26, s16 sp2a, GraphNodeFunc sp2c, s32 sp30)
Allocates and returns a newly created perspective node.
Definition: graph_node.c:76
Vec3s rotation
Definition: graph_node.h:216
s16 geo_update_animation_frame(struct GraphNodeObject_sub *a0, s32 *a1)
Update the animation frame of an object.
Definition: graph_node.c:756
struct GraphNodeMasterList * init_graph_node_master_list(struct AllocOnlyPool *pool, struct GraphNodeMasterList *, s16 sp22)
Allocates and returns a newly created master list node.
Definition: graph_node.c:118
s16 numCases
Definition: graph_node.h:180
s16 width
Definition: graph_node.h:100
s16 gCurGraphNodeIndex
Definition: geo_layout.c:96
struct GraphNodeAnimatedPart * init_graph_node_animated_part(struct AllocOnlyPool *pool, struct GraphNodeAnimatedPart *graphNode, s32 drawingLayer, void *displayList, Vec3s relativePos)
Allocates and returns a newly created animated part node.
Definition: graph_node.c:334
void * displayList
Definition: graph_node.h:290
GraphNode that specifies the location and aim of the camera.
Definition: graph_node.h:187
unsigned char u8
Definition: ultratypes.h:12
void geo_obj_init_animation(struct GraphNodeObject *, void *)
Initialize the animation of an object node.
Definition: graph_node.c:703
A node that sets up an orthographic projection based on the global root node.
Definition: graph_node.h:109
struct GraphNodeScale * init_graph_node_scale(struct AllocOnlyPool *pool, struct GraphNodeScale *graphNode, s32 drawingLayer, void *displayList, f32 sp28)
Allocates and returns a newly created scaling node.
Definition: graph_node.c:269
s16 height
Definition: graph_node.h:101
struct GraphNodeBillboard * init_graph_node_billboard(struct AllocOnlyPool *pool, struct GraphNodeBillboard *graphNode, s32 drawingLayer, void *displayList, Vec3s sp28)
Allocates and returns a newly created billboard node.
Definition: graph_node.c:354
Vec3f gVec3fOne
Definition: graph_node.c:18
struct GraphNodeDisplayList * init_graph_node_display_list(struct AllocOnlyPool *pool, struct GraphNodeDisplayList *graphNode, s32 drawingLayer, void *displayList)
Allocates and returns a newly created displaylist node.
Definition: graph_node.c:374
struct GraphNodeObject * init_graph_node_object(struct AllocOnlyPool *pool, struct GraphNodeObject *graphNode, struct GraphNode *sp20, Vec3f pos, Vec3s angle, Vec3f scale)
Allocates and returns a newly created object node.
Definition: graph_node.c:288
f32 scale
Definition: graph_node.h:112
void geo_reset_object_node(struct GraphNodeObject *sp20)
When objects are cleared, this is called on all object nodes (loaded or unloaded).
Definition: graph_node.c:653
GraphNode part that transforms itself and its children based on animation data.
Definition: graph_node.h:251
signed int s32
Definition: ultratypes.h:15
Vec3f scale
Definition: types.h:108
GraphNode that only renders its children if the current transformation matrix has a z-translation (in...
Definition: graph_node.h:164
GraphNode that translates itself and its children.
Definition: graph_node.h:223
u32 parameter
Definition: graph_node.h:327
GraphNode that contains as its sharedChild a group node containing all object nodes.
Definition: graph_node.h:310
struct GraphNodeTranslation * init_graph_node_translation(struct AllocOnlyPool *pool, struct GraphNodeTranslation *graphNode, s32 drawingLayer, void *displayList, Vec3s sp28)
Allocates and returns a newly created translation node.
Definition: graph_node.c:228
A GraphNode that draws a display list rotated in a way to always face the camera. ...
Definition: graph_node.h:263
struct GraphNodeHeldObject * gCurGraphNodeHeldObject
Definition: rendering_graph_node.c:123
s32 background
Definition: graph_node.h:337
struct GraphNodeBackground * init_graph_node_background(struct AllocOnlyPool *pool, struct GraphNodeBackground *sp1c, u16 sp22, GraphNodeFunc sp24, s32 sp28)
Allocates and returns a newly created background node.
Definition: graph_node.c:450
void * displayList
Definition: graph_node.h:239
struct GraphNode * geo_add_child(struct GraphNode *, struct GraphNode *)
Adds 'childNode' to the end of the list children from 'parent'.
Definition: graph_node.c:500
s32 unused
Definition: graph_node.h:336
Vec3s translation
Definition: graph_node.h:255
void * displayList
Definition: graph_node.h:226
struct GraphNodeHeldObject * init_graph_node_held_object(struct AllocOnlyPool *pool, struct GraphNodeHeldObject *sp1c, s32 sp20, Vec3s sp24, GraphNodeFunc sp28, s32 sp2c)
Allocates and returns a newly created held object node.
Definition: graph_node.c:475
GraphNode that rotates itself and its children.
Definition: graph_node.h:236
struct GraphNode * gCurRootGraphNode
Definition: geo_layout.c:48
f32 scale
Definition: graph_node.h:291
s32 unused
Definition: graph_node.h:179
void geo_obj_init_animation_accel(struct GraphNodeObject *sp30, void *sp34, u32 sp38)
Initialize the animation of an object node.
Definition: graph_node.c:717
An extension of a graph node that includes a function pointer.
Definition: graph_node.h:85
GraphNode that manages the 8 top-level display lists that will be drawn Each list has its own render ...
Definition: graph_node.h:143
unsigned int u32
Definition: ultratypes.h:16
s16 * read_vec3s_to_vec3f(Vec3f, s16 *src)
Takes a pointer to three shorts (supplied by a geo layout script) and copies it to the destination fl...
Definition: graph_node_manager.c:15
u16 gAreaUpdateCounter
Definition: rendering_graph_node.c:124
s16 rollScreen
Definition: graph_node.h:202
struct GraphNodeTranslationRotation * init_graph_node_translation_rotation(struct AllocOnlyPool *pool, struct GraphNodeTranslationRotation *graphNode, s32 drawingLayer, void *displayList, Vec3s sp28, Vec3s sp2c)
Allocates and returns a newly created translation rotation node.
Definition: graph_node.c:207
s16 * read_vec3s(Vec3s dst, s16 *src)
Takes a pointer to three shorts (supplied by a geo layout script) and copies it to the destination ve...
Definition: graph_node_manager.c:26
u8 shadowType
Definition: graph_node.h:304