本文整理汇总了Python中pirates.inventory.ItemGlobals.getFemaleOrientation方法的典型用法代码示例。如果您正苦于以下问题:Python ItemGlobals.getFemaleOrientation方法的具体用法?Python ItemGlobals.getFemaleOrientation怎么用?Python ItemGlobals.getFemaleOrientation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pirates.inventory.ItemGlobals
的用法示例。
在下文中一共展示了ItemGlobals.getFemaleOrientation方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: apply
# 需要导入模块: from pirates.inventory import ItemGlobals [as 别名]
# 或者: from pirates.inventory.ItemGlobals import getFemaleOrientation [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)
示例2: showDetails
# 需要导入模块: from pirates.inventory import ItemGlobals [as 别名]
# 或者: from pirates.inventory.ItemGlobals import getFemaleOrientation [as 别名]
#.........这里部分代码省略.........
chestOffset = -0.20000000000000001
elif bodyShape == 9:
bodyOffset = 0.5
if gender == 'm':
headOffset = -0.29999999999999999
armOffset = -0.20000000000000001
chestOffset = -0.29999999999999999
elif gender == 'f':
headOffset = -0.40000000000000002
armOffset = -0.20000000000000001
chestOffset = -0.29999999999999999
m = Mat4(Mat4.identMat())
itemType = ItemGlobals.getType(itemId)
if itemType == ItemGlobals.CHEST:
tattooType = TattooGlobals.ZONE1
elif itemType == ItemGlobals.ARM:
tattooType = TattooGlobals.ZONE2
elif itemType == ItemGlobals.FACE:
tattooType = TattooGlobals.ZONE4
if localAvatar.style.gender == 'm':
maleModelId = ItemGlobals.getMaleModelId(itemId)
if maleModelId:
tattooId = maleModelId
tattooOrientation = ItemGlobals.getOrientation(ItemGlobals.getMaleOrientation(itemId))
dna = HumanDNA.HumanDNA(localAvatar.style.gender)
dna.copy(localAvatar.style)
gender = 'm'
else:
tattooId = ItemGlobals.getFemaleModelId(itemId)
tattooOrientation = ItemGlobals.getOrientation(ItemGlobals.getFemaleOrientation(itemId))
dna = HumanDNA.HumanDNA('f')
gender = 'f'
else:
femaleModelId = ItemGlobals.getFemaleModelId(itemId)
if femaleModelId:
tattooId = femaleModelId
tattooOrientation = ItemGlobals.getOrientation(ItemGlobals.getFemaleOrientation(itemId))
dna = HumanDNA.HumanDNA(localAvatar.style.gender)
dna.copy(localAvatar.style)
gender = 'f'
else:
tattooId = ItemGlobals.getMaleModelId(itemId)
tattooOrientation = ItemGlobals.getOrientation(ItemGlobals.getMaleOrientation(itemId))
dna = HumanDNA.HumanDNA('m')
gender = 'm'
offsetx = tattooOrientation[0]
offsety = tattooOrientation[1]
scale = tattooOrientation[2]
rotate = tattooOrientation[3]
color = 0
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)
if tattooType == 0:
dna.setClothesShirt(0)
dna.setClothesVest(0)
dna.setClothesCoat(0)
dna.setTattooChest(tattooId, F[0], F[1], S[0], rotate, color)