def read(io_stream): return VertexMaterialInfo(attributes=read_long(io_stream), ambient=RGBA.read(io_stream), diffuse=RGBA.read(io_stream), specular=RGBA.read(io_stream), emissive=RGBA.read(io_stream), shininess=read_float(io_stream), opacity=read_float(io_stream), translucency=read_float(io_stream))
def __init__(self, attributes=0, ambient=RGBA(), diffuse=RGBA(), specular=RGBA(), emissive=RGBA(), shininess=0.0, opacity=1.0, translucency=0.0): self.attributes = attributes self.ambient = ambient # alpha is only padding in this and below self.diffuse = diffuse self.specular = specular self.emissive = emissive self.shininess = shininess self.opacity = opacity self.translucency = translucency
def read(io_stream): ver = Version.read(io_stream) flags = read_ulong(io_stream) return CollisionBox(version=ver, box_type=(flags & ATTRIBUTE_MASK), collision_types=(flags & COLLISION_TYPE_MASK), name_=read_long_fixed_string(io_stream), color=RGBA.read(io_stream), center=read_vector(io_stream), extend=read_vector(io_stream))
def read(io_stream): ver = Version.read(io_stream) flags = read_ulong(io_stream) return CollisionBox(version=ver, box_type=(flags & 0b11), collision_types=(flags & 0xFF0), name_=read_long_fixed_string(io_stream), color=RGBA.read(io_stream), center=read_vector(io_stream), extend=read_vector(io_stream))
def __init__(self, version=Version(), box_type=0, collision_types=0, name_='', color=RGBA(), center=Vector((0.0, 0.0, 0.0)), extend=Vector((0.0, 0.0, 0.0)), joypad_picking_only=False): self.version = version self.box_type = box_type self.collision_types = collision_types self.name_ = name_ self.color = color self.center = center self.extend = extend self.joypad_picking_only = joypad_picking_only
def get_rgba(a=0): return RGBA(r=3, g=200, b=44, a=a)