mirror of
https://mirror.ghproxy.com/https://github.com/dexyfex/CodeWalker
synced 2026-05-14 18:34:44 +08:00
Added Near/Far clip plane adjustments on WorldForm, made ModelForm and VehicleForm auto adjust clip planes to object being viewed
This commit is contained in:
@@ -436,12 +436,16 @@ namespace CodeWalker.Vehicles
|
||||
{
|
||||
//move the camera to a default place where the given sphere is fully visible.
|
||||
|
||||
rad = Math.Max(0.5f, rad);
|
||||
rad = Math.Max(0.01f, rad);
|
||||
|
||||
camera.FollowEntity.Position = pos;
|
||||
camera.TargetDistance = rad * 1.6f;
|
||||
camera.CurrentDistance = rad * 1.6f;
|
||||
|
||||
camera.ZFar = Math.Min(rad * 200.0f, 12000.0f);
|
||||
camera.ZNear = Math.Min(camera.ZFar * 5e-5f, 0.5f);
|
||||
camera.UpdateProj = true;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user