Fixed light and object placement.
This commit is contained in:
+9
-7
@@ -88,23 +88,25 @@ public partial class Tile
|
||||
|
||||
private void SpawnLight(MeshInstance3D lightMesh, Placeholder placeholder, Transform3D transform)
|
||||
{
|
||||
Vector3 forward = (transform.Origin - placeholder.transform.Origin).Normalized();
|
||||
MeshInstance3D light = new MeshInstance3D
|
||||
{
|
||||
Mesh = lightMesh.Mesh,
|
||||
Position = placeholder.transform.Origin
|
||||
};
|
||||
light.AddChild(new OmniLight3D()
|
||||
OmniLight3D lightSource = new OmniLight3D()
|
||||
{
|
||||
OmniAttenuation = 2f,
|
||||
LightColor = new Color("#eae7ad"),
|
||||
LightColor = GameData.lightColor,
|
||||
ShadowEnabled = true,
|
||||
LightEnergy = 5f,
|
||||
LightEnergy = 100f,
|
||||
LightIndirectEnergy = 1.5f,
|
||||
Position = new Vector3(0.5f, 0, 0)
|
||||
});
|
||||
OmniRange = 20f,
|
||||
Position = placeholder.transform.Origin
|
||||
};
|
||||
lightSource.Position.MoveToward(transform.Origin, 0.1f);
|
||||
light.AddChild(lightSource);
|
||||
ContentNode.AddChild(light);
|
||||
light.LookAt(light.Position + forward, Vector3.Up);
|
||||
light.LookAt(transform.Origin, Vector3.Up);
|
||||
}
|
||||
|
||||
private void SpawnResource(MeshInstance3D resourceMesh, Placeholder placeholder, Transform3D transform)
|
||||
|
||||
Reference in New Issue
Block a user