mirror of
https://mirror.ghproxy.com/https://github.com/dexyfex/CodeWalker
synced 2025-01-07 10:00:05 +08:00
LodLights rotating and scaling
This commit is contained in:
parent
a8e212135c
commit
ea876743bc
@ -2861,7 +2861,7 @@ namespace CodeWalker.GameFiles
|
||||
|
||||
UpdateTangentsAndOrientation();
|
||||
|
||||
Scale = Vector3.One;
|
||||
Scale = new Vector3(Falloff);
|
||||
}
|
||||
|
||||
public void UpdateTangentsAndOrientation()
|
||||
@ -2920,10 +2920,26 @@ namespace CodeWalker.GameFiles
|
||||
}
|
||||
public void SetOrientation(Quaternion ori)
|
||||
{
|
||||
var inv = Quaternion.Invert(Orientation);
|
||||
var delta = ori * inv;
|
||||
TangentX = Vector3.Normalize(delta.Multiply(TangentX));
|
||||
TangentY = Vector3.Normalize(delta.Multiply(TangentY));
|
||||
Direction = Vector3.Normalize(delta.Multiply(Direction));
|
||||
Orientation = ori;
|
||||
}
|
||||
public void SetScale(Vector3 scale)
|
||||
{
|
||||
switch (Type)
|
||||
{
|
||||
case LightType.Point:
|
||||
case LightType.Spot:
|
||||
Falloff = scale.Z;
|
||||
break;
|
||||
case LightType.Capsule:
|
||||
Falloff = scale.X;
|
||||
ConeOuterAngleOrCapExt = (byte)Math.Min(255, Math.Max(0, Math.Round(Math.Max((uint)ConeOuterAngleOrCapExt, 2) * Math.Abs(scale.Z / Math.Max(Scale.Z, 0.01f)))));//lols
|
||||
break;
|
||||
}
|
||||
Scale = scale;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user