Exemple #1
0
 public PyramidEntity(PulsarScene scene, PulsarApplication application, DebugRenderer debugRenderer)
 {
     _scene         = scene;
     _application   = application;
     _debugRenderer = debugRenderer;
     CreateEntity();
 }
Exemple #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();
                }
            }
        }
Exemple #3
0
        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;
                        }
                    }
                }
            }
        }
Exemple #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
            };
        }
Exemple #5
0
 public PyramidEntity(PulsarScene scene, PulsarApplication application)
 {
     _scene       = scene;
     _application = application;
     CreateEntity();
 }
Exemple #6
0
 private void RenderScene_Load(object sender, EventArgs e)
 {
     renderSurface.Show <PulsarApplication>(new ApplicationOptions(assetsFolder: "E:\\VSProjects\\Windows\\Pulsar\\Assets"));
     MainApplication = (PulsarApplication)renderSurface.Application;
 }