Welcome, guest! Please login or register.

    * Shoutbox

    RefreshHistory
    • ragnoroker: New Server - Unique - Awesome Community - Start your adventure : [link]
      Today at 12:52:54 PM
    • ragnoroker: New Server - Unique - Awesome Community - Start your adventure : [link]
      Today at 12:52:50 PM
    • U Go Home: hey does anyone have allstarscape v2 i want to make it better something to do and try and bring back the good old days
      Today at 09:22:14 AM
    • ArtexAdv:[link] come check out the most
      November 18, 2019, 11:39:14 AM
    • ArtexAdv: Www.galaxy-rsps.net come check out the most unique custom rsps
      November 18, 2019, 11:38:50 AM
    • ragnoroker: New Server - Unique - Awesome Community - Start your adventure : [link]
      November 17, 2019, 10:14:59 PM
    • ragnoroker: New Server - Unique - Awesome Community - Start your adventure : [link]
      November 17, 2019, 10:14:50 PM
    • Mazeingmaze: last logged in 2008
      November 17, 2019, 06:46:52 PM
    • Mazeingmaze: Ayy BRO
      November 17, 2019, 06:46:46 PM
    • SuperNativeZ: WANT TO BE APART OF THE BEST RSPS? [link]
      November 17, 2019, 12:22:53 AM
    • SuperNativeZ: WHY CHOOSE GALAXY RSPS?  WE HAVE THE BEST UNIQUE GAMEPLAY [link]
      November 17, 2019, 12:22:42 AM
    • SuperNativeZ: WHY CHOOSE GALAXY RSPS?  WE HAVE THE BEST UNIQUE GAMEPLAY [link]
      November 17, 2019, 12:22:39 AM
    • ragnoroker: Brand new server, come join the fun - unique server - RuneGuild -[link]
      November 15, 2019, 12:46:05 PM
    • ragnoroker: Brand new server, come join the fun - unique server - RuneGuild -[link]
      November 15, 2019, 12:46:01 PM
    • Cole1497: join horney scape we are horney all the time and have a sex emote
      November 09, 2019, 05:14:33 PM
    • thewraith500: try autoscape,0rg brand new osrs CUSTOMS server! fight caves for flaming fire cape, upgrade them to infernal wings + more!
      November 09, 2019, 01:37:29 AM
    • SuperNativeZ: Come play brand new server [link]
      November 08, 2019, 02:13:24 PM
    • SuperNativeZ: Come play brand new server [link]
      November 08, 2019, 02:13:17 PM
    • SuperNativeZ: Come play brand new server [link]
      November 08, 2019, 02:13:14 PM
    • ragnoroker: Brand new server, come join the fun - unique server - RuneGuild - [link]
      November 07, 2019, 11:55:44 AM

    Author Topic: [194] Refactored ModelJoint class  (Read 511 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