protected void initBarrack(SceneNode islandNode, float positionOnIsland) { String nameSuffix = tileID.ToString(); installationEntity = sceneMgr.CreateEntity("Barracks" + nameSuffix, "Barracks.mesh"); installationNode = islandNode.CreateChildSceneNode("Barracks" + nameSuffix, new Vector3(0, 0, positionOnIsland - 5.0f)); installationNode.AttachObject(installationEntity); installationNode.Scale(new Vector3(1.0f, 1.2f, 1.0f)); installationNode.Translate(new Vector3(0.0f, levelTile.HitBound.LowestY, 0.0f)); if (LevelView.IsNightScene && EngineConfig.ShadowsQuality == 0) // cienie nie lubia innych zrodel swiatla :/ { InitLightFlare(new ColourValue(1f, 1f, 0.9f), new Vector3(0, 1.9f, -2.6f), new Vector2(1.5f, 1.5f)); } if (EngineConfig.DisplayingMinimap) { minimapItem = new MinimapItem(installationNode, framework.MinimapMgr, "Cube.mesh", new ColourValue(0, 0.8f, 0), installationEntity); minimapItem.ScaleOverride = new Vector2(0, 13); // stala wysokosc bunkra, niezale¿na od bounding box minimapItem.Refresh(); } }
protected override void preInitOnScene() { ammunitionModel = sceneMgr.CreateEntity("Flak" + ammunitionID.ToString(), "FlakBullet.mesh"); ammunitionNode = sceneMgr.RootSceneNode.CreateChildSceneNode("Flak" + ammunitionID.ToString(), hiddenPosition); Vector3 oVector = new Vector3(0, 0, -1); innerNode = ammunitionNode.CreateChildSceneNode("FlakInner" + ammunitionID.ToString(), new Vector3(0, 0, 0)); innerNode.AttachObject(ammunitionModel); innerNode.SetScale(0.7f, 0.7f, 0.7f); missileAnimation = new ConstRotateNodeAnimation(innerNode, 75, oVector, "ConstRot"); missileAnimation.Enabled = true; missileAnimation.Looped = true; if (EngineConfig.DisplayingMinimap) { minimapItem = new MinimapItem(ammunitionNode, framework.MinimapMgr, "Cube.mesh", ColourValue.White, ammunitionModel); minimapItem.ScaleOverride = new Vector2(4, 2); minimapItem.Refresh(); minimapItem.Hide(); } ammunitionNode.SetVisible(false); innerNode.SetVisible(false); }
private void initBunker(SceneNode shipSceneNode, float positionOnShip) { String nameSuffix = tileID.ToString(); installationNode = shipSceneNode.CreateChildSceneNode("GunEmplacement" + nameSuffix); installationNode.Translate(new Vector3(0.0f, UnitConverter.LogicToWorldUnits(new PointD(0, (levelTile.YBegin + levelTile.YEnd) / 2.0f)).y - 0.4f, positionOnShip)); installationEntity = sceneMgr.CreateEntity("ShipFlakBase" + nameSuffix, "ShipFlakBase.mesh"); installationNode.AttachObject(installationEntity); isConcrete = false; if (LevelTile is ConcreteBunkerTile) { isConcrete = true; installationEntity.SetMaterialName("Concrete"); // aby by³ betonowy } flakBarrel = sceneMgr.CreateEntity("ShipFlakBarrel" + nameSuffix, "ShipFlakBarrel.mesh"); gunNode = installationNode.CreateChildSceneNode("ShipFlakBarrelNode" + nameSuffix, new Vector3(0.0f, 0.9f, 0.0f)); gunNode.AttachObject(flakBarrel); if (HasRockets) { for (int i = -1; i <= 1; i += 2) { Entity rocketBayEntity = sceneMgr.CreateEntity("RocketBay" + nameSuffix + "_" + i, "RocketBay.mesh"); SceneNode rocketBayNode = installationNode.CreateChildSceneNode(rocketBayEntity.Name + "Node", new Vector3(2.0f * i, -0.2f, levelTile.ViewXShift)); // rocketBayNode.SetScale(1, 4, 1); rocketBayNode.AttachObject(rocketBayEntity); } } if (EngineConfig.DisplayingMinimap) { minimapItem = new MinimapItem(installationNode, framework.MinimapMgr, "Cube.mesh", ColourValue.Red, installationEntity); minimapItem.MinimapObjectsDepth = 5.0f; minimapItem.ScaleOverride = new Vector2(3, 10); // stala wysokosc dziala, niezale¿na od bounding box minimapItem.Refresh(); } barrelState = flakBarrel.GetAnimationState("manual"); barrelState.Enabled = true; barrelState.Loop = true; animableElements.Add(barrelState); }
private void initBunker(SceneNode islandNode, float positionOnIsland) { if (LevelTile is FlakBunkerTile) { initFlakBunker(islandNode, positionOnIsland); } else { initRegularBunker(islandNode, positionOnIsland); } // init rockets if (HasRockets) { initRockets(islandNode, positionOnIsland); } String nameSuffix = tileID.ToString(); if (EngineConfig.DisplayingMinimap) { ColourValue col = ColourValue.Red; if (isConcrete) { col = new ColourValue(0, 0, 1); } minimapItem = new MinimapItem(gunPlaceNode, framework.MinimapMgr, "Cube.mesh", col, installationEntity); minimapItem.ScaleOverride = new Vector2(0, 13); // stala wysokosc dziala, niezale¿na od bounding box minimapItem.Refresh(); } barrelState = flakBarrel.GetAnimationState("manual"); barrelState.Enabled = true; barrelState.Loop = true; animableElements.Add(barrelState); if ((levelTile as BunkerTile).UsingReflector) { initReflector(); } }