more toon testing
parent
e29d9904ab
commit
ed6a6a893a
2
Kav
2
Kav
|
@ -1 +1 @@
|
|||
Subproject commit a914c586b2b01dc2d103551365a9025326e77e3e
|
||||
Subproject commit 1f10698811a57b11d343dee62a47ec1b5610b626
|
|
@ -0,0 +1,15 @@
|
|||
using Encompass;
|
||||
using Microsoft.Xna.Framework;
|
||||
|
||||
namespace KavTest
|
||||
{
|
||||
public struct ContinuousRotationComponent : IComponent
|
||||
{
|
||||
public Quaternion Quaternion { get; }
|
||||
|
||||
public ContinuousRotationComponent(Vector3 axis, float angle)
|
||||
{
|
||||
Quaternion = Quaternion.CreateFromAxisAngle(axis, angle);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -5,7 +5,7 @@ using Microsoft.Xna.Framework;
|
|||
|
||||
namespace KavTest.Engines
|
||||
{
|
||||
[Reads(typeof(AngularVelocityComponent))]
|
||||
[Reads(typeof(AngularVelocityComponent), typeof(ContinuousRotationComponent))]
|
||||
[Sends(typeof(LocalRotationMessage))]
|
||||
public class AngularVelocityEngine : Engine
|
||||
{
|
||||
|
@ -18,6 +18,12 @@ namespace KavTest.Engines
|
|||
|
||||
SendMessage(new LocalRotationMessage(entity, Quaternion.CreateFromYawPitchRoll(angularVelocity.X, angularVelocity.Y, angularVelocity.Z)));
|
||||
}
|
||||
|
||||
foreach (var entity in ReadEntities<ContinuousRotationComponent>())
|
||||
{
|
||||
ref readonly var rotationComponent = ref GetComponent<ContinuousRotationComponent>(entity);
|
||||
SendMessage(new LocalRotationMessage(entity, rotationComponent.Quaternion));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,6 +13,8 @@ namespace KavTest.Spawners
|
|||
|
||||
AddComponent(entity, new Transform3DComponent(new Transform3D(Vector3.Zero, message.Orientation)));
|
||||
AddComponent(entity, new DirectionalLightComponent(message.Color, message.Intensity));
|
||||
var forward = Matrix.CreateFromQuaternion(message.Orientation).Forward;
|
||||
AddComponent(entity, new ContinuousRotationComponent(forward, 0.01f));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -57,7 +57,10 @@ namespace KavTest
|
|||
);
|
||||
rustyBallModel.DisableNormalMaps();
|
||||
rustyBallModel.DisableAlbedoMaps();
|
||||
rustyBallModel.DisableMetallicRoughnessMaps();
|
||||
rustyBallModel.Albedo = Color.DeepSkyBlue;
|
||||
rustyBallModel.Metallic = 0.5f;
|
||||
rustyBallModel.Roughness = 0.284f;
|
||||
|
||||
var lightBulbModel = Kav.ModelLoader.Load(
|
||||
GraphicsDevice,
|
||||
|
@ -68,6 +71,8 @@ namespace KavTest
|
|||
GraphicsDevice,
|
||||
Smuggler.Importer.ImportGLB(GraphicsDevice, File.OpenRead("Content/floor.glb"))
|
||||
);
|
||||
floorModel.Metallic = 0f;
|
||||
floorModel.Roughness = 0f;
|
||||
|
||||
var avocadoModel = Kav.ModelLoader.Load(
|
||||
GraphicsDevice,
|
||||
|
@ -185,7 +190,8 @@ namespace KavTest
|
|||
));
|
||||
|
||||
WorldBuilder.SendMessage(new DirectionalLightSpawnMessage(
|
||||
Quaternion.CreateFromAxisAngle(Vector3.Right, Microsoft.Xna.Framework.MathHelper.Pi / 3f),
|
||||
//Quaternion.CreateFromAxisAngle(Vector3.Right, Microsoft.Xna.Framework.MathHelper.Pi / 3f),
|
||||
Quaternion.CreateFromAxisAngle(Vector3.Right, Microsoft.Xna.Framework.MathHelper.PiOver4),
|
||||
Color.LightGoldenrodYellow,
|
||||
0.7f
|
||||
));
|
||||
|
|
Loading…
Reference in New Issue