Welcome, guest! Please login or register.

    * Shoutbox

    RefreshHistory
    • ragnoroker: Brand new server! Less than 1 week old! Nightmare/Raids 1/2/Hydra/Pk Modes/Exp modes/ Unique  Join today - [link]
      July 04, 2020, 06:42:38 PM
    • ragnoroker: Brand new server! Less than 1 week old! Nightmare/Raids 1/2/Hydra/Pk Modes/Exp modes/ Unique  Join today - [link]
      July 04, 2020, 06:42:32 PM
    • iddsyou: PkOwnage 2 worlds, modern OSRS & 2014 server! [link]  Join us on Discord! [link]
      July 04, 2020, 11:07:29 AM
    • slayerpure: kingdom full blown custom server with over 50 custom bosses released last week. play now here     [link]
      July 02, 2020, 08:44:32 PM
    • jgoet: dodian !!
      July 02, 2020, 07:15:44 PM
    • jgoet: join [link]  its back online !!!!
      July 02, 2020, 07:15:37 PM
    • Protojae: RIP moparscape
      July 02, 2020, 03:01:32 PM
    • Protojae: obviously thiswebsite is dead as fudge
      July 02, 2020, 03:01:14 PM
    • ragnoroker: RuneGuild has just been released! 1 Hour old, Come join the fun - [link]
      June 26, 2020, 02:14:21 PM
    • ragnoroker: RuneGuild has just been released! 1 Hour old, Come join the fun - [link]
      June 26, 2020, 02:14:08 PM
    • ragnoroker: RuneGuild has just been released! 1 Hour old, Come join the fun - [link]
      June 26, 2020, 02:14:00 PM
    • Fox2007: rune-nexus.com - FREE advertising, SEO optimized - no registration required
      June 26, 2020, 06:21:47 AM
    • Decimate Returns: trailer video posted for Project Decimate, Official Launch is in a few weeks! watch here: [youtube]LBorsdI-k1Y[/youtube]
      June 24, 2020, 07:18:03 PM
    • slayerpure: 1 week old rsps we need players and potential staff, customs and goku/vegeta sets play here!    [link] join our discord [link]
      June 24, 2020, 05:23:46 PM
    • Decimate Returns: Project Decimate is still in BETA: join our discord to keep up with the new content added: [link]
      June 24, 2020, 01:09:23 PM
    • Decimate Returns: Project Decimate is still in BETA: join our discord to keep up with the new content added: [link]
      June 24, 2020, 01:09:03 PM
    • dan v jad: PkOwnage OSRS Great server great community!  Join us on Discord! [link]  Download: [link]
      June 21, 2020, 09:23:28 AM
    • Lens: Sick Custom RSPS - CrystalPS. Join us on Discord. [link]
      June 20, 2020, 04:35:44 PM
    • Shady Aftermath: check out skyfire317.com gott 3 custom skills, afk zones
      June 19, 2020, 10:22:22 PM
    • Shady Aftermath: check out skyfire317.com gott 3 custom skills, afk zones
      June 19, 2020, 10:22:14 PM

    Author Topic: [194] Refactored ModelJoint class  (Read 565 times)

    0 Members and 1 Guest are viewing this topic.

    OfflineAmbokile

    • Member
    • ****
    • Posts: 3,009
    • Thanks: +0/-0
      • View Profile
    [194] Refactored ModelJoint class
    « on: November 03, 2014, 07:57:20 PM »
    Here is my attempt at refactoring the ModelJoint class. I think this is often called "Skins" in 317 refactors, but I did some research and it seemed to refer to it as joints. This would make sense seeing as the "opcodes" of animations are infact the joint affected  by the transformations.

    Code: Java
    1. publicclass ModelJoint {
    2.         publicstatic ModelJoint[] joints;
    3.         publicint count;
    4.         publicint[] transformTypes;
    5.         publicint[][] jointList;
    6.  
    7.         publicstaticvoid load(Archive archive){
    8.                 Stream head =new Stream(archive.getFile(null,
    9.                                 "base_head.dat"));
    10.                 Stream type =new Stream(archive.getFile(null,
    11.                                 "base_type.dat"));
    12.                 Stream label =new Stream(archive.getFile(null,
    13.                                 "base_label.dat"));
    14.                
    15.                 int jointCount = head.getUnsignedLEShort();
    16.                 int highestJointId = head.getUnsignedLEShort();
    17.                
    18.                 joints =new ModelJoint[highestJointId +1];
    19.                 for(int j =0; j < jointCount; j++){
    20.                         int jointId = head.getUnsignedLEShort();
    21.                         int count = head.getUnsignedByte();
    22.                         int[] transformTypes =newint[count];
    23.                         int[][] jointList =newint[count][];
    24.                         for(int joint =0; joint < count; joint++){
    25.                                 transformTypes[joint]= type.getUnsignedByte();
    26.                                 int subJointCount = label.getUnsignedByte();
    27.                                 jointList[joint]=newint[subJointCount];
    28.                                
    29.                                 for(int subJoint =0; subJoint < subJointCount; subJoint++)
    30.                                         jointList[joint][subJoint]= label.getUnsignedByte();
    31.                         }
    32.                         joints[jointId]=new ModelJoint();
    33.                         joints[jointId].count= count;
    34.                         joints[jointId].transformTypes= transformTypes;
    35.                         joints[jointId].jointList= jointList;
    36.                 }
    37.         }
    38. }
    Runescape Gambling

     

    Copyright © 2017 MoparScape. All rights reserved.
    Powered by SMFPacks SEO Pro Mod |
    SimplePortal 2.3.5 © 2008-2012, SimplePortal