Compare commits

...

3 Commits

Author SHA1 Message Date
cosmonaut 72d960806a keyboard controls 2021-01-11 19:51:48 -08:00
cosmonaut a654a5f9a3 fix unused model loading 2021-01-11 13:59:52 -08:00
cosmonaut 47ae1a0dbd cutting everything but skybox 2021-01-11 13:37:30 -08:00
11 changed files with 39 additions and 199 deletions

View File

@ -9,6 +9,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Kav", "Kav\Kav.Framework.cs
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Smuggler", "Smuggler\Smuggler.Framework.csproj", "{06664804-2B01-46F5-B8EC-07E5E2C1EADC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FNA", "FNA\FNA.csproj", "{35253CE1-C864-4CD3-8249-4D1319748E8F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -24,10 +26,10 @@ Global
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{9ED076FA-32C3-4F1E-BB90-549B3A2FA46F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9ED076FA-32C3-4F1E-BB90-549B3A2FA46F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9ED076FA-32C3-4F1E-BB90-549B3A2FA46F}.Debug|x64.ActiveCfg = Debug|Any CPU
{9ED076FA-32C3-4F1E-BB90-549B3A2FA46F}.Debug|x64.Build.0 = Debug|Any CPU
{9ED076FA-32C3-4F1E-BB90-549B3A2FA46F}.Debug|x86.ActiveCfg = Debug|Any CPU
{9ED076FA-32C3-4F1E-BB90-549B3A2FA46F}.Debug|x86.Build.0 = Debug|Any CPU
{9ED076FA-32C3-4F1E-BB90-549B3A2FA46F}.Debug|x64.ActiveCfg = Debug|x64
{9ED076FA-32C3-4F1E-BB90-549B3A2FA46F}.Debug|x64.Build.0 = Debug|x64
{9ED076FA-32C3-4F1E-BB90-549B3A2FA46F}.Debug|x86.ActiveCfg = Debug|x86
{9ED076FA-32C3-4F1E-BB90-549B3A2FA46F}.Debug|x86.Build.0 = Debug|x86
{9ED076FA-32C3-4F1E-BB90-549B3A2FA46F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9ED076FA-32C3-4F1E-BB90-549B3A2FA46F}.Release|Any CPU.Build.0 = Release|Any CPU
{9ED076FA-32C3-4F1E-BB90-549B3A2FA46F}.Release|x64.ActiveCfg = Release|Any CPU
@ -58,5 +60,17 @@ Global
{06664804-2B01-46F5-B8EC-07E5E2C1EADC}.Release|x64.Build.0 = Release|Any CPU
{06664804-2B01-46F5-B8EC-07E5E2C1EADC}.Release|x86.ActiveCfg = Release|x86
{06664804-2B01-46F5-B8EC-07E5E2C1EADC}.Release|x86.Build.0 = Release|x86
{35253CE1-C864-4CD3-8249-4D1319748E8F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{35253CE1-C864-4CD3-8249-4D1319748E8F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{35253CE1-C864-4CD3-8249-4D1319748E8F}.Debug|x64.ActiveCfg = Debug|x64
{35253CE1-C864-4CD3-8249-4D1319748E8F}.Debug|x64.Build.0 = Debug|x64
{35253CE1-C864-4CD3-8249-4D1319748E8F}.Debug|x86.ActiveCfg = Debug|x86
{35253CE1-C864-4CD3-8249-4D1319748E8F}.Debug|x86.Build.0 = Debug|x86
{35253CE1-C864-4CD3-8249-4D1319748E8F}.Release|Any CPU.ActiveCfg = Debug|Any CPU
{35253CE1-C864-4CD3-8249-4D1319748E8F}.Release|Any CPU.Build.0 = Debug|Any CPU
{35253CE1-C864-4CD3-8249-4D1319748E8F}.Release|x64.ActiveCfg = Debug|Any CPU
{35253CE1-C864-4CD3-8249-4D1319748E8F}.Release|x64.Build.0 = Debug|Any CPU
{35253CE1-C864-4CD3-8249-4D1319748E8F}.Release|x86.ActiveCfg = Debug|Any CPU
{35253CE1-C864-4CD3-8249-4D1319748E8F}.Release|x86.Build.0 = Debug|Any CPU
EndGlobalSection
EndGlobal

BIN
KavTest/Content/ToonShadeRuins.glb (Stored with Git LFS)

Binary file not shown.

BIN
KavTest/Content/avocado.glb (Stored with Git LFS)

Binary file not shown.

BIN
KavTest/Content/bluetorus.glb (Stored with Git LFS)

Binary file not shown.

BIN
KavTest/Content/cube.glb (Stored with Git LFS)

Binary file not shown.

BIN
KavTest/Content/floor.glb (Stored with Git LFS)

Binary file not shown.

BIN
KavTest/Content/pinkcone.glb (Stored with Git LFS)

Binary file not shown.

BIN
KavTest/Content/redcylinder.glb (Stored with Git LFS)

Binary file not shown.

BIN
KavTest/Content/rustysphere.glb (Stored with Git LFS)

Binary file not shown.

View File

@ -50,7 +50,26 @@ namespace KavTest.Engines
if (SomeComponent<PerspectiveCameraComponent>())
{
var cameraEntity = ReadEntity<PerspectiveCameraComponent>();
SendMessage(new RotateCameraMessage(cameraEntity, -mouseState.X, -mouseState.Y));
if (keyboardState.IsKeyDown(Keys.I))
{
SendMessage(new RotateCameraMessage(cameraEntity, 0, 3));
}
if (keyboardState.IsKeyDown(Keys.K))
{
SendMessage(new RotateCameraMessage(cameraEntity, 0, -3));
}
if (keyboardState.IsKeyDown(Keys.J))
{
SendMessage(new RotateCameraMessage(cameraEntity, 3, 0));
}
if (keyboardState.IsKeyDown(Keys.L))
{
SendMessage(new RotateCameraMessage(cameraEntity, -3, 0));
}
}
}
}

View File

@ -30,7 +30,7 @@ namespace KavTest
Window.AllowUserResizing = true;
IsMouseVisible = true;
Microsoft.Xna.Framework.Input.Mouse.IsRelativeMouseModeEXT = true;
}
@ -48,77 +48,6 @@ namespace KavTest
{
base.Initialize();
var rustyBallModel = Kav.ModelLoader.Load(
GraphicsDevice,
Smuggler.Importer.ImportGLB(
GraphicsDevice,
File.OpenRead("Content/rustysphere.glb")
)
);
rustyBallModel.DisableNormalMaps();
rustyBallModel.DisableAlbedoMaps();
rustyBallModel.DisableMetallicRoughnessMaps();
rustyBallModel.Albedo = Color.DeepSkyBlue;
rustyBallModel.Metallic = 0.5f;
rustyBallModel.Roughness = 0.284f;
var lightBulbModel = Kav.ModelLoader.Load(
GraphicsDevice,
Smuggler.Importer.ImportGLB(GraphicsDevice, File.OpenRead("Content/cube.glb"))
);
var floorModel = Kav.ModelLoader.Load(
GraphicsDevice,
Smuggler.Importer.ImportGLB(GraphicsDevice, File.OpenRead("Content/floor.glb"))
);
floorModel.Metallic = 0f;
floorModel.Roughness = 0f;
var avocadoModel = Kav.ModelLoader.Load(
GraphicsDevice,
Smuggler.Importer.ImportGLB(GraphicsDevice, File.OpenRead("Content/avocado.glb"))
);
var redCylinderModel = Kav.ModelLoader.Load(
GraphicsDevice,
Smuggler.Importer.ImportGLB(
GraphicsDevice,
File.OpenRead("Content/redcylinder.glb")
)
);
var pinkConeModel = Kav.ModelLoader.Load(
GraphicsDevice,
Smuggler.Importer.ImportGLB(
GraphicsDevice,
File.OpenRead("Content/pinkcone.glb")
)
);
var blueTorusModel = Kav.ModelLoader.Load(
GraphicsDevice,
Smuggler.Importer.ImportGLB(
GraphicsDevice,
File.OpenRead("Content/bluetorus.glb")
)
);
var cubeModel = Kav.ModelLoader.Load(
GraphicsDevice,
Smuggler.Importer.ImportGLB(
GraphicsDevice,
File.OpenRead("Content/cube.glb")
)
);
var toonShadeRuinsModel = Kav.ModelLoader.Load(
GraphicsDevice,
Smuggler.Importer.ImportGLB(
GraphicsDevice,
File.OpenRead("Content/ToonShadeRuins.glb")
)
);
Texture2D.TextureDataFromStreamEXT(
File.OpenRead("Content/Skybox/front.jpg"),
out var skyboxSize,
@ -174,96 +103,10 @@ namespace KavTest
WorldBuilder.AddEngine(new MoveAlongCurve3DEngine());
WorldBuilder.AddEngine(new MotionEngine());
WorldBuilder.AddEngine(new CameraEngine());
WorldBuilder.AddEngine(new RustyBallSpawner(rustyBallModel));
WorldBuilder.AddEngine(new LightBulbSpawner(lightBulbModel));
WorldBuilder.AddEngine(new StaticModelSpawner());
WorldBuilder.AddEngine(new DirectionalLightSpawner());
WorldBuilder.AddGeneralRenderer(new SceneRenderer(GraphicsDevice), 0);
// WorldBuilder.SendMessage(new RustyBallSpawnMessage(
// new Transform3D(new Vector3(0, 0, 0)),
// new Vector3(1, 1, -1)
// ));
// WorldBuilder.SendMessage(new RustyBallSpawnMessage(
// new Transform3D(new Vector3(-3, 0, 0)),
// new Vector3(-1, 1, -1)
// ));
// WorldBuilder.SendMessage(new RustyBallSpawnMessage(
// new Transform3D(new Vector3(3, 0, 0)),
// new Vector3(-1, 1, 1)
// ));
// WorldBuilder.SendMessage(new StaticModelSpawnMessage(
// new Transform3D(new Vector3(0, 1, 0), Quaternion.Identity, new Vector3(1f, 1f, 1f)),
// rustyBallModel
// ));
WorldBuilder.SendMessage(new StaticModelSpawnMessage(
new Transform3D(new Vector3(0, -3, 0), Quaternion.Identity, new Vector3(10f, 1f, 10f)),
floorModel
));
WorldBuilder.SendMessage(new StaticModelSpawnMessage(
new Transform3D(
new Vector3(0, 1, 0),
Quaternion.CreateFromAxisAngle(
Vector3.Right,
-Microsoft.Xna.Framework.MathHelper.PiOver2
),
new Vector3(1f, 1f, 1f)
),
redCylinderModel
));
WorldBuilder.SendMessage(new StaticModelSpawnMessage(
new Transform3D(
new Vector3(-3, 1, 0),
Quaternion.CreateFromAxisAngle(
Vector3.Right,
-Microsoft.Xna.Framework.MathHelper.PiOver2
),
new Vector3(1f, 1f, 1f)
),
blueTorusModel
));
WorldBuilder.SendMessage(new StaticModelSpawnMessage(
new Transform3D(
new Vector3(3, 1, 0),
Quaternion.CreateFromAxisAngle(
Vector3.Right,
-Microsoft.Xna.Framework.MathHelper.PiOver2
),
new Vector3(1f, 1f, 1f)
),
cubeModel
));
// WorldBuilder.SendMessage(new StaticModelSpawnMessage(
// Transform3D.Identity,
// toonShadeRuinsModel
// ));
for (var i = 0; i < 1; i++)
{
var start = RandomHelper.RandomVector3(-5, 5);
WorldBuilder.SendMessage(new LightBulbSpawnMessage(
new Transform3D(start.ToXNAVector(), Quaternion.Identity, new Vector3(0.1f, 0.1f, 0.1f)),
RandomHelper.RandomColor(),
1f,
RandomHelper.RandomLoop(start, -15, 15, 3, 10)
));
}
var ambientLightEntity = WorldBuilder.CreateEntity();
WorldBuilder.SetComponent(ambientLightEntity, new AmbientLightComponent(
new Color(0.4f, 0.4f, 0.4f)
));
WorldBuilder.SendMessage(new DirectionalLightSpawnMessage(
//Quaternion.CreateFromAxisAngle(Vector3.Right, Microsoft.Xna.Framework.MathHelper.Pi / 3f),
Quaternion.CreateFromAxisAngle(Vector3.Right, Microsoft.Xna.Framework.MathHelper.PiOver4),
@ -271,18 +114,6 @@ namespace KavTest
0.7f
));
// WorldBuilder.SendMessage(new DirectionalLightSpawnMessage(
// Quaternion.CreateFromAxisAngle(Vector3.Right, Microsoft.Xna.Framework.MathHelper.PiOver4),
// Color.GhostWhite,
// 0.1f
// ));
// WorldBuilder.SendMessage(new DirectionalLightSpawnMessage(
// Quaternion.CreateFromAxisAngle(Vector3.Right, Microsoft.Xna.Framework.MathHelper.PiOver2 + Microsoft.Xna.Framework.MathHelper.PiOver4),
// Color.GhostWhite,
// 0.1f
// ));
var cameraEntity = WorldBuilder.CreateEntity();
WorldBuilder.SetComponent(cameraEntity, new ArcballTransformComponent(
new ArcballTransform(