CityRP Documentation Repository

entities.cityrp_peephole

Door Peephole Entity (Client). Both faces are drawn as a rim and a lens rather than modelled.

Functions

ClientENT:DrawFace(face, origin, normal)Source ☍

Draws one face of the fitting. A 3D2D plane faces along Up, not Forward, so the rotation is about Right.

Parameters

  • facestringWhich face is being drawn.
  • originVectorWhere on the door the face sits.
  • normalVectorThe direction that face points.
SharedENT:GetCondition() → numberSource ☍

How intact the lens is, derived from health. Zero means health has not networked yet.

Returns

  1. numberHow intact the lens is, from MinCondition to 1.
SharedENT:IsInside(pos) → booleanSource ☍

Checks whether a position sits on the interior (viewing) side of the peephole.

Parameters

  • posVectorThe world position to test.

Returns

  1. booleanTrue when the position is behind the peephole's outward face.

Fields

SharedENT.FittingModelSource ☍
SharedENT.HullRadiusSource ☍

Half-extent of the collision hull.

SharedENT.LensColourSource ☍
SharedENT.LensRadiusSource ☍
ClientENT.lightCacheSource ☍
SharedENT.MaxHealthSource ☍
SharedENT.MinConditionSource ☍

Lowest condition a lens degrades to.

SharedENT.RimColourSource ☍

Rim and glass under full light; the lighting pass only scales down.

SharedENT.RimRadiusSource ☍

Rim and lens radius in hammer units.

ClientENT.setUpSource ☍