Vixen
02b45cc4
csharp
public struct CameraOcclusion

Pulls the shot in when something is standing between it and what it is looking at.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

Cinemachine's Collider. The camera keeps its aim and gives up its distance: when the line from the target to the camera is blocked, the shot moves up that line to just in front of whatever blocked it, and eases back out when the way is clear again.

⚠ It needs something that can answer "is this line blocked", and Vixen.Engine has no such thing. The engine references no physics — that direction is deliberate and is what keeps Vixen.Physics an optional subsystem rather than a dependency of the frame loop. So the question is asked through ICameraOcclusion, which the host implements over whatever it has: a physics world, a navigation mesh, a hand-written box test in a game whose corridors are all boxes. A shot carrying this component in a game that supplies no implementation is not an error and does nothing.

Fields and properties (6)

  • public float Radius

    The radius of the probe, so the camera does not end up flush against a surface.

  • public float MinimumDistance

    How close to the target the camera may be pulled before it stops trying.

  • public float PullInDamping

    How long the camera takes to remove 99 % of the pull inward.

  • public float PullOutDamping

    How long the camera takes to ease back out once nothing is in the way.

  • public float Applied

    How far from the target the camera is currently allowed to be. Engine-owned.

  • public Vector3 PivotOffset

    Where the sweep starts, relative to the target's origin, in world space.

Methods (1)

  • public static CameraOcclusion Default(float radius = 0.2)

    An avoider that ducks in at once and comes back out over half a second.

Used by (7)

  • ComponentRegistrationVixen.Engine
  • PlayerCamerasVixen.Engine
  • TypeRegistrationVixen.Engine
  • VirtualCameraSystemVixen.Engine
  • VirtualCameraTestsVixen.Engine.Tests
  • Vixen_Engine_Cameras_CameraOcclusionSerializerVixen.Engine
  • MaterialIconsVixen.Editor.App