File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -413,7 +413,8 @@ export class Utils
413413
414414 public static packPathShear ( pathShear : number ) : number
415415 {
416- return Math . round ( pathShear / Utils . SHEAR_QUANTA ) ;
416+ const packed = Math . round ( pathShear / Utils . SHEAR_QUANTA ) ;
417+ return packed < 0 ? packed + 256 : packed ;
417418 }
418419
419420 public static packPathTwist ( pathTwist : number ) : number
@@ -453,17 +454,17 @@ export class Utils
453454
454455 public static unpackPathShear ( pathShear : number ) : number
455456 {
456- return pathShear * Utils . SHEAR_QUANTA ;
457+ return ( pathShear > 127 ? pathShear - 256 : pathShear ) * Utils . SHEAR_QUANTA ;
457458 }
458459
459460 public static unpackPathTwist ( pathTwist : number ) : number
460461 {
461- return pathTwist * Utils . SCALE_QUANTA ;
462+ return ( pathTwist > 127 ? pathTwist - 256 : pathTwist ) * Utils . SCALE_QUANTA ;
462463 }
463464
464465 public static unpackPathTaper ( pathTaper : number ) : number
465466 {
466- return pathTaper * Utils . TAPER_QUANTA ;
467+ return ( pathTaper > 127 ? pathTaper - 256 : pathTaper ) * Utils . TAPER_QUANTA ;
467468 }
468469
469470 public static unpackPathRevolutions ( pathRevolutions : number ) : number
Original file line number Diff line number Diff line change 11{
22 "name" : " @caspertech/node-metaverse" ,
3- "version" : " 0.8.13 " ,
3+ "version" : " 0.8.14 " ,
44 "description" : " A node.js interface for Second Life." ,
55 "main" : " dist/lib/index.js" ,
66 "types" : " dist/lib/index.d.ts" ,
You can’t perform that action at this time.
0 commit comments