public Water(Map.Map map) { MainGraphic = new MetaModel { AlphaRef = 0, HasAlpha = true, IsWater = true, Texture = new TextureFromFile("Models/Props/Sky1.png"), SpecularTexture = new TextureFromFile("Models/Props/WaterSpecular1.png"), ReceivesAmbientLight = Priority.Never, ReceivesDiffuseLight = Priority.Never, ReceivesSpecular = Priority.Never, SpecularExponent = 3, TextureAddress = SlimDX.Direct3D9.TextureAddress.Wrap, XMesh = new MeshConcretize { MeshDescription = new Graphics.Software.Meshes.IndexedPlane { Position = Common.Math.ToVector3(map.Settings.Position) + Vector3.UnitZ * map.Settings.WaterHeight, Size = new Vector2(map.Ground.Size.Width, map.Ground.Size.Height), UVMin = Vector2.Zero, UVMax = new Vector2(1, 1), Facings = Facings.Frontside }, Layout = global::Graphics.Software.Vertex.PositionNormalTexcoord.Instance }, }; //VisibilityLocalBounding = new BoundingBox(new Vector3(-1000, -1000, -1000), new Vector3(1000, 1000, 1000)) VisibilityLocalBounding = new Common.Bounding.NonfittableBounding(new BoundingBox(new Vector3(-1000, -1000, -1000), new Vector3(1000, 1000, 1000)), false, true); }
public Projectile() { MainGraphic = new MetaModel { XMesh = new MeshConcretize { MeshDescription = new Graphics.Software.Meshes.IndexedPlane { Position = Vector3.Zero, Size = new Vector2(1, 1), UVMin = new Vector2(0, 0), UVMax = new Vector2(1, 1), Facings = global::Graphics.Facings.Frontside }, Layout = global::Graphics.Software.Vertex.PositionNormalTexcoord.Instance, }, World = Matrix.Translation(-0.5f, -1, 0) * Matrix.Scaling(0.08f, 1.0f, 1) //* Matrix.RotationZ((float)Math.PI/2f) * Matrix.RotationX(-(float)Math.PI/2f) , Texture = new TextureFromFile("Models/Effects/Trajectory1.png"), HasAlpha = true, Opacity = 0.5f }; VisibilityLocalBounding = new Common.Bounding.NonfittableBounding(Vector3.Zero, false, true); PickingLocalBounding = new MetaBoundingBox { Mesh = ((MetaModel)MainGraphic).XMesh, Transformation = ((MetaModel)MainGraphic).World }; PhysicsLocalBounding = Vector3.Zero; TimeToLive = 0.4f; Updateable = true; }
public Projectile() { MainGraphic = new MetaModel { XMesh = new MeshConcretize { MeshDescription = new Graphics.Software.Meshes.IndexedPlane { Position = Vector3.Zero, Size = new Vector2(1, 1), UVMin = new Vector2(0, 0), UVMax = new Vector2(1, 1), Facings = global::Graphics.Facings.Frontside }, Layout = global::Graphics.Software.Vertex.PositionNormalTexcoord.Instance, }, World = Matrix.Translation(-0.5f, -1, 0) * Matrix.Scaling(0.08f, 1.0f, 1) //* Matrix.RotationZ((float)Math.PI/2f) * Matrix.RotationX(-(float)Math.PI / 2f) , Texture = new TextureFromFile("Models/Effects/Trajectory1.png"), HasAlpha = true, Opacity = 0.5f }; VisibilityLocalBounding = new Common.Bounding.NonfittableBounding(Vector3.Zero, false, true); PickingLocalBounding = new MetaBoundingBox { Mesh = ((MetaModel)MainGraphic).XMesh, Transformation = ((MetaModel)MainGraphic).World }; PhysicsLocalBounding = Vector3.Zero; TimeToLive = 0.4f; Updateable = true; }
// ---------------------------------------------------------------------------------------------- // -- NonfittableBounding ----------------------------------------------------------------------- // ---------------------------------------------------------------------------------------------- public static bool Intersect(Common.Bounding.NonfittableBounding a, object b, out object intersection) { intersection = null; if (a.Intersectable) { return(Intersect(a.Bounding, b, out intersection)); } else { return(false); } }
public SkySphere() { MainGraphic = new MetaModel { XMesh = new MeshFromFile("Sphere1.x"), Texture = new TextureFromFile("background.png"), World = Matrix.Scaling(0.1f, 0.1f, 0.1f) * SkinnedMesh.InitSkinnedMeshFromMaya, ReceivesAmbientLight = Priority.Never, ReceivesDiffuseLight = Priority.Never, }; //VisibilityLocalBounding = CreateBoundingBoxFromModel((MetaModel)Graphic); VisibilityLocalBounding = new Common.Bounding.NonfittableBounding(new BoundingBox(new Vector3(-1000, -1000, -1000), new Vector3(1000, 1000, 1000)), false, true); PickingLocalBounding = CreateBoundingMeshFromModel((MetaModel)MainGraphic); PhysicsLocalBounding = null; EditorPlacementLocalBounding = new Common.Bounding.Cylinder(Vector3.Zero, 3, 1f); EditorRandomRotation = true; }
public Sword3() { MainGraphic = new MetaModel { XMesh = new MeshFromFile("Models/Props/Sword1.x"), Texture = new TextureFromFile("Models/Props/Sword3.png"), SpecularTexture = new TextureFromFile("Models/Props/SwordSpecular1.png"), World = Matrix.Scaling(1.2f, 1.2f, 1.2f), Visible = Priority.High, CastShadows = global::Graphics.Content.Priority.High, ReceivesAmbientLight = Priority.Never, ReceivesDiffuseLight = Priority.Never, ReceivesShadows = Priority.Never, ReceivesSpecular = Priority.Never, }; //VisibilityLocalBounding = CreateBoundingBoxFromModel((MetaModel)MainGraphic); VisibilityLocalBounding = new Common.Bounding.NonfittableBounding(Vector3.Zero, false, true); PickingLocalBounding = CreateBoundingMeshFromModel((MetaModel)MainGraphic); PhysicsLocalBounding = null; EditorRandomRotation = true; }
public Rifle1() { MainGraphic = new MetaModel { XMesh = new MeshFromFile("Models/Props/Rifle1.x"), Texture = new TextureFromFile("Models/Props/Rifle1.png"), SpecularTexture = new TextureFromFile("Models/Props/RifleSpecular1.png"), World = Matrix.RotationX(-0.8f), Visible = Priority.High, CastShadows = global::Graphics.Content.Priority.High, ReceivesShadows = Priority.High, ReceivesSpecular = Priority.High }; VisibilityLocalBounding = new Common.Bounding.NonfittableBounding(Vector3.Zero, false, true); PickingLocalBounding = CreateBoundingMeshFromModel((MetaModel)MainGraphic); PhysicsLocalBounding = null; EditorRandomRotation = true; }
public MayaHammer2() { MainGraphic = new MetaModel { XMesh = new MeshFromFile("Models/Props/MayaHammer1.x"), Texture = new TextureFromFile("Models/Props/MayaHammer2.png"), SpecularTexture = new TextureFromFile("Models/Props/MayaHammerSpecular1.png"), World = Matrix.Scaling(1.25f, 1.25f, 1.25f), Visible = Priority.High, CastShadows = global::Graphics.Content.Priority.High, ReceivesShadows = Priority.High, ReceivesSpecular = Priority.High, SpecularExponent = 6 }; //VisibilityLocalBounding = CreateBoundingBoxFromModel((MetaModel)MainGraphic); VisibilityLocalBounding = new Common.Bounding.NonfittableBounding(Vector3.Zero, false, true); PickingLocalBounding = CreateBoundingMeshFromModel((MetaModel)MainGraphic); PhysicsLocalBounding = null; EditorRandomRotation = true; }
public ExpandingDarkness() { MainGraphic = new MetaModel { HasAlpha = true, IsBillboard = true, Texture = new TextureFromFile("Models/Effects/Lightness1.png"), ReceivesAmbientLight = Priority.Never, ReceivesDiffuseLight = Priority.Never, ReceivesFog = false, OverrideZBuffer = true, XMesh = new MeshConcretize { MeshDescription = new Graphics.Software.Meshes.IndexedPlane() { Facings = Facings.Frontside, Position = new Vector3(-0.5f, -0.5f, 0), Size = new Vector2(1, 1), UVMin = Vector2.Zero, UVMax = new Vector2(1, 1) }, Layout = global::Graphics.Software.Vertex.PositionNormalTexcoord.Instance }, }; //FadeinTime = 0.2f; //FadeOutStartTime = 1f; //FadeoutTime = 0.5f; Updateable = true; VisibilityLocalBounding = new Common.Bounding.NonfittableBounding(Vector3.Zero, false, true); //Game.Instance.CameraController.MediumShake(); //savedZ = Map.MainCharacter.Position.Z; }
public WoodExplosion() { random = new Random(DateTime.Now.Millisecond); MainGraphic = new MetaModel { SkinnedMesh = new SkinnedMeshFromFile("Models/Effects/WoodExplosion1.x"), Texture = new TextureFromFile("Models/Effects/WoodExplosion1.png"), World = Matrix.Scaling(0.1f, 0.1f, 0.1f) * SkinnedMesh.InitSkinnedMeshFromMaya * Matrix.RotationZ((float)(2 * random.NextDouble() - 1) * (float)Math.PI) }; VisibilityLocalBounding = new Common.Bounding.NonfittableBounding(Vector3.Zero, false, true); FadeOutStartTime = 7f; FadeoutTime = 1.2f; }
public RagePulse1(int rageLevel) { interpolator = new Common.Interpolator(); interpolator.AddKey(new Common.InterpolatorKey<float>() { Period = 4 / (float)rageLevel, Repeat = true, TimeType = Common.InterpolatorKeyTimeType.Absolute, Time = 2 / (float)rageLevel, Value = 3.2f }); interpolator.AddKey(new Common.InterpolatorKey<float>() { Period = 4 / (float)rageLevel, Repeat = true, TimeType = Common.InterpolatorKeyTimeType.Absolute, Time = 4 / (float)rageLevel, Value = 2.8f }); Updateable = true; MainGraphic = new MetaModel { XMesh = new MeshConcretize { MeshDescription = new Graphics.Software.Meshes.IndexedPlane() { Facings = Facings.Frontside, Position = new Vector3(-0.5f, -0.5f, 0), Size = new Vector2(1, 1), UVMin = Vector2.Zero, UVMax = new Vector2(1, 1) }, Layout = global::Graphics.Software.Vertex.PositionNormalTexcoord.Instance }, Texture = new TextureFromFile("Models/Effects/Ragepulse1.png"), IsBillboard = true, HasAlpha = true, ReceivesAmbientLight = Priority.Never, ReceivesDiffuseLight = Priority.Never, AlphaRef = 0 }; VisibilityLocalBounding = new Common.Bounding.NonfittableBounding(Vector3.Zero, false, true); }
public RageFire() { Forever = true; VisibilityLocalBounding = Vector3.Zero; Direction = new Vector3(0, 0, 1); RandomScaling = true; RandomRotation = false; HorizontalSpreadAngle = 0; VerticalSpreadAngle = 0; ParticleFadeInTime = 0.3f; ParticleFadeOutTime = 0.5f; AccelerationMin = 8; AccelerationMax = 9; Acceleration = new Vector3(0, 0, 0); RandomSeed = DateTime.Now.Millisecond; SpawnsPerSecond = 4; InitialScalingFactor = 1f; ScaleSpeed = 0; SpeedMin = 0.2f; SpeedMax = 0.4f; TimeElapsed = 0; TimeToLive = 2f; ParticleModel = new MetaModel { XMesh = new MeshConcretize { MeshDescription = new Graphics.Software.Meshes.IndexedPlane() { Facings = Facings.Frontside, Position = new Vector3(-0.5f, -0.5f, 0), Size = new Vector2(1, 1), UVMin = Vector2.Zero, UVMax = new Vector2(1, 1) }, Layout = global::Graphics.Software.Vertex.PositionNormalTexcoord.Instance }, Texture = new TextureFromFile("Models/Effects/LavaMist1.png"), IsBillboard = true, HasAlpha = true, ReceivesAmbientLight = Priority.Never, ReceivesDiffuseLight = Priority.Never, AlphaRef = 0 }; VisibilityLocalBounding = new Common.Bounding.NonfittableBounding(Vector3.Zero, false, true); }
public Meteor(Vector3 vel) { MainGraphic = new MetaModel { HasAlpha = true, ReceivesAmbientLight = Priority.Never, ReceivesDiffuseLight = Priority.Never, Texture = new TextureFromFile("Models/Effects/Meteor1.png"), XMesh = new MeshFromFile("Models/Effects/Meteor1.x"), World = Matrix.Scaling(0.1f, 0.1f, 0.1f) * SkinnedMesh.InitSkinnedMeshFromMaya }; VisibilityLocalBounding = new Common.Bounding.NonfittableBounding(Vector3.Zero, false, true); Updateable = true; ParticleEffect pe; AddChild(pe = new MeteorTail()); pe.Removed += new EventHandler(pe_Removed); //AddChild(pe = new MeteorTailSmoke()); //pe.Removed += new EventHandler(pe_Removed); Velocity = vel * 10; Acceleration = new Vector3(0, 0, -1f); TimeToLive = 999; }
public HighRagePulse() { interpolator = new Common.Interpolator(); interpolator.AddKey(new Common.InterpolatorKey<float>() { TimeType = Common.InterpolatorKeyTimeType.Absolute, Time = 0, Value = 0.25f }); interpolator.AddKey(new Common.InterpolatorKey<float>() { TimeType = Common.InterpolatorKeyTimeType.Absolute, Time = TTL, Value = 3.5f }); fader = new EntityFader(this); fader.FadeinTime = 0; fader.FadeoutTime = TTL; fader.AutoFadeoutTime = 0.08f; Updateable = true; MainGraphic = new MetaModel { XMesh = new MeshConcretize { MeshDescription = new Graphics.Software.Meshes.IndexedPlane() { Facings = Facings.Frontside, Position = new Vector3(-0.5f, -0.5f, 0), Size = new Vector2(1, 1), UVMin = Vector2.Zero, UVMax = new Vector2(1, 1) }, Layout = global::Graphics.Software.Vertex.PositionNormalTexcoord.Instance }, Texture = new TextureFromFile("Models/Effects/RageSparkle1.png"), IsBillboard = true, HasAlpha = true, ReceivesAmbientLight = Priority.Never, ReceivesDiffuseLight = Priority.Never, AlphaRef = 0 }; VisibilityLocalBounding = new Common.Bounding.NonfittableBounding(Vector3.Zero, false, true); }