本文整理汇总了Python中pirates.inventory.ItemGlobals.getFemaleOrientation2方法的典型用法代码示例。如果您正苦于以下问题:Python ItemGlobals.getFemaleOrientation2方法的具体用法?Python ItemGlobals.getFemaleOrientation2怎么用?Python ItemGlobals.getFemaleOrientation2使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pirates.inventory.ItemGlobals
的用法示例。
在下文中一共展示了ItemGlobals.getFemaleOrientation2方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: apply
# 需要导入模块: from pirates.inventory import ItemGlobals [as 别名]
# 或者: from pirates.inventory.ItemGlobals import getFemaleOrientation2 [as 别名]
def apply(self, pirate):
pirate.style.setClothesShirt(0)
pirate.style.setClothesCoat(0)
pirate.style.setClothesVest(0)
pirate.model.handleClothesHiding()
gender = localAvatar.style.getGender()
if gender == 'm':
tattooId = ItemGlobals.getMaleModelId(self.uid)
if self.zone == TattooGlobals.ZONE3:
orientation = ItemGlobals.getMaleOrientation2(self.uid)
else:
orientation = ItemGlobals.getMaleOrientation(self.uid)
else:
tattooId = ItemGlobals.getFemaleModelId(self.uid)
if self.zone == TattooGlobals.ZONE3:
orientation = ItemGlobals.getFemaleOrientation2(self.uid)
else:
orientation = ItemGlobals.getFemaleOrientation(self.uid)
(offsetx, offsety, scale, rotate) = ItemGlobals.getOrientation(orientation)
if not hasattr(pirate, 'model'):
return None
pirate.model.tattoos[self.zone][TattooGlobals.TYPE] = tattooId
S = Vec2(1 / float(scale), 1 / float(scale))
Iv = Vec2(offsetx, offsety)
Vm = Vec2(sin(rotate * pi / 180.0), cos(rotate * pi / 180.0))
Vms = Vec2(Vm[0] * S[0], Vm[1] * S[1])
Vn = Vec2(Vm[1], -Vm[0])
Vns = Vec2(Vn[0] * S[0], Vn[1] * S[1])
F = Vec2(-Vns.dot(Iv) + 0.5, -Vms.dot(Iv) + 0.5)
pirate.model.tattoos[self.zone][TattooGlobals.OFFSETX] = F[0]
pirate.model.tattoos[self.zone][TattooGlobals.OFFSETY] = F[1]
pirate.model.tattoos[self.zone][TattooGlobals.SCALE] = S[0]
pirate.model.tattoos[self.zone][TattooGlobals.ROTATE] = rotate
pirate.model.updateTattoo(self.zone)