/// <summary> /// Inicializa las variables necesarias para el Bote /// </summary> public Barco() { Device d3dDevice = GuiController.Instance.D3dDevice; cargarEmbarcacion(); cañon = new Cañon(); velocidad_desplazamiento = 0; vel = new Vector3(0f, 0f, 0f); angulo = 0; shootFlag = (bool)Parametros.getModificador("sonidoCañon"); }
public void cargarEmbarcacion() { // Crear loader TgcSceneLoader loader = new TgcSceneLoader(); //Cargar mesh scene = loader.loadSceneFromFile(GuiController.Instance.AlumnoEjemplosMediaDir + "Dunedains\\Meshes\\Ship\\Ship-TgcScene.xml"); meshBarco = scene.Meshes[0]; meshBarco.Scale = new Vector3(0.05f, 0.05f, 0.05f); meshBarco.Position = new Vector3(POSX, POSY, POSZ); meshBarco.AutoTransformEnable = false; // Calcular dimensiones Vector3 BoundingBoxSize = meshBarco.BoundingBox.calculateSize(); largoBote = Math.Abs(BoundingBoxSize.Z); anchoBote = Math.Abs(BoundingBoxSize.X); altoBote = Math.Abs(BoundingBoxSize.Y); cañon = new Cañon(); }