コード例 #1
0
ファイル: flock.py プロジェクト: webiumsk/WOT-0.9.15.1
 def set(self, start, end):
     self.start = start
     self.end = end
     direction = end - start
     m = mathUtils.createSRTMatrix((self.__thickness, self.__thickness, direction.length), (direction.yaw, direction.pitch, 0), start + direction / 2)
     m.preMultiply(mathUtils.createTranslationMatrix(Vector3(-0.5, -0.5, -0.5)))
     self.motor.signal = m
コード例 #2
0
 def set(self, start, end):
     self.start = start
     self.end = end
     direction = end - start
     m = mathUtils.createSRTMatrix((self.__thickness, self.__thickness, direction.length), (direction.yaw, direction.pitch, 0), start + direction / 2)
     m.preMultiply(mathUtils.createTranslationMatrix(Vector3(-0.5, -0.5, -0.5)))
     self.motor.signal = m
コード例 #3
0
ファイル: guiclienthangarspace.py プロジェクト: Difrex/wotsdk
 def __setupModel(self, buildIdx):
     model = self.__assembleModel()
     matrix = mathUtils.createSRTMatrix(Math.Vector3(_CFG['v_scale'], _CFG['v_scale'], _CFG['v_scale']), _CFG['v_start_angles'], _CFG['v_start_pos'])
     model.matrix = matrix
     self.__doFinalSetup(buildIdx, model)
     entity = BigWorld.entity(self.__vEntityId)
     if isinstance(entity, HangarVehicle):
         entity.typeDescriptor = self.__vDesc
コード例 #4
0
 def __createCube(self, position, size):
     modelName = self.CUBE_MODEL
     model, motor = self.__getModel(modelName)
     m = mathUtils.createSRTMatrix(size, (0, 0, 0), position)
     m.preMultiply(
         mathUtils.createTranslationMatrix(Vector3(0.0, -0.5, 0.0)))
     motor.signal = m
     return (modelName, model, motor)
コード例 #5
0
 def __init__(self):
     BigWorld.UserDataObject.__init__(self)
     BigWorld.addSoundZoneTrigger(self.position, Math.Vector3(self.direction.z, self.direction.y, self.direction.x), Math.Vector3(self.Size.x, self.Size.y, self.Size.z), self.ZoneEnter, self.ZoneExit, self.Reverb, self.ReverbLevel, self.VolumeDeviation)
     if VISUALISE_ZONE:
         self.model = BigWorld.Model('objects/misc/bbox/unit_cube_1m_proxy.model')
         BigWorld.player().addModel(self.model)
         motor = BigWorld.Servo(Math.Matrix())
         self.model.addMotor(motor)
         motor.signal = mathUtils.createSRTMatrix(Math.Vector3(self.Size.x, self.Size.y, self.Size.z), Math.Vector3(self.direction.z, self.direction.y, self.direction.x), self.position)
コード例 #6
0
 def __init__(self, beginExplosionPos, endExplosionPos, areaWidth, velocity):
     CallbackDelayer.__init__(self)
     self.model = BigWorld.Model("helpers/models/unit_cube.model")
     BigWorld.addModel(self.model)
     self.model.position = beginExplosionPos
     linearHomer = BigWorld.LinearHomer()
     self.model.addMotor(linearHomer)
     linearHomer.align = mathUtils.createSRTMatrix((areaWidth, 5, 1), (0.0, 0, 0), Vector3(0, 0, 0))
     linearHomer.acceleration = 0
     linearHomer.velocity = velocity
     linearHomer.target = mathUtils.createTranslationMatrix(endExplosionPos)
     linearHomer.proximityCallback = self.__onDeath
コード例 #7
0
 def __init__(self, beginExplosionPos, endExplosionPos, areaWidth, velocity):
     CallbackDelayer.__init__(self)
     self.model = BigWorld.Model('helpers/models/unit_cube.model')
     BigWorld.addModel(self.model)
     self.model.position = beginExplosionPos
     linearHomer = BigWorld.LinearHomer()
     self.model.addMotor(linearHomer)
     linearHomer.align = mathUtils.createSRTMatrix((areaWidth, 5, 1), (0.0, 0, 0), Vector3(0, 0, 0))
     linearHomer.acceleration = 0
     linearHomer.velocity = velocity
     linearHomer.target = mathUtils.createTranslationMatrix(endExplosionPos)
     linearHomer.proximityCallback = self.__onDeath
コード例 #8
0
 def __createDirectedLine(self, pointA, pointB, width):
     modelName = self.CUBE_MODEL
     model, motor = self.__getModel(modelName)
     direction = pointB - pointA
     scale = (width, width, direction.length)
     rotation = (direction.yaw, direction.pitch, 0)
     translation = pointA + direction * 0.5
     m = mathUtils.createSRTMatrix(scale, rotation, translation)
     m.preMultiply(
         mathUtils.createTranslationMatrix(Vector3(0.0, -0.5, 0.0)))
     motor.signal = m
     return (modelName, model, motor)
コード例 #9
0
 def __setupModel(self, buildIdx):
     self.__assembleModel()
     cfg = hangarCFG()
     matrix = mathUtils.createSRTMatrix(Math.Vector3(cfg['v_scale'], cfg['v_scale'], cfg['v_scale']), Math.Vector3(self.__vEntity.yaw, self.__vEntity.pitch, self.__vEntity.roll), self.__vEntity.position)
     self.__vEntity.model.matrix = matrix
     self.__doFinalSetup(buildIdx)
     self.__vEntity.typeDescriptor = self.__vDesc
     gunColBox = self.collisions.getBoundingBox(TankPartNames.getIdx(TankPartNames.GUN) + 3)
     center = 0.5 * (gunColBox[1] - gunColBox[0])
     gunoffset = Math.Matrix()
     gunoffset.setTranslate((0.0, 0.0, center.z + gunColBox[0].z))
     gunLink = mathUtils.MatrixProviders.product(gunoffset, self.__vEntity.model.node(TankPartNames.GUN))
     collisionData = ((TankPartNames.getIdx(TankPartNames.CHASSIS), self.__vEntity.model.matrix),
      (TankPartNames.getIdx(TankPartNames.HULL), self.__vEntity.model.node(TankPartNames.HULL)),
      (TankPartNames.getIdx(TankPartNames.TURRET), self.__vEntity.model.node(TankPartNames.TURRET)),
      (TankPartNames.getIdx(TankPartNames.GUN), self.__vEntity.model.node(TankPartNames.GUN)))
     self.collisions.connect(self.__vEntity.id, ColliderTypes.VEHICLE_COLLIDER, collisionData)
     collisionData = ((TankPartNames.getIdx(TankPartNames.GUN) + 1, self.__vEntity.model.node(TankPartNames.HULL)), (TankPartNames.getIdx(TankPartNames.GUN) + 2, self.__vEntity.model.node(TankPartNames.TURRET)), (TankPartNames.getIdx(TankPartNames.GUN) + 3, gunLink))
     self.collisions.connect(self.__vEntity.id, ColliderTypes.HANGAR_VEHICLE_COLLIDER, collisionData)
     self.__reloadColliderType(self.__vEntity.state)
     self.__reloadShadowManagerTarget(self.__vEntity.state)
コード例 #10
0
 def __createSphere(self, position, radius):
     modelName = self.SPHERE_MODEL
     model, motor = self.__getModel(modelName)
     motor.signal = mathUtils.createSRTMatrix(radius, (0, 0, 0), position)
     return (modelName, model, motor)