Game Development Community

PathCamera MaskBits

by Ash "Slayeh" Berlin · in Torque Game Engine · 05/03/2004 (12:21 pm) · 6 replies

They are wrong in PathCamera

It uses + not << to get the next bits. It is currntly:

enum MaskBits {
      WindowMask     = Parent::NextFreeMask,
      PositionMask   = Parent::NextFreeMask + 1,
      TargetMask     = Parent::NextFreeMask + 2,
      StateMask      = Parent::NextFreeMask + 3,
      NextFreeMask   = Parent::NextFreeMask << 1
   };

And it should obv. be:

enum MaskBits {
      WindowMask     = Parent::NextFreeMask,
      PositionMask   = Parent::NextFreeMask << 1,
      TargetMask     = Parent::NextFreeMask << 2,
      StateMask      = Parent::NextFreeMask << 3,
      NextFreeMask   = Parent::NextFreeMask << 4
   };

For those of you using the path shape resource this is wrong there to - mainly cos Beffy copied it :)

About the author

Recent Threads

  • Camera / Aiming

  • #1
    05/03/2004 (12:36 pm)
    Ahh - thats because it overflows the limit of 32 bits if you do that. Is this still a problem?
    #2
    05/03/2004 (5:46 pm)
    Hmm.

    So this causes crashes if you make those changes?
    #3
    05/04/2004 (3:33 pm)
    Yeah - if you make those changes the last mask (or maybe it was the next one I added) got wrapped arround to 0, causing an assert somerwhere in the net code with invalid mask.

    Perhaps it would be an idea to allow 64bit masks, as they never leave the client this would allow for more masks... i wouldn't imagine that it would break the net code.

    (Most of the problem is that ShapeBase uses soo many masks with all its thread stuff. Perhaps a way around this would be to allow the lower 4/5 bits for interators - so that those bits are not masks in them selves, just allowing for more masks.)
    #4
    06/19/2004 (6:51 pm)
    Hey I just implemented this fix and it seemed to fix a camera jitter problem I was having. No crashes so far. I don't see why this is a problem - the item class adds the same number of masks when it is created.
    #5
    06/19/2004 (7:59 pm)
    I second the 64 bit masks if its possible. Since I'm doing an RPG i'm going to end up putting a BUNCH of stuff under 'CharacterUpdateMask'
    #6
    06/19/2004 (8:23 pm)
    If your platform can do fast bitwise operations with unsigned 64bit integers, you should be able to simply change the revelant types to a U64 and call it good.

    If not the change is going to be a little more complicated. :)