Esempio n. 1
0
        private PhysicObject SpawnPrimitive(Vector3 pos, Matrix ori)
        {
            int          prim = random.Next(3);
            PhysicObject physicObj;

            float a = 1.0f + (float)random.NextDouble() * 1.0f;
            float b = a + (float)random.NextDouble() * 0.5f;
            float c = 2.0f / a / b;

            switch (prim)
            {
            case 0:
                physicObj = new BoxObject(this, boxModel, new Vector3(a, b, c), ori, pos);
                break;

            case 1:
                physicObj = new SphereObject(this, sphereModel, 0.5f, ori, pos);
                break;

            case 2:
                physicObj = new CapsuleObject(this, capsuleModel, 0.5f, 1f, ori, pos);
                break;

            default:
                physicObj = new SphereObject(this, sphereModel, (float)random.Next(5, 15), ori, pos);
                break;
            }
            return(physicObj);
        }
Esempio n. 2
0
        private void CreateThrash(Vector3 pos)
        {
            ///Create a Simple Model
            ///thash Has a Texture Inside the .X file (not the texture itself, just the name of it)
            ///The simpleModel will find it and will attach to the Object
            IModelo model = new SimpleModel(GraphicFactory, "..\\Content\\Model\\trash");

            ///Create a Physic Object
            IPhysicObject pobj = new CapsuleObject(pos, 2, 1, 10, Matrix.Identity, MaterialDescription.DefaultBepuMaterial());

            pobj.isMotionLess = true;
            ///Create a shader
            IShader nd = new DeferredNormalShader();

            ///Create a Material
            IMaterial material = new DeferredMaterial(nd);
            ///Create a an Object that englobs everything and add it to the world
            IObject obj = new IObject(material, model, pobj);

            this.World.AddObject(obj);
            objects.Add(obj);
        }
Esempio n. 3
0
 public void SetupCollisionModel(CapsuleObject collisionModel)
 {
     base.SetupCollisionModel(collisionModel);
 }
Esempio n. 4
0
 public CapsuleModel()
     : base()
 {
     objType = new CapsuleObject(Vector3.Zero, 100.0F, 20.0F, 1.0F, Matrix.Identity, MaterialDescription.DefaultBepuMaterial());
 }