Both sides previous revisionPrevious revisionNext revision | Previous revision |
trs:mesh_construction_animation [2017/02/04 16:34] – ↷ Links adapted because of a move operation stohrendorf | trs:mesh_construction_animation [2020/05/19 12:30] (current) – zdimension |
---|
| {{indexmenu_n>5}} |
| |
====== Mesh Construction and Animation ====== | ====== Mesh Construction and Animation ====== |
| |
''<nowiki>MeshTree[]</nowiki>'' array consists of meshtree nodes. | ''<nowiki>MeshTree[]</nowiki>'' array consists of meshtree nodes. |
| |
In ‘Flags` field, two bits are used: | In ''%%Flags%%'' field, two bits are used: |
| |
* Bit 0 (''<nowiki>0x0001</nowiki>'') indicates “take the top mesh off of the mesh stack and use as the parent mesh” when set, otherwise “use the previous mesh as the parent mesh”. | * Bit 0 (''<nowiki>0x0001</nowiki>'') indicates “take the top mesh off of the mesh stack and use as the parent mesh” when set, otherwise “use the previous mesh as the parent mesh”. |
| |
==== TR4-5 Animation Structure ==== | ==== TR4-5 Animation Structure ==== |
| |
| //**Core: **''ANIM_STRUCT''// |
| |
For TR4 and TR5, extended version of [[trs:mesh_construction_animation#tr_animation|[tr_animation]]] is used: | For TR4 and TR5, extended version of [[trs:mesh_construction_animation#tr_animation|[tr_animation]]] is used: |
| |
==== State Change Structure ==== | ==== State Change Structure ==== |
| |
| //**Core: **''CHANGE_STRUCT''// |
| |
Each state change entry contains the state to change to and which animation dispatches to use; there may be more than one, with each separate one covering a different range of frames. | Each state change entry contains the state to change to and which animation dispatches to use; there may be more than one, with each separate one covering a different range of frames. |
| |
==== Animation Dispatch Structure ==== | ==== Animation Dispatch Structure ==== |
| |
| //**Core: **''RANGE_STRUCT''// |
| |
This specifies the next animation and frame to use; these are associated with some range of frames. This makes possible such specificity as one animation for left foot forward and another animation for right foot forward. | This specifies the next animation and frame to use; these are associated with some range of frames. This makes possible such specificity as one animation for left foot forward and another animation for right foot forward. |
</code> | </code> |
| |
Here are all the ''<nowiki>AnimCommand</nowiki>'' types and their arguments. | Here are all the ''<nowiki>AnimCommand</nowiki>'' types and their arguments. |
| |
- **Set Position** (3 arguments). Sets relative entity position (x, y, z); found in grab and block-move animations. | - **Set Position** (3 arguments). Sets relative entity position (x, y, z); found in grab and block-move animations. |
- **Empty Hands** (No arguments). This command is performed in the end of animation of Lara pulling a switch, inserting a key, grabbing a pushable block, and so on. It is needed because engine “locks” Lara’s ability to draw weapons or ignite a flare when such action is performed, and only way to unlock it is to call this command. | - **Empty Hands** (No arguments). This command is performed in the end of animation of Lara pulling a switch, inserting a key, grabbing a pushable block, and so on. It is needed because engine “locks” Lara’s ability to draw weapons or ignite a flare when such action is performed, and only way to unlock it is to call this command. |
- **Kill** (No arguments). Kill entity. This effectively disables entity and removes it from the world. For switch entities, same command is used to define switching point animation. | - **Kill** (No arguments). Kill entity. This effectively disables entity and removes it from the world. For switch entities, same command is used to define switching point animation. |
- **Play Sound** (2 arguments). The first argument is a frame number, and the second one is the ID of the sound to play at that frame (internal sound index). \\ {{:icons:tr2.png?nolink&}}{{:icons:tr3.png?nolink&}}{{:icons:tr4.png?nolink&}}{{:icons:tr5.png?nolink&}}Besides Sound ID, second argument may contain two “packed” bit flags. Their meanings are: | - **Play Sound** (2 arguments). The first argument is a frame number, and the second one is the ID of the sound to play at that frame (internal sound index). \\ {{:icons:tr2.png?nolink&}}{{:icons:tr3.png?nolink&}}{{:icons:tr4.png?nolink&}}{{:icons:tr5.png?nolink&}}Besides Sound ID, second argument may contain one of two “packed” bit flags. Their meanings are: |
* Bit 14 (''%%0x4000%%''): play this sound when on dry land (example: footsteps) | * Bit 14 (''%%0x4000%%''): play this sound when on dry land (example: footsteps) |
* Bit 15 (''%%0x8000%%''): play this sound when in water (example: running through shallow water) | * Bit 15 (''%%0x8000%%''): play this sound when in water (example: running through shallow water) |
- **Flipeffect** (2 operands). The first one is a frame number, and the second one is flipeffect number. Note that //flipeffect// here is the very same kind of flipeffect [[trs:floordata#trigaction-0x09-flipeffect|used in trigger action]] with the same name. Flipeffect meaning is [[trs:miscellany#flipeffects|listed separately]]. | - **Flipeffect** (2 arguments). The first one is a frame number, and the second one is flipeffect number. Note that //flipeffect// here is the very same kind of flipeffect [[trs:floordata#trigaction-0x09-flipeffect|used in trigger action]] with the same name. Flipeffect meaning is [[trs:miscellany#flipeffects|listed separately]]. \\ {{:icons:tr3.png?nolink&}}{{:icons:tr4.png?nolink&}}{{:icons:tr5.png?nolink&}}Usually, when ''FOOTPRINT_FX'' flipeffect (ID 32) is used, second argument also may contain one of two “packed” bit flags, similar to Play Sound animcommand. However, meaning is different: |
| * Bit 14 (''%%0x4000%%''): apply ''FOOTPRINT_FX'' in relation to left foot |
| * Bit 15 (''%%0x8000%%''): apply ''FOOTPRINT_FX'' in relation to right foot |
==== Frame Structure ==== | ==== Frame Structure ==== |
| |