ahwa Posted April 30, 2015 Share Posted April 30, 2015 How to get the chariot LWH Length = Target.typeDescriptor.chassis['hullPosition'].x High = Target.typeDescriptor.chassis['hullPosition'].y + Target.hull['turretPositions'][0].y Width = Target.typeDescriptor.chassis['hullPosition'].z How will be the middle And not Length Width Height @ Quote Link to comment Short link Share on other sites More sharing options...
spoter Posted May 1, 2015 Share Posted May 1, 2015 def add_observed_piont(vehicle_id): try: self = BigWorld.player().arena.vehicles[vehicle_id]['vehicleType'] if not hasattr(self, 'visibilityCheckPoints') or hasattr(self, 'observerPosOnChassis'): hullPos = self.chassis['hullPosition'] hullBboxMin, hullBboxMax, _ = self.hull['hitTester'].bbox turretPosOnHull = self.hull['turretPositions'][0] turretLocalTopY = max(hullBboxMax.y, turretPosOnHull.y + self.turret['hitTester'].bbox[1].y) gunPosOnHull = turretPosOnHull + self.turret['gunPosition'] hullLocalCenterY = (hullBboxMin.y + hullBboxMax.y) / 2.0 hullLocalPt1 = Vector3(0.0, hullLocalCenterY, hullBboxMax.z) hullLocalPt2 = Vector3(0.0, hullLocalCenterY, hullBboxMin.z) hullLocalCenterZ = (hullBboxMin.z + hullBboxMax.z) / 2.0 hullLocalPt3 = Vector3(hullBboxMax.x, gunPosOnHull.y, hullLocalCenterZ) hullLocalPt4 = Vector3(hullBboxMin.x, gunPosOnHull.y, hullLocalCenterZ) self.visibilityCheckPoints = (Vector3(0.0, hullPos.y + turretLocalTopY, 0.0), hullPos + gunPosOnHull, hullPos + hullLocalPt1, hullPos + hullLocalPt2, hullPos + hullLocalPt3, hullPos + hullLocalPt4) self.checkpointID = 0 self.observerPosOnChassis = Vector3(0, hullPos.y + turretLocalTopY, 0) self.observerPosOnTurret = self.turret['gunPosition'] except: pass @ Quote Link to comment Short link Share on other sites More sharing options...
ahwa Posted May 1, 2015 Author Share Posted May 1, 2015 THXI have studied a look I do not understand In advice def add_observed_piont(vehicle_id): try: self = BigWorld.player().arena.vehicles[vehicle_id]['vehicleType'] if not hasattr(self, 'visibilityCheckPoints') or hasattr(self, 'observerPosOnChassis'): hullPos = self.chassis['hullPosition'] hullBboxMin, hullBboxMax, _ = self.hull['hitTester'].bbox turretPosOnHull = self.hull['turretPositions'][0] turretLocalTopY = max(hullBboxMax.y, turretPosOnHull.y + self.turret['hitTester'].bbox[1].y) gunPosOnHull = turretPosOnHull + self.turret['gunPosition'] hullLocalCenterY = (hullBboxMin.y + hullBboxMax.y) / 2.0 hullLocalPt1 = Vector3(0.0, hullLocalCenterY, hullBboxMax.z) hullLocalPt2 = Vector3(0.0, hullLocalCenterY, hullBboxMin.z) hullLocalCenterZ = (hullBboxMin.z + hullBboxMax.z) / 2.0 hullLocalPt3 = Vector3(hullBboxMax.x, gunPosOnHull.y, hullLocalCenterZ) hullLocalPt4 = Vector3(hullBboxMin.x, gunPosOnHull.y, hullLocalCenterZ) self.visibilityCheckPoints = (Vector3(0.0, hullPos.y + turretLocalTopY, 0.0), hullPos + gunPosOnHull, hullPos + hullLocalPt1, hullPos + hullLocalPt2, hullPos + hullLocalPt3, hullPos + hullLocalPt4) self.checkpointID = 0 self.observerPosOnChassis = Vector3(0, hullPos.y + turretLocalTopY, 0) self.observerPosOnTurret = self.turret['gunPosition'] except: pass LengthPosition HighPosition WidthPosition To send a message in return self.observerPosOnChassis ???? @ Quote Link to comment Short link Share on other sites More sharing options...
Helkar Posted May 1, 2015 Share Posted May 1, 2015 def add_observed_piont(vehicle_id): try: self = BigWorld.player().arena.vehicles[vehicle_id]['vehicleType'] if not hasattr(self, 'visibilityCheckPoints') or hasattr(self, 'observerPosOnChassis'): hullPos = self.chassis['hullPosition'] hullBboxMin, hullBboxMax, _ = self.hull['hitTester'].bbox turretPosOnHull = self.hull['turretPositions'][0] turretLocalTopY = max(hullBboxMax.y, turretPosOnHull.y + self.turret['hitTester'].bbox[1].y) gunPosOnHull = turretPosOnHull + self.turret['gunPosition'] hullLocalCenterY = (hullBboxMin.y + hullBboxMax.y) / 2.0 hullLocalPt1 = Vector3(0.0, hullLocalCenterY, hullBboxMax.z) hullLocalPt2 = Vector3(0.0, hullLocalCenterY, hullBboxMin.z) hullLocalCenterZ = (hullBboxMin.z + hullBboxMax.z) / 2.0 hullLocalPt3 = Vector3(hullBboxMax.x, gunPosOnHull.y, hullLocalCenterZ) hullLocalPt4 = Vector3(hullBboxMin.x, gunPosOnHull.y, hullLocalCenterZ) self.visibilityCheckPoints = (Vector3(0.0, hullPos.y + turretLocalTopY, 0.0), hullPos + gunPosOnHull, hullPos + hullLocalPt1, hullPos + hullLocalPt2, hullPos + hullLocalPt3, hullPos + hullLocalPt4) self.checkpointID = 0 self.observerPosOnChassis = Vector3(0, hullPos.y + turretLocalTopY, 0) self.observerPosOnTurret = self.turret['gunPosition'] except: pass just one note: at beginning of the battle, you will have no bbox available, so need to call loadBspModel() at 'hitTester' objects @ Quote Link to comment Short link Share on other sites More sharing options...
ahwa Posted May 1, 2015 Author Share Posted May 1, 2015 just one note: at beginning of the battle, you will have no bbox available, so need to call loadBspModel() at 'hitTester' objects I still do not understand, give a simple example, can you? THX @ Quote Link to comment Short link Share on other sites More sharing options...
Helkar Posted May 1, 2015 Share Posted May 1, 2015 I still do not understand, give a simple example, can you? THX sorry have no time now, the note was for spoter @ Quote Link to comment Short link Share on other sites More sharing options...
KACTET Posted May 2, 2015 Share Posted May 2, 2015 (edited) AimPos.y += AimVehicle.typeDescriptor.chassis['hullPosition'].y * 0.47 + autoAimVehicle.typeDescriptor.hull['turretPositions'][0].y * 0.47 Edited May 2, 2015 by KACTET 1 1 @ Quote Link to comment Short link Share on other sites More sharing options...
ahwa Posted May 2, 2015 Author Share Posted May 2, 2015 AimPos.y += AimVehicle.typeDescriptor.chassis['hullPosition'].y * 0.47 + autoAimVehicle.typeDescriptor.hull['turretPositions'][0].y * 0.47 This is the height location Rather than the pixel length and width and height Show screen test g_windowsManager.battleWindow.call('battle.PlayerMessagesPanel.ShowMessage', ['0', str(AimVehicle.typeDescriptor.chassis['hullPosition'].y), 'red']) Showing 0.0 Obviously he is to take the middle position of the target height However, I would like to come up with pixel length and width and height @ Quote Link to comment Short link Share on other sites More sharing options...
KACTET Posted May 2, 2015 Share Posted May 2, 2015 AimPos = Math.Vector3(autoAimVehicle.position) AimPos.y += AimVehicle.typeDescriptor.chassis['hullPosition'].y * 0.47 + autoAimVehicle.typeDescriptor.hull['turretPositions'][0].y * 0.47 1 1 @ Quote Link to comment Short link Share on other sites More sharing options...
ahwa Posted May 3, 2015 Author Share Posted May 3, 2015 AimPos = Math.Vector3(autoAimVehicle.position) AimPos.y += AimVehicle.typeDescriptor.chassis['hullPosition'].y * 0.47 + autoAimVehicle.typeDescriptor.hull['turretPositions'][0].y * 0.47 I would like to know the enemy tanks pixels total width and total height and total length Now, the code is just total height? How to x and z total @ Quote Link to comment Short link Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.