Paste Code
Paste Blends
Paste Images
class PhysicsComponent(Struct):
def __init__(self):
super().__init__("fffffffff")
self.position = Vector()
self.velocity = Vector()
self.rotation = Euler()

def __eq__(self, other):
try:
return self.position == other.position and \
self.velocity == other.velocity and \
self.rotation == other.rotation

except AttributeError:
return False

def pack(self):
return super().pack(*(self.position[:] + self.velocity[:] + self.rotation[:]))

def unpack(self, bytes_):
self.position[:], self.velocity[:], self.rotation[:] = super().unpack(bytes_)
  1. class PhysicsComponent(Struct):
  2.     def __init__(self):
  3.         super().__init__("fffffffff")
  4.         self.position = Vector()
  5.         self.velocity = Vector()
  6.         self.rotation = Euler()
  7.    
  8.     def __eq__(self, other):
  9.         try:
  10.             return self.position == other.position and \
  11.             self.velocity == other.velocity and \
  12.             self.rotation == other.rotation
  13.            
  14.         except AttributeError:
  15.             return False
  16.        
  17.     def pack(self):
  18.         return super().pack(*(self.position[:] + self.velocity[:] + self.rotation[:]))
  19.    
  20.     def unpack(self, bytes_):
  21.         self.position[:], self.velocity[:], self.rotation[:] = super().unpack(bytes_)
  22.  
go to heaven