コード例 #1
0
        public Component CreateCollisionComponent()
        {
            var component = new SceneComponent(new RawModel(ProxyModelLoader.LoadModel(CollisionBoxPath)), DefaultTexture, DefaultShader);

            ComponentCreator.AddComponentToRoot(component);
            return(component);
        }
コード例 #2
0
 public Actor CreateActor(string modelPath)
 {
     if (actor != null)
     {
         actor.CleanUp();
         ComponentCreator.RemoveComponentFromRoot(actor);
     }
     actor = new Actor(new RenderCore.RawModel(ProxyModelLoader.LoadModel(modelPath)), DefaultTexture, DefaultShader);
     ComponentCreator.AddComponentToRoot(actor);
     return(actor);
 }
コード例 #3
0
        private void RenderBasePass()
        {
            if (PostConstructor)
            {
                CollisionBoxModel = new RawModel(ProxyModelLoader.LoadModel(CollisionBoxPath));
                DefaultTexture    = ProxyTextureLoader.LoadSingleTexture(ProjectFolders.TextureAtlasPath + "\\default.jpg");
                DefaultShader     = new BasicShader(ProjectFolders.ShadersPath + "\\basicVS.glsl", ProjectFolders.ShadersPath + "\\basicFS.glsl");
                PostConstructor   = false;
            }

            if (actor != null && !bComponentHierarchyIsDirty)
            {
                actor.Render(EditorCamera.ViewMatrix, projectionMatrix);
            }

            skybox.Render(EditorCamera.ViewMatrix, projectionMatrix);
        }