示例#1
0
 public DummyObject(DummyObject copy)
 {
     Type = copy.Type;
     Model = copy.Model;
     Parameters = copy.Parameters;
     Position = copy.Position;
     YawPitchRoll = copy.YawPitchRoll;
     Scale = copy.Scale;
     Rotation = copy.Rotation;
     Height = copy.Height;
     Floating = copy.Floating;
     IsHighlighted = false;
 }
示例#2
0
        public DummyObject CreateDummyObject()
        {
            DummyObject tempObject = new DummyObject();

            tempObject.Type = GameType;
            tempObject.Model = Model;

            tempObject.Parameters = Parameters.ToArray();

            tempObject.Position = Vector3.Zero;
            tempObject.Rotation = Quaternion.Identity;
            tempObject.Scale = Vector3.One;
            tempObject.Height = 0.0f;

            return tempObject;
        }
示例#3
0
        public void RemoveObject(DummyObject dummyObject)
        {
            mDummies.Remove(dummyObject);

            if (dummyObject.Type == Utils.PlayerTypeName)
            {
                foreach (DummyObject dummy in mDummies)
                {
                    if (dummy.Type == Utils.PlayerTypeName)
                    {
                        return;
                    }
                }
                mDummies.Add(dummyObject);
            }
        }
示例#4
0
 public void AddObject(DummyObject dummyObject)
 {
     mDummies.Add(dummyObject);
 }
示例#5
0
        private void SetObjectPropertiesToForm(DummyObject dummyObject)
        {
            float X = (float)ObjectParameterPane.PositionX.Value;
            float Y = (float)ObjectParameterPane.PositionY.Value;
            float Z = (float)ObjectParameterPane.PositionZ.Value;
            dummyObject.Position = new Vector3(X, Y, Z);

            float Roll = (float)ObjectParameterPane.Roll.Value * (float)Math.PI / 180.0f;
            float Pitch = (float)ObjectParameterPane.Pitch.Value * (float)Math.PI / 180.0f;
            float Yaw = (float)ObjectParameterPane.Yaw.Value * (float)Math.PI / 180.0f;
            dummyObject.Rotation = Quaternion.CreateFromYawPitchRoll(Yaw, Pitch, Roll);

            float ScaleX = (float)ObjectParameterPane.ScaleX.Value;
            float ScaleY = (float)ObjectParameterPane.ScaleY.Value;
            float ScaleZ = (float)ObjectParameterPane.ScaleZ.Value;
            dummyObject.Scale = new Vector3(ScaleX, ScaleY, ScaleZ);

            dummyObject.Height = (float)ObjectParameterPane.FloatingHeight.Value;

            dummyObject.Floating = ObjectParameterPane.Floating.Checked;
        }
示例#6
0
        private void NewHandler(object sender, EventArgs e)
        {
            mDummyWorld.New();
            DummyObject player = new DummyObject(mObjects["playerBean"]);
            SetObjectPropertiesToForm(player);
            player.Scale = new Vector3(5.0f);
            player.Position = new Vector3(Level.BLOCK_SIZE / 2.0f, 0.0f, Level.BLOCK_SIZE / 2.0f);

            mDummyWorld.AddObject(player);
        }
示例#7
0
 private DummyObject CreateNewObjectFromParameters()
 {
     TreeNode selectedObject = EditorForm.ObjectPlacementPanel.ObjectTree.SelectedNode;
     if (selectedObject != null && mObjects.ContainsKey(selectedObject.Text) && selectedObject.Nodes.Count <= 0)
     {
         ObjectParameterPane.SelectedObjects.Clear();
         DummyObject dummy = new DummyObject(mObjects[selectedObject.Text]);
         ObjectParameterPane.SelectedObjects.Add(dummy);
         SetObjectPropertiesToForm(dummy);
         mDummyWorld.AddObject(dummy);
         return dummy;
     }
     return null;
 }