Vixen
02b45cc4
csharp
public struct CameraConfiner

Keeps a shot inside a box, whatever its body stage would rather do.

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

Remarks

Cinemachine's Confiner, reduced to the case that pays for itself. A box is what a room, a corridor, an arena and a 2D level's bounds all are, it clamps in three components, and it cannot fail — every point outside a box has exactly one nearest point inside it. A convex hull or a polygon needs a containment test, a projection and an answer to what happens when the camera starts outside, and those belong with a level's collision data rather than here.

It runs after the body stage and before the aim stage, so a confined camera still looks at its subject correctly from wherever the clamp put it. Confining after the aim would leave the frame pointing at where the camera wanted to be.

Fields and properties (4)

  • public Vector3 Minimum

    The low corner of the box the camera must stay in.

  • public Vector3 Maximum

    The high corner of the box the camera must stay in.

  • public float Damping

    How long the camera takes to remove 99 % of the clamp. Zero clamps outright.

  • public readonly BoundingBox Bounds

    The box, as a bounding box.

Methods (1)

Used by (6)

  • ComponentRegistrationVixen.Engine
  • TypeRegistrationVixen.Engine
  • VirtualCameraSystemVixen.Engine
  • VirtualCameraTestsVixen.Engine.Tests
  • Vixen_Engine_Cameras_CameraConfinerSerializerVixen.Engine
  • MaterialIconsVixen.Editor.App