egg yolk
Member
To actually work on implementation of bones, njaPatcher will require a large rewrite, this means separating the different functions such as loading OBJ and generating triangle strips into isolated JavaScript promises, as working with multiple OBJ will need random access to those functions and njaPatcher should also retain support for single OBJ export of NJA and NJ.
Fortunately the code for njaPatcher can be reused for the majority of this reimplementation and the new NJA with bones gives a good idea of how to break up the existing code (which I wasn't sure of earlier). It can be expected that the next major version of njaPatcher will aim to have some different functionality in support of loading multiple OBJ objects as a single NJA, but before it is in development, V0.21a will be pushed, to fix the OBJ smoothing group error.
The next major version will take a while to write, since there are some new elements to program for, and the focus will shift back to making NJA files until one can accurately be made with a bone structure.
To explain why bones are important, there are several PSOBB weapons that utilize bone positioning as projectile spawn points, or for spawning techs like Gifoie. For example, Baranz Launcher has a bone for each projectile that is shot, but also bones for the actual weapon model, on top of that, each bone has an ID. So 4 bones in Baranz Launcher have ID for a projectile start point function, the tricky part is figuring out which bone ID is associated with which action per weapon model, but there is a solution to this, which is stepping through a weapon with 1 bone, then 2 bones, then 3 etc. - It should also be noted that character models generally have around 64 bones, so it is not really that much to step through, most weapons seem to be around 4 - 10 bones.
It's simple with a weapon like Magical Piece, since it only has 4 bones. I believe 1 of them is where it's held, 2 of them are representing the shadeless/emitting parts of the model, and then a final one which displays where the particle system for Magical Piece spawns, not entirely sure how they are ordered though. Can see Magical Piece bone structure below:
Here is how Magical Piece's special attack functions with only a single bone; the Zonde still hits whatever is targeted, but the particles spawn at the map origin or (0, 0, 0). Certain weapons like Psycho Wand and Mercurius Rod with Foie techs, will spawn that Foie tech also at the map origin, generally Barta, Zonde and Anti all spawn on the character model, but this is likely to do with the bone structure per weapon described and how those tech call functions are associated with it. Below is an example of Magical Piece, and then Psycho Wand:
Fortunately the code for njaPatcher can be reused for the majority of this reimplementation and the new NJA with bones gives a good idea of how to break up the existing code (which I wasn't sure of earlier). It can be expected that the next major version of njaPatcher will aim to have some different functionality in support of loading multiple OBJ objects as a single NJA, but before it is in development, V0.21a will be pushed, to fix the OBJ smoothing group error.
The next major version will take a while to write, since there are some new elements to program for, and the focus will shift back to making NJA files until one can accurately be made with a bone structure.
To explain why bones are important, there are several PSOBB weapons that utilize bone positioning as projectile spawn points, or for spawning techs like Gifoie. For example, Baranz Launcher has a bone for each projectile that is shot, but also bones for the actual weapon model, on top of that, each bone has an ID. So 4 bones in Baranz Launcher have ID for a projectile start point function, the tricky part is figuring out which bone ID is associated with which action per weapon model, but there is a solution to this, which is stepping through a weapon with 1 bone, then 2 bones, then 3 etc. - It should also be noted that character models generally have around 64 bones, so it is not really that much to step through, most weapons seem to be around 4 - 10 bones.
It's simple with a weapon like Magical Piece, since it only has 4 bones. I believe 1 of them is where it's held, 2 of them are representing the shadeless/emitting parts of the model, and then a final one which displays where the particle system for Magical Piece spawns, not entirely sure how they are ordered though. Can see Magical Piece bone structure below:
Here is how Magical Piece's special attack functions with only a single bone; the Zonde still hits whatever is targeted, but the particles spawn at the map origin or (0, 0, 0). Certain weapons like Psycho Wand and Mercurius Rod with Foie techs, will spawn that Foie tech also at the map origin, generally Barta, Zonde and Anti all spawn on the character model, but this is likely to do with the bone structure per weapon described and how those tech call functions are associated with it. Below is an example of Magical Piece, and then Psycho Wand: