Example #1
0
        public PhysDuck(Path res)
        {
            Shape shape = new BoxShape(new Vector(1.0, 1.0, 1.0));
            RigidBody body = new RigidBody(shape);

            Texture txt = Texture.Load(res["Textures"]["texture.bmp"]);

            body.Position = new Vector(0.0, 0.0, 5.0);
            this._Phys = new PhysicsComponent(body);
            this._Duck = new ModelComponent(Model.LoadFile(res, "candle.obj"), this._Phys, txt);
            this._Duck.Model.Color = Color.RGB(1.0, 0.0, 0.0);
        }
Example #2
0
        public GroundTest(Path res, Vector2d Size)
        {
            Shape shape = new BoxShape(new Vector(Size.X, Size.Y, 1.0));
            RigidBody body = new RigidBody(shape);
            body.Mass = 99999f;
            body.IsStatic = true;
            body.Position = new Vector(0.0, 0.0, 0.0);
            this._Phys = new PhysicsComponent(body);
            this._Phys.Scale = new Vector(Size.X, Size.Y, 1.0);

            Texture txt = Texture.Load(res["Textures"]["texture.bmp"]);

            this._Duck = new ModelComponent(Model.LoadFile(res, "cube.obj"), this._Phys, txt);
            this._Duck.Model.Color = Color.RGB(1.0, 1.0, 1.0);
        }