Chapter 3 Binary Format
3-5. ObjList

2. Obj Area

The Obj area describes object-related information. It is mapped as shown below.

u32 obj_tag
u32 this_obj_index
u32 obj_size
u32 obj_name_index
u32 obj_state
u32 obj_type
u32 obj_group
u32 obj_pri
u32 obj_render_cycle_type
u32 obj_render_pri
u32 obj_render_type0
u32 obj_render_type1
u32 have_link_billboard
u32 obj_lod_num
u32 obj_child_num
u32 obj_parent_link
u32 obj_shape_link
u32 obj_mat_link
u32 obj_anim_link
u32 obj_coll_link
u32 nintendo_extension_block_size
u32 user_extension_block_size
float obj_lod_dist(0)
float obj_lod_dist(obj_lod_num - 1)
u32 obj_lod_link(0)
u32 obj_lod_link(obj_lod_num - 1)
u32 obj_child_link(0)
u32 obj_child_link(obj_child_num - 1)

Figure: Obj Area Memory map

u32 obj_tag Tag indicating Obj. Set the following flag.

TAG_OBJ		0x00020100
u32 this_obj_index Index number of this Obj
u32 obj_size Size of this Obj.
u32 obj_name_index Index number of object name. The object name is contained in NameList. The index number is contained in NameList.
u32 obj_state Specifies object state. The following are currently defined.

OBJ_STATE_CLEAR		0x00000000

OBJ_STATE_CLEAR ignores all links of this object.

OBJ_STATE_ACTIVE activates object.

OBJ_STATE_CLEAR is not typically used. Normally, when data is outputted from CG tool, set to OBJ_STATE_ACTIVE.

u32 obj_type Specifies object type. Currently, the following are defined.

OBJ_TYPE_NULL		0x00000000
OBJ_TYPE_3D		0x00000001

OBJ_TYPE_NULL is NULL object. Set this flag if the object contains animation and a child node but not a shape node (i.e., an object that does have some information but no shape data to display).

BJ_TYPE_3D contains polygon data. Set this flag if the object contains 3D shape data.

OBJ_TYPE_BILLBOARD is billboard type object. Set this flag if the object contains billboard type animation. As a 3D object, the shape data of a billboard object links to the Shape node.

Normally, one of these flags should be set.

u32 obj_group ID number of group categorized by object type. The following is the default.

OBJ_GROUP_NONE		0x00000000
u32 obj_pri Priority sequence of this object in the same group. The following is the default.

OBJ_PRI_NONE		0x00000000
u32 obj_render_cycle_type Cycle type of RDP for object rendering. The following flags are currently defined.

OBJ_RENDER_CYC_1CYC		0x00000000
OBJ_RENDER_CYC_2CYC		0x00000001

Set one of these flags. Set OBJ_RENDER_CYC_1CYC for default.

u32 obj_render_pri Sets the priority sequence of object rendering. the object is drawn from the higher sequence.

The upper 8 bit is defined as an extension flag. The following are currently defined as an extension flag.


OBJ_RENDER_FLAG_NIFF is the render mode for NIFF. The priority sequence of both rendering and rendering type can be set accordingly as below.


By setting one of these, both the priority sequence of rendering and rendering type can be set automatically. In this case, obj_render_type* is not referenced.

When OBJ_RENDER_FLAG_N64 is specified, you should use the lower 24 bit to specify the priority sequence of rendering. In this case, the above flags can be applied. However, render mode itself cannot be specified by this because render mode should be specified by obj_render_type*.

u32 obj_render_type0 When OBJ_RENDER_FLAG_N64 is specified in Obj_render_pri, the rendering mode of Nintendo 64 can be used. This is the rendering mode for 1 cycle.
u32 obj_render_type1 When OBJ_RENDER_FLAG_N64 is specified in Obj_render_pri, the rendering mode of Nintendo 64 can be used. This is the rendering mode for 2 cycles.
u32 have_link_billboard Specify the following flag as if Billboard object is contained in the lower hierarchical link.


If this object does not contain a hierarchical link to a Billboard object, set the following flag.

u32 obj_lod_num When the object is to be LOD-processed, depending on the LOD level, the links can be divided up.

If the object is not LOD-processed, set the following flag.

OBJ_NOLOD	0x00000000
u32 obj_child_num Up to 32 child nodes (linked to the object) can be specified. obj_child_num is the number of child objects linked to this object. If there is no child object contained, set the following flag.

OBJ_NOCHILD	0x00000000
u32 obj_parent_link Index number of parent object in ObjList. If parent object is not contained (i.e., connected directly to SceneNode), set the following flag.

OBJ_NO_PARENT	0xffffffff
u32 obj_shape_link Index number of shape data in ShapeList linked to the object.

Also, if obj_type = OBJ_TYPE_NULL, specify the following flag.

OBJ_NOSHAPE	0xffffffff
u32 obj_mat_link Index number of material data in MatList linked to the object. Set the following flag if no material data is linked.

OBJ_MAT_NOLINK	0xffffffff
u32 obj_anim_link Index number of animation data in AnimList linked to the object. Set the following flag if no animation data is linked.

OBJ_ANIM_NOLINK	0xffffffff
u32 obj_coll_group_link Index number of CollGroup linked to the object.

Set the following flag if the object does not have Collision data.

u32 nintendo_extension_block_size Nintendo extension block size
u32 user_extension_block_size User extension block size
float obj_lod_dist Distance from camera corresponding to the LOD level. When the distance value is less than this level, this Obj data will be linked.

If OBJ_NOLOD is already set on obj_lod_num, this field is not applied.

Suppose obj_lod_num = 0x00000001 (LOD level is set to 1). Having the LOD level set to 1 means that, if the distance between the camera and the object gets closer than the level setting, the object will be displayed. If the distance gets farther than the level setting, the object is not displayed.

If obj_lod_num >= 2, the object may or may not be displayed, depending on the level setting and the distance between the object and the camera.

To avoid not displaying object, set the following flag to the maximum obj_lod_dist.

OBJ_LOD_DIST_MAX	0xffffffff
u32 obj_lod_link Index number of Obj node to be linked corresponding to the LOD level. If obj_lod_num = OBJ_NOLOD, this structure is not specified.
u32 obj_child_link Index number of Object data linked to Obj. If the object contains CHILD_NUM of a child object, the number of the index number will be the same as CHILD_NUM.

If OBJ_NOCHILD is set on obj_child_num, obj_child_link is not applied.

NintendoExtensionBlock Nintendo extension block
UserExtensionBlock User extension block