Changed a bit again particle drawing fix

This commit is contained in:
Aragas 2016-09-25 16:36:36 +03:00
parent 4595c78d8e
commit 71dcadc45a
2 changed files with 9 additions and 5 deletions

View File

@ -355,6 +355,10 @@
Return Me.Position + Me.GetCenter() Return Me.Position + Me.GetCenter()
End Function End Function
Protected Overridable Function CalculateCameraDistance(CPosition As Vector3) as Single
Return Vector3.Distance(Me.GetCameraDistanceCenterPoint(), CPosition)
End Function
Public Overridable Sub UpdateEntity() Public Overridable Sub UpdateEntity()
Dim CPosition As Vector3 = Screen.Camera.Position Dim CPosition As Vector3 = Screen.Camera.Position
Dim ActionScriptActive As Boolean = False Dim ActionScriptActive As Boolean = False
@ -371,12 +375,8 @@
End If End If
End If End If
If Me.GetType = GetType(Particle)
CameraDistance = Vector3.Distance(Me.GetCameraDistanceCenterPoint(), CPosition) - 1000000
Else
CameraDistance = Vector3.Distance(Me.GetCameraDistanceCenterPoint(), CPosition)
End If
CameraDistance = CalculateCameraDistance(CPosition)
If Me.DropUpdateUnlessDrawn = True And Me.DrawnLastFrame = False And Me.Visible = True And ActionScriptActive = False Then If Me.DropUpdateUnlessDrawn = True And Me.DrawnLastFrame = False And Me.Visible = True And ActionScriptActive = False Then

View File

@ -87,6 +87,10 @@
End Select End Select
End Sub End Sub
Protected Overrides Function CalculateCameraDistance(CPosition As Vector3) as Single
Return Vector3.Distance(Me.GetCameraDistanceCenterPoint(), CPosition) - 1000000
End Function
Public Overrides Sub UpdateEntity() Public Overrides Sub UpdateEntity()
If Me.Rotation.Y <> Screen.Camera.Yaw Then If Me.Rotation.Y <> Screen.Camera.Yaw Then
Me.Rotation.Y = Screen.Camera.Yaw Me.Rotation.Y = Screen.Camera.Yaw