예제 #1
0
    def __init__(self, arg=None, template=None):
        self.name = ''
        self.arg = arg
        self.template = template
        self.io_size = 0
        self.io_start = 0
        self.type = 0
        self.unknown_2_a = 0
        self.unknown_2_b = 0

        # 16
        self.unknown_2_c = 0

        # 0
        self.unknown_2_d = 0

        # 564267
        self.unknown_3 = 0

        # 46
        self.unknown_4 = 0
        self.namespace_offset = 0
        self.sphere = Sphere()
        self.bbox = BoundingBox()
        self.capsule = Capsule()
예제 #2
0
 def set_defaults(self):
     self.type = CollisionType()
     self.flag_0 = 0
     self.flag_1 = 0
     self.flag_2 = 0
     self.flag_3 = 0
     if self.context.version < 47:
         self.zero_extra_pc_unk = 0
     self.name_offset = 0
     if self.type == 0:
         self.collider = Sphere(self.context, None, None)
     if self.type == 1:
         self.collider = BoundingBox(self.context, None, None)
     if self.type == 2:
         self.collider = Capsule(self.context, None, None)
     if self.type == 3:
         self.collider = Cylinder(self.context, None, None)
     if self.type == 7:
         self.collider = ConvexHull(self.context, None, None)
     if self.type == 8:
         self.collider = ConvexHull(self.context, None, None)
     if self.type == 10:
         self.collider = MeshCollision(self.context, None, None)
     if self.context.version == 13:
         self.zero_extra_zt = 0
예제 #3
0
    def __init__(self, arg=None, template=None):
        self.name = ''
        self.arg = arg
        self.template = template
        self.io_size = 0
        self.io_start = 0
        self.type = CollisionType()
        self.unknown_2_a = 0
        self.unknown_2_b = 0

        # 16
        self.unknown_2_c = 0

        # 0
        self.unknown_2_d = 0

        # JWE: 564267, PZ: seen 17 and 22
        self.unknown_3 = 0

        # JWE: 46, PZ: same as above
        self.unknown_4 = 0
        self.zero_extra_pc_unk = 0

        # offset into joint names
        self.name_offset = 0
        self.collider = Sphere()
        self.collider = BoundingBox()
        self.collider = Capsule()
        self.collider = Cylinder()
        self.collider = ConvexHull()
        self.collider = ConvexHull()
        self.collider = MeshCollision()
예제 #4
0
    def __init__(self, context, arg=None, template=None):
        self.name = ''
        self._context = context
        self.arg = arg
        self.template = template
        self.io_size = 0
        self.io_start = 0
        self.type = CollisionType()

        # 0
        self.flag_0 = 0

        # JWE1: 16, PZ, JWE2: 0
        self.flag_1 = 0

        # JWE1: 564267, PZ: seen 17 and 22, JWE2: 34, 30
        self.flag_2 = 0

        # JWE1: 46, PZ: same as above, JWE2: 21, 27
        self.flag_3 = 0

        # ?
        self.zero_extra_pc_unk = 0

        # offset into joint names
        self.name_offset = 0
        self.collider = Sphere(self.context, None, None)
        self.collider = BoundingBox(self.context, None, None)
        self.collider = Capsule(self.context, None, None)
        self.collider = Cylinder(self.context, None, None)
        self.collider = ConvexHull(self.context, None, None)
        self.collider = ConvexHull(self.context, None, None)
        self.collider = MeshCollision(self.context, None, None)

        # ?
        self.zero_extra_zt = 0
        self.set_defaults()
예제 #5
0
def export_capsulebv(b_obj, hitcheck):
	hitcheck.type = CollisionType.Capsule
	hitcheck.collider = Capsule()
	_capsule_transform(b_obj, hitcheck)
예제 #6
0
class HitCheckEntry:
    def __init__(self, arg=None, template=None):
        self.arg = arg
        self.template = template
        self.io_size = 0
        self.io_start = 0
        self.type = 0
        self.unknown_2_a = 0
        self.unknown_2_b = 0

        # 16
        self.unknown_2_c = 0

        # 0
        self.unknown_2_d = 0

        # 564267
        self.unknown_3 = 0

        # 46
        self.unknown_4 = 0
        self.namespace_offset = 0
        self.bbox = BoundingBox()
        self.capsule = Capsule()

    def read(self, stream):

        self.io_start = stream.tell()
        self.type = stream.read_uint()
        self.unknown_2_a = stream.read_ubyte()
        self.unknown_2_b = stream.read_ubyte()
        self.unknown_2_c = stream.read_ubyte()
        self.unknown_2_d = stream.read_ubyte()
        self.unknown_3 = stream.read_uint()
        self.unknown_4 = stream.read_uint()
        self.namespace_offset = stream.read_uint()
        if self.type == 1:
            self.bbox = stream.read_type(BoundingBox)
        if self.type == 2:
            self.capsule = stream.read_type(Capsule)

        self.io_size = stream.tell() - self.io_start

    def write(self, stream):

        self.io_start = stream.tell()
        stream.write_uint(self.type)
        stream.write_ubyte(self.unknown_2_a)
        stream.write_ubyte(self.unknown_2_b)
        stream.write_ubyte(self.unknown_2_c)
        stream.write_ubyte(self.unknown_2_d)
        stream.write_uint(self.unknown_3)
        stream.write_uint(self.unknown_4)
        stream.write_uint(self.namespace_offset)
        if self.type == 1:
            stream.write_type(self.bbox)
        if self.type == 2:
            stream.write_type(self.capsule)

        self.io_size = stream.tell() - self.io_start

    def __repr__(self):
        s = 'HitCheckEntry [Size: ' + str(self.io_size) + ', Address:' + str(
            self.io_start) + ']'
        s += '\n	* type = ' + self.type.__repr__()
        s += '\n	* unknown_2_a = ' + self.unknown_2_a.__repr__()
        s += '\n	* unknown_2_b = ' + self.unknown_2_b.__repr__()
        s += '\n	* unknown_2_c = ' + self.unknown_2_c.__repr__()
        s += '\n	* unknown_2_d = ' + self.unknown_2_d.__repr__()
        s += '\n	* unknown_3 = ' + self.unknown_3.__repr__()
        s += '\n	* unknown_4 = ' + self.unknown_4.__repr__()
        s += '\n	* namespace_offset = ' + self.namespace_offset.__repr__()
        s += '\n	* bbox = ' + self.bbox.__repr__()
        s += '\n	* capsule = ' + self.capsule.__repr__()
        s += '\n'
        return s