Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Scripts/Systems/LineSegmentTransformSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ protected override void OnUpdate ()
.ForEach( ( ref LocalToWorld ltr , in LineSegment segment ) =>
{
float3 lineVec = segment.to - segment.from;
var rot = quaternion.LookRotation( math.normalize(lineVec) , math.normalize(cameraPosition-segment.from) );
var rot = quaternion.LookRotationSafe( math.normalize(lineVec) , math.normalize(cameraPosition-segment.from) );
var pos = segment.from;
var scale = new float3{ x=segment.lineWidth , y=1f , z=math.length(lineVec) };
ltr.Value = float4x4.TRS( pos , rot , scale );
Expand All @@ -37,7 +37,7 @@ protected override void OnUpdate ()
.ForEach( ( ref LocalToWorld ltr , in LineSegment segment ) =>
{
float3 lineVec = segment.to - segment.from;
var rot = quaternion.LookRotation( math.normalize(lineVec) , math.mul(cameraRotation,new float3{z=-1}) );
var rot = quaternion.LookRotationSafe( math.normalize(lineVec) , math.mul(cameraRotation,new float3{z=-1}) );
var pos = segment.from;
var scale = new float3{ x=segment.lineWidth , y=1f , z=math.length(lineVec) };
ltr.Value = float4x4.TRS( pos , rot , scale );
Expand Down