Welcome, guest! Please login or register.

    * Shoutbox

    RefreshHistory
    • SantaHoHo: you wont regret when u join really nice server
      December 10, 2019, 06:35:18 PM
    • SantaHoHo: need staff :)
      December 10, 2019, 06:35:08 PM
    • SantaHoHo: divinescape.eu5.org
      December 10, 2019, 06:35:00 PM
    • SantaHoHo:[link]
      December 10, 2019, 06:34:39 PM
    • Moneyking800: Yanille is back! We’re in beta looking for new players. We are small around 5-10 players on at anytime atm looking for active testers to build off of! Yanille-os.com
      December 10, 2019, 06:14:45 PM
    • drubrkletern: be honest with me boss
      December 06, 2019, 01:31:52 AM
    • drubrkletern: now is it really that unique
      December 06, 2019, 01:31:47 AM
    • SuperNativeZ: COME PLAY THE MOST UNIQUE CUSTOM RSPS #1 [link][link][link]
      December 05, 2019, 09:22:55 PM
    • SuperNativeZ: FASTEST GROWING #1 UNIQUE CUSTOM RSPS [link][link][link]
      December 05, 2019, 09:22:42 PM
    • ragnoroker: New Server - Unique - Awesome Community - Start your adventure - 60+ online : [link]
      December 05, 2019, 02:48:39 PM
    • ragnoroker: New Server - Unique - Awesome Community - Start your adventure - 40+ online : [link]
      December 05, 2019, 02:48:31 PM
    • Cole1497: you click any of these links? those boner pills theyre selling are wicked
      December 04, 2019, 05:58:03 PM
    • Cole1497: oh shit vain whats crackin
      December 04, 2019, 05:57:49 PM
    • ArtexAdv: FASTEST GROWING #1 UNIQUE CUSTOM RSPS [link]
      December 04, 2019, 06:30:27 AM
    • Vain_: where the boys at
      December 01, 2019, 03:20:36 PM
    • black evil111: They should close this down, mostly the downloads section. The mods dont know how to do their jobs worth shit and its no excuse like "we have real life stuff going on" everyones replacable. Speaking of replacable, fix download links! Before I go to rune-server.
      December 01, 2019, 01:50:26 PM
    • ragnoroker: New Server - Unique - Awesome Community - Start your adventure - 40+ online : [link]
      November 28, 2019, 12:41:24 PM
    • ragnoroker: New Server - Unique - Awesome Community - Start your adventure - 40+ online : [link]
      November 28, 2019, 12:40:42 PM
    • 1strangler77: how do i post pictures on a post
      November 24, 2019, 05:16:18 PM
    • ragnoroker: New Server - Unique - Awesome Community - Start your adventure - 40+ online : [link]
      November 23, 2019, 08:23:51 PM

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