public BoxBlocker() { Vector3 minPoint = new Vector3(-1, -1, 0); Vector3 maxPoint = new Vector3(1, 1, 2); MainGraphic = new MetaModel { XMesh = new MeshConcretize { MeshDescription = new global::Graphics.Software.Meshes.BoxMesh(minPoint, maxPoint, Facings.Frontside, false), Layout = global::Graphics.Software.Vertex.PositionNormalTexcoord.Instance }, HasAlpha = true, Texture = new TextureFromFile("Models/Effects/Blue1.png"), ReceivesAmbientLight = Priority.Never, ReceivesDiffuseLight = Priority.Never, }; PickingLocalBounding = VisibilityLocalBounding = new MetaBoundingBox { Mesh = ((MetaModel)MainGraphic).XMesh, Transformation = ((MetaModel)MainGraphic).World }; //PhysicsLocalBounding = CreatePhysicsMeshBounding((MetaModel)MainGraphic); PhysicsLocalBounding = new Common.Bounding.Box { LocalBoundingBox = new BoundingBox(minPoint, maxPoint) }; }
public Point() { MainGraphic = new MetaModel { XMesh = new MeshConcretize { MeshDescription = new global::Graphics.Software.Meshes.BoxMesh(new Vector3(-0.1f, -0.1f, 0), new Vector3(0.1f, 0.1f, 0.2f), Facings.Frontside, false), Layout = global::Graphics.Software.Vertex.PositionNormalTexcoord.Instance }, Texture = new TextureConcretizer { TextureDescription = new global::Graphics.Software.Textures.SingleColorTexture(System.Drawing.Color.Blue) }, ReceivesAmbientLight = Priority.Never, ReceivesDiffuseLight = Priority.Never, }; PickingLocalBounding = VisibilityLocalBounding = new MetaBoundingBox { Mesh = ((MetaModel)MainGraphic).XMesh, Transformation = ((MetaModel)MainGraphic).World }; VisibleInGame = false; Dynamic = false; }
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 static MetaBoundingBox Transform(MetaBoundingBox bounding, Matrix transformation) { return new MetaBoundingBox { Mesh = bounding.Mesh, Transformation = bounding.Transformation * transformation }; }
public static MetaBoundingBox Transform(MetaBoundingBox bounding, Matrix transformation) { return(new MetaBoundingBox { Mesh = bounding.Mesh, Transformation = bounding.Transformation * transformation }); }
public ClericBoss() { HitPoints = MaxHitPoints = 5500; RunSpeed = MaxRunSpeed = 1; MainGraphic = new MetaModel { AlphaRef = 254, SkinnedMesh = new SkinnedMeshFromFile("Models/Units/VoodooPriest1.x"), Texture = new TextureConcretizer { TextureDescription = new global::Graphics.Software.Textures.SingleColorTexture( System.Drawing.Color.White) }, World = SkinnedMesh.InitSkinnedMeshFromMaya * Matrix.Scaling(0.1f, 0.1f, 0.1f), IsBillboard = false, CastShadows = global::Graphics.Content.Priority.High, ReceivesShadows = global::Graphics.Content.Priority.High, }; VisibilityLocalBounding = new MetaBoundingBox { Mesh = ((MetaModel)MainGraphic).SkinnedMesh, Transformation = ((MetaModel)MainGraphic).World }; PickingLocalBounding = new Common.Bounding.Chain { Boundings = new object[] { VisibilityLocalBounding, new BoundingMetaMesh { SkinnedMeshInstance = MetaEntityAnimation, Transformation = ((MetaModel)MainGraphic).World } }, Shallow = true }; AddAbility(new ClericRaiseDead()); AddAbility(new IceBreath()); AddAbility(new BossIncinerateApplyBuff()); //AddAbility(new ScourgedEarth()); if (Program.Instance != null) { var sm = Program.Instance.SoundManager; var idleSound = sm.GetSoundResourceGroup(sm.GetSFX(SFX.ClericIdle1), sm.GetSFX(SFX.ClericIdle2), sm.GetSFX(SFX.ClericIdle3)); idle = idleSound.PlayLoopedWithIntervals(5, 15, 3f + (float)Game.Random.NextDouble() * 3.0f, new Sound.PlayArgs { GetPosition = () => { return Position; }, GetVelocity = () => { if (MotionNPC != null) return MotionNPC.Velocity; else return Vector3.Zero; } }); } }
public ExplodingRocksEffect() { MainGraphic = new MetaModel { SkinnedMesh = new SkinnedMeshFromFile("Models/Effects/RocksExplode1.x"), Texture = new TextureFromFile("Models/Props/Stone1.png"), World = SkinnedMesh.InitSkinnedMeshFromMaya * Matrix.Scaling(0.1f, 0.1f, 0.1f), IsBillboard = false, AlphaRef = 254, }; PickingLocalBounding = VisibilityLocalBounding = new MetaBoundingBox { Mesh = ((MetaModel)MainGraphic).SkinnedMesh, Transformation = ((MetaModel)MainGraphic).World }; }
public AmmoBox() { MainGraphic = new MetaModel { XMesh = new MeshFromFile("Models/Props/Ammobox1.x"), Texture = new TextureFromFile("Models/Props/Ammobox1.png"), SpecularTexture = new TextureFromFile("Models/Props/AmmoboxSpecular1.png"), World = Matrix.Scaling(0.1f, 0.1f, 0.1f) * SkinnedMesh.InitSkinnedMeshFromMaya, ReceivesSpecular = Priority.Medium, }; PickingLocalBounding = VisibilityLocalBounding = new MetaBoundingBox { Mesh = ((MetaModel)MainGraphic).XMesh, Transformation = ((MetaModel)MainGraphic).World }; Ammo = 10; }
public Cleric() { HitPoints = MaxHitPoints = 1000; RunSpeed = MaxRunSpeed = 1; Chanting = false; HeadOverBarHeight = 1.15f; SilverYield = 20; MainGraphic = new MetaModel { AlphaRef = 254, SkinnedMesh = new SkinnedMeshFromFile("Models/Units/VoodooPriest1.x"), Texture = new TextureFromFile("Models/Units/VoodooPriest1.png"), SpecularTexture = new TextureFromFile("Models/Units/VoodooPriestSpecular1.png"), World = SkinnedMesh.InitSkinnedMeshFromMaya * Matrix.Scaling(0.11f, 0.11f, 0.11f), IsBillboard = false, CastShadows = global::Graphics.Content.Priority.High, ReceivesShadows = global::Graphics.Content.Priority.High, ReceivesSpecular = global::Graphics.Content.Priority.High, SpecularExponent = 6, }; VisibilityLocalBounding = new MetaBoundingBox { Mesh = ((MetaModel)MainGraphic).SkinnedMesh, Transformation = ((MetaModel)MainGraphic).World }; PickingLocalBounding = new Common.Bounding.Chain { Boundings = new object[] { VisibilityLocalBounding, new BoundingMetaMesh { SkinnedMeshInstance = MetaEntityAnimation, Transformation = ((MetaModel)MainGraphic).World } }, Shallow = true }; AddAbility(new ClericRaiseDead()); AddAbility(new FireBreath()); //AddAbility(new IncinerateApplyBuff()); AddAbility(new StartScourgedEarth()); }
public Bull() { HitPoints = MaxHitPoints = 2000; RunSpeed = MaxRunSpeed = 2; RaiseFromCorpseTime = 2; GraphicalTurnSpeed = 2.5f; SplatRequiredDamagePerc = float.MaxValue; HeadOverBarHeight = 2.5f; HitRadius = 1; SilverYield = 30; MainGraphic = new MetaModel { SkinnedMesh = new SkinnedMeshFromFile("Models/Units/Oxen1.x"), Texture = new TextureFromFile("Models/Units/Oxen1.png"), SpecularTexture = new TextureFromFile("Models/Units/OxenSpecular1.png"), World = SkinnedMesh.InitSkinnedMeshFromMaya * Matrix.Scaling(0.1f, 0.1f, 0.1f), AlphaRef = 100, CastShadows = global::Graphics.Content.Priority.High, ReceivesShadows = Priority.High, ReceivesSpecular = Priority.High, SpecularExponent = 6, }; VisibilityLocalBounding = new MetaBoundingBox { Mesh = ((MetaModel)MainGraphic).SkinnedMesh, Transformation = ((MetaModel)MainGraphic).World }; PickingLocalBounding = new Common.Bounding.Chain { Boundings = new object[] { VisibilityLocalBounding, new BoundingMetaMesh { SkinnedMeshInstance = MetaEntityAnimation, Transformation = ((MetaModel)MainGraphic).World } }, Shallow = true }; AddAbility(new BullThrust()); AddAbility(new BullCharge()); }
public Brute() { HitPoints = MaxHitPoints = 240; RunSpeed = MaxRunSpeed = 1.1f; SilverYield = 5; SplatRequiredDamagePerc = 160 / (float)MaxHitPoints; MainGraphic = new MetaModel { SkinnedMesh = new SkinnedMeshFromFile("Models/Units/Brute1.x"), Texture = new TextureFromFile("Models/Units/Brute1.png"), SpecularTexture = new TextureFromFile("Models/Units/BruteSpecular1.png"), World = SkinnedMesh.InitSkinnedMeshFromMaya * Matrix.Scaling(0.115f, 0.115f, 0.115f), IsBillboard = false, AlphaRef = 254, CastShadows = global::Graphics.Content.Priority.High, ReceivesShadows = Priority.High, ReceivesSpecular = Priority.High, SpecularExponent = 6, }; VisibilityLocalBounding = new MetaBoundingBox { Mesh = ((MetaModel)MainGraphic).SkinnedMesh, Transformation = ((MetaModel)MainGraphic).World }; PickingLocalBounding = new Common.Bounding.Chain { Boundings = new object[] { VisibilityLocalBounding, new BoundingMetaMesh { SkinnedMeshInstance = MetaEntityAnimation, Transformation = ((MetaModel)MainGraphic).World } }, Shallow = true }; AddAbility(new BruteThrust()); AddAbility(new CastNet()); }
public Mongrel() { HitPoints = MaxHitPoints = 100; RunSpeed = MaxRunSpeed = 5; RunAnimationSpeed = 0.3f; SplatRequiredDamagePerc = 0; SilverYield = 5; MainGraphic = new MetaModel { SkinnedMesh = new SkinnedMeshFromFile("Models/Units/Ghoul1.x"), Texture = new TextureFromFile("Models/Units/Ghoul1.png"), SpecularTexture = new TextureFromFile("Models/Units/GhoulSpecular1.png"), World = SkinnedMesh.InitSkinnedMeshFromMaya * Matrix.Scaling(0.1f, 0.1f, 0.1f), CastShadows = global::Graphics.Content.Priority.High, ReceivesShadows = global::Graphics.Content.Priority.High, ReceivesSpecular = global::Graphics.Content.Priority.High, SpecularExponent = 6, }; VisibilityLocalBounding = new MetaBoundingBox { Mesh = ((MetaModel)MainGraphic).SkinnedMesh, Transformation = ((MetaModel)MainGraphic).World }; PickingLocalBounding = new Common.Bounding.Chain { Boundings = new object[] { VisibilityLocalBounding, new BoundingMetaMesh { SkinnedMeshInstance = MetaEntityAnimation, Transformation = ((MetaModel)MainGraphic).World } }, Shallow = true }; AddAbility(new MongrelBite()); }
protected object CreatePhysicsMeshBounding(MetaModel model, Matrix transformation) { BoundingMetaMesh boundingMetaMesh = new BoundingMetaMesh(); BoundingBox boundingBox = new Graphics.MetaBoundingBox { Mesh = model.XMesh ?? model.SkinnedMesh, Transformation = model.World }.GetBoundingBox(ContentPool).Value; if (Program.Settings != null && Program.Settings.MotionSettings.UseSoftwareMeshes) { boundingMetaMesh.SoftwareMesh = Program.Instance.Content.Acquire <global::Graphics.Software.Mesh>(model.XMesh); } else { //if (model.XMesh is Graphics.Content.MeshFromFile) // ((Graphics.Content.MeshFromFile)model.XMesh).Flags = SlimDX.Direct3D9.MeshFlags.Software; boundingMetaMesh.Mesh = model.XMesh ?? model.SkinnedMesh; } if (model.SkinnedMesh != null) { boundingMetaMesh.SkinnedMeshInstance = MetaEntityAnimation; } boundingMetaMesh.Transformation = model.World * transformation; boundingMetaMesh.Init(ContentPool); return(new Common.Bounding.Chain { Boundings = new object[] { boundingBox, boundingMetaMesh }, Shallow = true }); }
public Hound() { HitPoints = MaxHitPoints = 150; RunSpeed = MaxRunSpeed = 1.5f; RunAnimationSpeed = 0.4f; SplatRequiredDamagePerc = 0; MainGraphic = new MetaModel { SkinnedMesh = new SkinnedMeshFromFile("Models/Units/Wolf1.x"), Texture = new TextureFromFile("Models/Units/Wolf1.png"), World = SkinnedMesh.InitSkinnedMeshFromMaya * Matrix.Scaling(0.1f, 0.1f, 0.1f), IsBillboard = false, }; VisibilityLocalBounding = new MetaBoundingBox { Mesh = ((MetaModel)MainGraphic).SkinnedMesh, Transformation = ((MetaModel)MainGraphic).World }; PickingLocalBounding = new Common.Bounding.Chain { Boundings = new object[] { VisibilityLocalBounding, new BoundingMetaMesh { SkinnedMeshInstance = MetaEntityAnimation, Transformation = ((MetaModel)MainGraphic).World } }, Shallow = true }; //AddAbility(new HoundBite()); AddAbility(new HoundExplode()); }
public Fence2() { MainGraphic = new MetaModel { XMesh = new MeshFromFile("Models/Props/Fence2.x"), Texture = new TextureFromFile("Models/Props/Fence1.png"), World = Matrix.Scaling(0.14f, 0.14f, 0.18f) * SkinnedMesh.InitSkinnedMeshFromMaya, Visible = Priority.High, CastShadows = global::Graphics.Content.Priority.Medium, ReceivesShadows = Priority.High, }; VisibilityLocalBounding = new MetaBoundingBox { Mesh = ((MetaModel)MainGraphic).XMesh, Transformation = ((MetaModel)MainGraphic).World }; PickingLocalBounding = new Common.Bounding.Chain { Boundings = new object[] { VisibilityLocalBounding, new BoundingMetaMesh { Mesh = ((MetaModel)MainGraphic).XMesh, Transformation = ((MetaModel)MainGraphic).World } }, Shallow = true }; PhysicsLocalBounding = new Common.Bounding.Box { LocalBoundingBox = new BoundingBox(new Vector3(-0.31f, -1.4f, -0.5f), new Vector3(0.31f, 1.4f, 0.9f)), Transformation = Matrix.Scaling(1, 1, 0.8f) }; EditorPlacementLocalBounding = new Common.Bounding.Cylinder(Vector3.Zero, 3, 1f); EditorRandomRotation = true; }
public static Vector3 Translation(MetaBoundingBox bounding) { return(Common.Math.Position(bounding.Transformation)); }
public BridgeRaising1() { MainGraphic = new MetaModel { SkinnedMesh = new SkinnedMeshFromFile("Models/Props/BridgeRaising1.x"), Texture = new TextureFromFile("Models/Props/Bridge1.png"), SpecularTexture = new TextureFromFile("Models/Props/BridgeSpecular1.png"), World = Matrix.Scaling(0.1f, 0.1f, 0.1f) * SkinnedMesh.InitSkinnedMeshFromMaya, CastShadows = global::Graphics.Content.Priority.High, ReceivesShadows = Priority.High, ReceivesSpecular = Priority.Medium, SpecularExponent = 4, }; VisibilityLocalBounding = new MetaBoundingBox { Mesh = ((MetaModel)MainGraphic).SkinnedMesh, Transformation = ((MetaModel)MainGraphic).World }; PickingLocalBounding = new Common.Bounding.Chain { Boundings = new object[] { VisibilityLocalBounding, new BoundingMetaMesh { SkinnedMeshInstance = MetaEntityAnimation, Transformation = ((MetaModel)MainGraphic).World } }, Shallow = true }; MetaModel physicsMesh = new MetaModel { XMesh = new MeshFromFile("Models/Props/Bridge1Pathmesh.x"), World = ((MetaModel)MainGraphic).World }; PhysicsLocalBounding = CreatePhysicsMeshBounding(physicsMesh); EditorRandomRotation = true; EditorFollowGroundType = EditorFollowGroupType.HeightmapAndWater; RemoveOnDeath = false; Updateable = true; Dynamic = true; }
public Talisman() { MainGraphic = new MetaModel { XMesh = new MeshFromFile("Models/Props/Ammobox1.x"), Texture = new TextureFromFile("Models/Props/Stone3.png"), World = Matrix.Scaling(0.1f, 0.1f, 0.1f) * SkinnedMesh.InitSkinnedMeshFromMaya, }; PickingLocalBounding = VisibilityLocalBounding = new MetaBoundingBox { Mesh = ((MetaModel)MainGraphic).XMesh, Transformation = ((MetaModel)MainGraphic).World }; }
public static BoundingBox BoundingToBox(MetaBoundingBox bounding) { return(bounding.GetBoundingBox(content).Value); }
public DazedIconEffect() { MainGraphic = new MetaModel { SkinnedMesh = new SkinnedMeshFromFile("Models/Effects/Dazed1.x"), Texture = new TextureFromFile("Models/Effects/Dazed1.png"), World = SkinnedMesh.InitSkinnedMeshFromMaya * Matrix.Scaling(0.2f, 0.2f, 0.2f), AlphaRef = 4, HasAlpha = true, ReceivesAmbientLight = Priority.Never, ReceivesDiffuseLight = Priority.Never, }; PickingLocalBounding = VisibilityLocalBounding = new MetaBoundingBox { Mesh = ((MetaModel)MainGraphic).SkinnedMesh, Transformation = ((MetaModel)MainGraphic).World }; }
// ---------------------------------------------------------------------------------------------- // -- MetaBoundingBox --------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------------- public static bool Intersect(BoundingBox a, MetaBoundingBox b, out object intersection) { intersection = null; return(BoundingBox.Intersects(a, b.GetBoundingBox(content).Value)); }
public static float Radius(MetaBoundingBox bounding) { return Common.Boundings.Radius(bounding.GetBoundingBox(content).Value); }
public static Common.RSpatialRelation Relation(RectangleF a, MetaBoundingBox b) { return(Common.SpatialRelation.Relation(a, b.GetBoundingBox(content).Value)); }
public WolfBoss() { HitPoints = MaxHitPoints = 8000; Armor = 0f; RunSpeed = MaxRunSpeed = 5.5f; RunAnimationSpeed = 0.3f; SplatRequiredDamagePerc = 999; SilverYield = 300; HitRadius = 1.5f; HeadOverBarHeight = 1.1f; MainGraphic = new MetaModel { SkinnedMesh = new SkinnedMeshFromFile("Models/Units/Wolf1.x"), Texture = new TextureFromFile("Models/Units/Wolf1.png"), SpecularTexture = new TextureFromFile("Models/Units/WolfSpecular1.png"), World = SkinnedMesh.InitSkinnedMeshFromMaya * Matrix.Scaling(0.12f, 0.12f, 0.12f), CastShadows = global::Graphics.Content.Priority.High, ReceivesShadows = global::Graphics.Content.Priority.High, ReceivesSpecular = global::Graphics.Content.Priority.High, SpecularExponent = 6, }; VisibilityLocalBounding = new MetaBoundingBox { Mesh = ((MetaModel)MainGraphic).SkinnedMesh, Transformation = ((MetaModel)MainGraphic).World }; PickingLocalBounding = new Common.Bounding.Chain { Boundings = new object[] { VisibilityLocalBounding, new BoundingMetaMesh { SkinnedMeshInstance = MetaEntityAnimation, Transformation = ((MetaModel)MainGraphic).World } }, Shallow = true }; AddAbility(new WolfBite()); }
public WaterRipplesEffect() { MainGraphic = new MetaModel { Opacity = 0, AlphaRef = 0, ReceivesAmbientLight = Priority.Never, ReceivesDiffuseLight = Priority.Never, HasAlpha = true, Texture = new TextureFromFile("Models/Effects/WaterRipple1.png"), DontSort = true, XMesh = new MeshConcretize { MeshDescription = new Graphics.Software.Meshes.IndexedPlane { Facings = Facings.Frontside, Position = new Vector3(0, 0, 0), Size = new Vector2(1, 1), UVMin = Vector2.Zero, UVMax = new Vector2(1, 1) }, Layout = global::Graphics.Software.Vertex.PositionNormalTexcoord.Instance }, World = Matrix.Translation(-0.5f, -0.5f, 0.01f) }; VisibilityLocalBounding = new MetaBoundingBox { Mesh = ((MetaModel)MainGraphic).XMesh, Transformation = ((MetaModel)MainGraphic).World }; size.Value = 0.7f; Scale = new Vector3(size.Value, size.Value, 1); size.AddKey(new Common.InterpolatorKey<float> { Time = 1.5f, Value = 4 }); FadeinTime = 0.3f; FadeoutTime = 1.5f; Stop(); }
public static bool Intersect(Common.Bounding.Cylinder a, MetaBoundingBox b, out object intersection) { return Common.Intersection.Intersect(a, b.GetBoundingBox(content).Value, out intersection); }
// ---------------------------------------------------------------------------------------------- // -- MetaBoundingBox --------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------------- public static bool Intersect(BoundingBox a, MetaBoundingBox b, out object intersection) { intersection = null; return BoundingBox.Intersects(a, b.GetBoundingBox(content).Value); }
public static bool Intersect(Ray r, MetaBoundingBox b, out object intersection) { return(Common.Intersection.Intersect(b.GetBoundingBox(content).Value, r, out intersection)); }
public Unit() { CanControlMovementBlockers = 0; CanControlRotationBlockers = 0; InRangeRadius = 6; PhysicalWeight = 1; GraphicalTurnSpeed = 5f; RaiseFromCorpseTime = 2; PistolAmmo = 0; InCombat = false; IsDestructible = true; RunAnimationSpeed = 1; BackingAnimationSpeed = 1; RunningBackwards = false; MaxRunSpeed = 4; MaxWaterDepth = 0.5f; RageYield = 1; SplatRequiredDamagePerc = 0; MainGraphic = new MetaModel { SkinnedMesh = new SkinnedMeshFromFile("Models/Units/Zombie1.x"), Texture = new TextureFromFile("Models/Units/Zombie1.png"), World = SkinnedMesh.InitSkinnedMeshFromMaya * Matrix.Scaling(0.1f, 0.1f, 0.1f), IsBillboard = false, AlphaRef = 254, Opacity = 1.0f }; PickingLocalBounding = VisibilityLocalBounding = new MetaBoundingBox { Mesh = ((MetaModel)MainGraphic).SkinnedMesh, Transformation = ((MetaModel)MainGraphic).World }; PhysicsLocalBounding = new Common.Bounding.Cylinder(Vector3.Zero, 2.5f, 0.5f) { SolidRayIntersection = true }; EditorRandomRotation = true; }
public static Vector3 Translation(MetaBoundingBox bounding) { return Common.Math.Position(bounding.Transformation); }
public ExplodingRottenTreeEffect() { Random r = new Random(DateTime.Now.Millisecond); MainGraphic = new MetaModel { SkinnedMesh = new SkinnedMeshFromFile("Models/Effects/RottentreeExplode1.x"), Texture = new TextureFromFile("Models/Props/Rottentree1.png"), World = SkinnedMesh.InitSkinnedMeshFromMaya * Matrix.Scaling(0.17f, 0.17f, 0.17f), IsBillboard = false, AlphaRef = 254, }; PickingLocalBounding = VisibilityLocalBounding = new MetaBoundingBox { Mesh = ((MetaModel)MainGraphic).SkinnedMesh, Transformation = ((MetaModel)MainGraphic).World }; }
public static float Radius(MetaBoundingBox bounding) { return(Common.Boundings.Radius(bounding.GetBoundingBox(content).Value)); }
public static bool Intersect(Common.Bounding.Cylinder a, MetaBoundingBox b, out object intersection) { return(Common.Intersection.Intersect(a, b.GetBoundingBox(content).Value, out intersection)); }
public DemonLord() { HitPoints = MaxHitPoints = 20000; Armor = 0f; RunSpeed = MaxRunSpeed = 3.5f; PhysicalWeight = 5000; HeadOverBarHeight = 5f; SplatRequiredDamagePerc = float.MaxValue; RageEnabled = false; RunAnimationSpeed = 0.3f; HitRadius = 1.5f; SilverYield = 600; RageLevel = 1; MainGraphic = new MetaModel { AlphaRef = 2, SkinnedMesh = new SkinnedMeshFromFile("Models/Units/DemonLord1.x"), Texture = new TextureFromFile("Models/Units/DemonLord1.png"), SpecularTexture = new TextureFromFile("Models/Units/DemonLordSpecular1.png"), World = SkinnedMesh.InitSkinnedMeshFromMaya * Matrix.Scaling(0.18f, 0.18f, 0.18f), HasAlpha = false, IsBillboard = false, CastShadows = global::Graphics.Content.Priority.Never, ReceivesShadows = global::Graphics.Content.Priority.High, ReceivesSpecular = global::Graphics.Content.Priority.High, SpecularExponent = 6, }; VisibilityLocalBounding = new MetaBoundingBox { Mesh = ((MetaModel)MainGraphic).SkinnedMesh, Transformation = ((MetaModel)MainGraphic).World }; PickingLocalBounding = new Common.Bounding.Chain { Boundings = new object[] { VisibilityLocalBounding, new BoundingMetaMesh { SkinnedMeshInstance = MetaEntityAnimation, Transformation = ((MetaModel)MainGraphic).World } }, Shallow = true }; PhysicsLocalBounding = new Common.Bounding.Cylinder(Vector3.Zero, 4, 1f); AddAbility(new DemonThrust()); AddAbility(new DemonWrath()); AddAbility(new DemonLordCharge()); AddAbility(new LavaDitchBash()); }
public static bool Intersect(Ray r, MetaBoundingBox b, out object intersection) { return Common.Intersection.Intersect(b.GetBoundingBox(content).Value, r, out intersection); }
public static bool Intersect(System.Drawing.RectangleF a, MetaBoundingBox b, out object intersection) { intersection = null; return(Common.SpatialRelation.Relation(a, b.GetBoundingBox(content).Value) != Common.RSpatialRelation.Outside); }
public static bool Intersect(System.Drawing.RectangleF a, MetaBoundingBox b, out object intersection) { intersection = null; return Common.SpatialRelation.Relation(a, b.GetBoundingBox(content).Value) != Common.RSpatialRelation.Outside; }
public MainCharacter() { RunSpeed = MaxRunSpeed = 4; RunAnimationSpeed = 0.5f; BackingAnimationSpeed = 0.35f; Team = Team.Player; PhysicalWeight = 1; regenTickTime = 3f; regenTickHeal = 2; PistolAmmo = 0; TalismansCollected = 0; FootstepRelativePeriod = 1.5f; SplatRequiredDamagePerc = float.MaxValue; HeadOverBarHeight = 2.2f; Name = "MainCharacter"; RageEnabled = true; MainGraphic = new MetaModel { SkinnedMesh = new SkinnedMeshFromFile("Models/Units/MainCharacter1.x"), Texture = new TextureFromFile("Models/Units/MainCharacter1.png"), SpecularTexture = new TextureFromFile("Models/Units/MainCharacterSpecular1.png"), World = SkinnedMesh.InitSkinnedMeshFromMaya * Matrix.Scaling(0.182f, 0.182f, 0.167f), CastShadows = Priority.High, ReceivesShadows = Priority.High, ReceivesSpecular = Priority.High }; VisibilityLocalBounding = new MetaBoundingBox { Mesh = ((MetaModel)MainGraphic).SkinnedMesh, Transformation = ((MetaModel)MainGraphic).World }; PickingLocalBounding = new Common.Bounding.Chain { Boundings = new object[] { VisibilityLocalBounding, new BoundingMetaMesh { SkinnedMeshInstance = MetaEntityAnimation, Transformation = ((MetaModel)MainGraphic).World } }, Shallow = true }; InitWeapons(); }
protected object CreatePhysicsMeshBounding(MetaModel model, Matrix transformation) { BoundingMetaMesh boundingMetaMesh = new BoundingMetaMesh(); BoundingBox boundingBox = new Graphics.MetaBoundingBox { Mesh = model.XMesh ?? model.SkinnedMesh, Transformation = model.World }.GetBoundingBox(ContentPool).Value; if (Program.Settings != null && Program.Settings.MotionSettings.UseSoftwareMeshes) { boundingMetaMesh.SoftwareMesh = Program.Instance.Content.Acquire<global::Graphics.Software.Mesh>(model.XMesh); } else { //if (model.XMesh is Graphics.Content.MeshFromFile) // ((Graphics.Content.MeshFromFile)model.XMesh).Flags = SlimDX.Direct3D9.MeshFlags.Software; boundingMetaMesh.Mesh = model.XMesh ?? model.SkinnedMesh; } if(model.SkinnedMesh != null) boundingMetaMesh.SkinnedMeshInstance = MetaEntityAnimation; boundingMetaMesh.Transformation = model.World * transformation; boundingMetaMesh.Init(ContentPool); return new Common.Bounding.Chain { Boundings = new object[] { boundingBox, boundingMetaMesh }, Shallow = true }; }
public static BoundingBox BoundingToBox(MetaBoundingBox bounding) { return bounding.GetBoundingBox(content).Value; }