Skip to main content

Function: useCameraEntity()

function useCameraEntity(
props: {
perspective_lens: Partial<PerspectiveLens>;
orthographic_lens: Partial<OrthographicLens>;
renderGraphRef: UUID;
settings: RenderGraphDataObject;
renderTargetIndex: number;
orientation: Quat;
eulerOrientation: Vec3;
name: string;
position: Vec3;
},
watchedComponents: keyof ComponentsRecord[] | "any",
): {
isPending: boolean;
cameraEntity: Entity | null;
};

Defined in: livelink.react/sources/hooks/useCameraEntity.ts:97

A hook that creates a camera entity.

Parameters

ParameterTypeDefault valueDescription
props{ perspective_lens: Partial<PerspectiveLens>; orthographic_lens: Partial<OrthographicLens>; renderGraphRef: UUID; settings: RenderGraphDataObject; renderTargetIndex: number; orientation: Quat; eulerOrientation: Vec3; name: string; position: Vec3; }{}The properties used to create the camera entity.
props.perspective_lens?Partial<PerspectiveLens>undefinedThe perspective lens of the camera entity, can't be used with orthographic_lens.
props.orthographic_lens?Partial<OrthographicLens>undefinedThe orthographic lens of the camera entity, can't be used with perspective_lens.
props.renderGraphRef?UUIDundefinedThe render graph to use within the camera entity.
props.settings?RenderGraphDataObjectundefinedThe settings of the camera entity.
props.renderTargetIndex?numberundefinedThe render target index to use to render the frame.
props.orientation?QuatundefinedThe initial orientation of the camera entity in quaternion form, can't be used with eulerOrientation.
props.eulerOrientation?Vec3undefinedThe initial orientation of the camera entity in Euler angles form, can't be used with orientation.
props.name?stringundefinedThe name of the camera entity.
props.position?Vec3undefinedThe initial position of the camera entity.
watchedComponentskeyof ComponentsRecord[] | "any"[]The components to watch for changes. If any component in this list changes, the entity trigger a redraw. If set to "any", the entity will trigger a redraw on any component change.

Returns

{
isPending: boolean;
cameraEntity: Entity | null;
}

The camera entity and a boolean indicating if the entity is pending creation.

NameType
isPendingboolean
cameraEntityEntity | null