public static void BubblesWaterAnimation(SceneManager sceneMgr, Vector3 pos, string baseName, int count, Vector2 range, Vector2 size) { Vector2 sizeRand; string name; for (uint i = 0; i < count; i++) { float h = Mogre.Math.RangeRandom(-20, -5); float angle = Mogre.Math.RangeRandom(-10, 10); Vector2 rand = ViewHelper.RandomVector2(range.x, range.y); Vector3 posView = new Vector3(pos.x + rand.x, pos.y + h, pos.z + rand.y); name = EffectsManager.BuildSpriteEffectName(sceneMgr.RootSceneNode, EffectsManager.EffectType.BUBBLES, baseName + "_bubbles_" + i); NodeAnimation.NodeAnimation node = EffectsManager.Singleton.GetEffect(name); if (!EffectsManager.Singleton.EffectExists(name) || (node != null && node.Ended)) { sizeRand = size * Math.RangeRandom(0.9f, 1.1f); VisibilityNodeAnimation ani = EffectsManager.Singleton.RectangularEffect(sceneMgr, sceneMgr.RootSceneNode, baseName + "_bubbles_" + i, EffectsManager.EffectType.BUBBLES, posView, sizeRand, new Quaternion(new Radian(new Degree(90)), Vector3.UNIT_X) * new Quaternion(new Radian(new Degree(angle)), Vector3.UNIT_Y), false); ani.Duration = Mogre.Math.RangeRandom(ani.Duration, 2 * ani.Duration); ani.TimeScale = Mogre.Math.RangeRandom(0.5f, 1.5f); } } }
public void ShowCrossHair(float distance) { Quaternion q = Quaternion.IDENTITY; q.FromAngleAxis(new Radian(Math.HALF_PI), Vector3.UNIT_X); crossHairEffectNodeAnimation = EffectsManager.Singleton.RectangularEffect(sceneMgr, innerNode, "CrossHair", EffectsManager.EffectType.CROSSHAIR, new Vector3(0, 0, -distance), new Vector2(3, 3), q, true); }
public static void SinkingWaterAnimation(SceneManager sceneMgr, Vector3 pos, string baseName, int count, Vector2 range, Vector2 size) { string name; Vector2 sizeRand; for (uint i = 0; i < count; i++) { Vector2 rand = ViewHelper.RandomVector2(range.x, range.y); Vector3 posView = new Vector3(pos.x + rand.x, pos.y, pos.z + rand.y); name = EffectsManager.BuildSpriteEffectName(sceneMgr.RootSceneNode, EffectsManager.EffectType.SUBMERGE, baseName + "_" + i); NodeAnimation.NodeAnimation node = EffectsManager.Singleton.GetEffect(name); if (!EffectsManager.Singleton.EffectExists(name) || (node != null && node.getPercent() > 0.6f)) { sizeRand = size * Math.RangeRandom(0.9f, 1.1f); VisibilityNodeAnimation ani = EffectsManager.Singleton.RectangularEffect(sceneMgr, sceneMgr.RootSceneNode, baseName + "_" + i, EffectsManager.EffectType.SUBMERGE, posView, sizeRand, Quaternion.IDENTITY, false); ani.Duration = Mogre.Math.RangeRandom(ani.Duration, 2 * ani.Duration); ani.TimeScale = Mogre.Math.RangeRandom(0.5f, 1.5f); } } }
protected void DestroyCrossHair() { crossHairEffectNodeAnimation = null; EffectsManager.Singleton.NoSprite(sceneMgr, innerNode, EffectsManager.EffectType.CROSSHAIR, "CrossHair"); }
public void HideCrossHair() { crossHairEffectNodeAnimation = null; EffectsManager.Singleton.HideSprite(sceneMgr, innerNode, EffectsManager.EffectType.CROSSHAIR, "CrossHair"); }