コード例 #1
0
ファイル: PyramidEntity.cs プロジェクト: Spanyardie/Pulsar
 public PyramidEntity(PulsarScene scene, PulsarApplication application, DebugRenderer debugRenderer)
 {
     _scene         = scene;
     _application   = application;
     _debugRenderer = debugRenderer;
     CreateEntity();
 }
コード例 #2
0
        public void DisplaySceneInTree()
        {
            if (sceneTreeView.InvokeRequired)
            {
                //If an invoke is required because we are running on a different thread
                //we make an instance of the delegate here, once Invoke is called this method
                //will be called again, this time in the context of the called thread
                //when that occurs, InvokeRequired will then have a value of 'false'
                //and we can then update the scenetree with the latest scene information
                var d = new ThreadSafeDisplaySceneElements(DisplaySceneInTree);
                sceneTreeView.Invoke(d, Array.Empty <object>());
            }
            else
            {
                //grab the scene
                _application = (PulsarApplication)_renderScene.DrawingSurface.Application;

                if (_application != null)
                {
                    _scene = _application.DisplayScene;
                    _sceneTree.CurrentScene = _scene;
                    _sceneTree.DisplaySceneElements();
                }
            }
        }
コード例 #3
0
ファイル: GizmoHelper.cs プロジェクト: Spanyardie/Pulsar
        public static void SetAsSelected(Node node, Gizmo gizmo, PulsarScene scene)
        {
            StaticModel nodeModel = node.GetComponent <StaticModel>();

            if (nodeModel != null && scene != null)
            {
                PulsarApplication pulsarApplication = scene.GetApplication();
                if (pulsarApplication != null)
                {
                    MaterialTemp tempMaterial = new MaterialTemp(nodeModel, pulsarApplication);
                    if (tempMaterial != null)
                    {
                        tempMaterial.Name = "materialTemp";

                        try
                        {
                            tempMaterial.SetTransparentMaterial();
                        }
                        catch (PulsarGizmoException gizmoException)
                        {
                            gizmoException.Source = "[GizmoHelper:SetAsSelected]";
                            throw gizmoException;
                        }

                        node.AddComponent(tempMaterial);
                        if (gizmo != null)
                        {
                            gizmo.Node.Position = node.Position;
                            gizmo.SetGizmoVisible(true);
                            gizmo.Node.Enabled = true;
                        }
                    }
                }
            }
        }
コード例 #4
0
        private void Pulsar_Shown(object sender, EventArgs e)
        {
            PulsarApplication pulsarApplication = (PulsarApplication)_formRenderScene.DrawingSurface.Application;

            if (pulsarApplication != null)
            {
                _formSceneTree.MainApplication = pulsarApplication;
                _scene = pulsarApplication.DisplayScene;

                _pulsarExtendedProperties.MainApplication = pulsarApplication;
                _pulsarExtendedProperties.Scene           = _scene;

                pulsarApplication.ApplicationForms.Add(_formRenderScene);
                pulsarApplication.ApplicationForms.Add(_formSceneTree);
                pulsarApplication.ApplicationForms.Add(_pulsarExtendedProperties);
                pulsarApplication.ApplicationForms.Add(_pulsarAssets);
            }

            DisplaySceneInTree();

            Resize += Main_Resize;

            //registration for messages
            Registrant registrant = new Registrant
            {
                Subscriber = this,
                Type       = PulsarMessage.MessageType.ClearSelectedObjects
            };
        }
コード例 #5
0
ファイル: PyramidEntity.cs プロジェクト: Spanyardie/Pulsar
 public PyramidEntity(PulsarScene scene, PulsarApplication application)
 {
     _scene       = scene;
     _application = application;
     CreateEntity();
 }
コード例 #6
0
ファイル: RenderScene.cs プロジェクト: Spanyardie/Pulsar
 private void RenderScene_Load(object sender, EventArgs e)
 {
     renderSurface.Show <PulsarApplication>(new ApplicationOptions(assetsFolder: "E:\\VSProjects\\Windows\\Pulsar\\Assets"));
     MainApplication = (PulsarApplication)renderSurface.Application;
 }