コード例 #1
0
ファイル: Vitaboy.cs プロジェクト: sector-c/Project-Dollhouse
        private void Vitaboy_Load(object sender, EventArgs e)
        {
            Content.Init(@"C:\Program Files\Maxis\The Sims Online\TSOClient\", canvas.GraphicsDevice);

            var content = Content.Get();

            foreach (var binding in content.AvatarBindings.List())
            {
                bindingsList.Items.Add(binding);
            }

            foreach (var outfit in content.AvatarOutfits.List())
            {
                outfitList.Items.Add(outfit);
            }

            foreach (var animation in content.AvatarAnimations.List())
            {
                animationsList.Items.Add(animation);
            }


            _3D    = new _3DLayer();
            Camera = new BasicCamera(canvas.GraphicsDevice, new Vector3(10.0f, 10.0f, 10.0f), new Vector3(5.0f, 5.0f, 5.0f), Vector3.Up);
            Scene  = new _3DScene(canvas.GraphicsDevice, Camera);
            _3D.Add(Scene);
            canvas.Screen.Add(_3D);

            Animator = new Animator();
            Scene.Add(Animator);
        }
コード例 #2
0
 private void SetPreview(_3DComponent component)
 {
     if (this.Preview != null)
     {
         Scene.Remove(Preview);
     }
     this.Preview = component;
     Scene.Add(component);
 }
コード例 #3
0
        public UI3DDGRP(uint guid) : base(guid)
        {
            Camera = new BasicCamera(GameFacade.GraphicsDevice, new Vector3(3, 1, 0), new Vector3(0, 0, 0), new Vector3(0, 1, 0));
            Scene  = new _3DScene(GameFacade.GraphicsDevice, Camera);
            var cube = new _3DCube(Color.Red, new Vector3(1, 0.1f, 1));

            cube.Position = new Vector3(-0.5f, -0.1f, -0.5f);
            Scene.Add(cube);
            Scene.Initialize(GameFacade.Scenes);
        }
コード例 #4
0
        private void UISimInit()
        {
            Camera   = new BasicCamera(GameFacade.GraphicsDevice, new Vector3(0.0f, 7.0f, -17.0f), Vector3.Zero, Vector3.Up);
            Scene    = new _3DScene(GameFacade.Game.GraphicsDevice, Camera);
            Scene.ID = "UISim";

            GameFacade.Game.GraphicsDevice.DeviceReset += new EventHandler(GraphicsDevice_DeviceReset);

            Avatar       = new AdultVitaboyModel();
            Avatar.Scene = Scene;
            Avatar.Scale = new Vector3(0.45f);
            Scene.Add(Avatar);
        }
コード例 #5
0
ファイル: UISim.cs プロジェクト: sector-c/Project-Dollhouse
        public UISim()
        {
            Camera   = new BasicCamera(GameFacade.GraphicsDevice, new Vector3(0.0f, 7.0f, -17.0f), Vector3.Zero, Vector3.Up);
            Scene    = new _3DScene(GameFacade.Game.GraphicsDevice, Camera);
            Scene.ID = "UISim";

            GameFacade.Game.GraphicsDevice.DeviceReset += new EventHandler(GraphicsDevice_DeviceReset);

            Avatar       = new AdultSimAvatar();
            Avatar.Scene = Scene;
            Avatar.Scale = new Vector3(0.45f);
            Scene.Add(Avatar);

            GameFacade.Scenes.AddExternal(Scene);
        }
コード例 #6
0
        private void initSimHead()
        {
            HeadCamera = new BasicCamera(GameFacade.GraphicsDevice, new Vector3(0.0f, 7.0f, -17.0f), Vector3.Zero, Vector3.Up);

            HeadCamera.Position = new Vector3(0, 5.2f, 12.5f);
            HeadCamera.Target   = new Vector3(0, 5.2f, 0.0f);

            HeadScene    = new _3DScene(GameFacade.Game.GraphicsDevice, HeadCamera);
            HeadScene.ID = "UIPieMenuHead";

            //HeadCamera.NearPlane = 5;
            //HeadCamera.FarPlane = 923840284;

            //GameFacade.Game.GraphicsDevice.DeviceReset += new EventHandler(GraphicsDevice_DeviceReset);

            m_Head.Scene = HeadScene;
            m_Head.Scale = new Vector3(1f);
            HeadScene.Add(m_Head);
            GameFacade.Scenes.AddExternal(HeadScene); //AddExternal(HeadScene);
        }
コード例 #7
0
        public override void Update(UpdateState state)
        {
            Scene.Update(state);
            //ChangeGraphic(128+5);
            Invalidate();

            if (Comp3D != null)
            {
                foreach (var e in Comp3D)
                {
                    e.Wireframe = state.MouseState.RightButton == Microsoft.Xna.Framework.Input.ButtonState.Pressed;
                }
            }

            if (!MouseDown)
            {
                LastMouse = state.MouseState.Position;
            }
            MouseDown = state.MouseState.LeftButton == Microsoft.Xna.Framework.Input.ButtonState.Pressed;
            if (MouseDown)
            {
                var mpos = state.MouseState.Position;
                RotationX += (mpos.X - LastMouse.X) / 100f;
                RotationY += (mpos.Y - LastMouse.Y) / 100f;
                LastMouse  = mpos;
            }

            var mat = Microsoft.Xna.Framework.Matrix.CreateRotationZ(RotationY) * Microsoft.Xna.Framework.Matrix.CreateRotationY(RotationX);

            Camera.Position = Vector3.Transform(new Vector3(4, 4, 0), mat);
            Camera.Target   = new Vector3(0, 1f, 0);
            RotationX      += 0.01f;

            base.Update(state);
            if ((bool)state.SharedData["ExternalDraw"] && TargetTile?.WorldUI is ObjectComponent)
            {
                if (Comp3D != null)
                {
                    foreach (var e in Comp3D)
                    {
                        e.Dispose();
                        Scene.Remove(e);
                    }
                }
                Comp3D = new List <Debug3DDGRPComponent>();

                foreach (var obj in TargetTile.MultitileGroup.Objects)
                {
                    if (obj.GetValue(VMStackObjectVariable.Room) == 2)
                    {
                        continue;
                    }
                    var c    = new Debug3DDGRPComponent();
                    var dgrp = ((ObjectComponent)obj.WorldUI).DGRP;
                    c.Mesh = (dgrp == null)?null:Content.Content.Get().RCMeshes.Get(dgrp, obj.Object.OBJ); //new DGRP3DMesh(((ObjectComponent)obj.WorldUI).DGRP, obj.Object.OBJ, GameFacade.GraphicsDevice, null);
                    Scene.Add(c);
                    var vp = obj.VisualPosition;
                    c.Position = new Vector3(-(vp.X - 0.5f), vp.Z, -(vp.Y - 0.5f));
                    c.Initialize();
                    if (obj == TargetTile)
                    {
                        TargetComp3D = c;
                    }
                    Comp3D.Add(c);
                }
                //try get our dgrp;
            }
        }