Skip to main content

Function: useCameraEntity()

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

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

A hook that creates a camera entity.

Parameters

ParameterTypeDefault valueDescription
props| { name?: string; position?: Vec3; } & { orientation?: Quat; } & Partial<Record<"eulerOrientation", never>> & { perspective_lens?: Partial<PerspectiveLens>; } & Partial<Record<"orthographic_lens", never>> & { renderGraphRef?: UUID; settings?: RenderGraphDataObject; renderTargetIndex?: number; } | { name?: string; position?: Vec3; } & { orientation?: Quat; } & Partial<Record<"eulerOrientation", never>> & { orthographic_lens?: Partial<OrthographicLens>; } & Partial<Record<"perspective_lens", never>> & { renderGraphRef?: UUID; settings?: RenderGraphDataObject; renderTargetIndex?: number; } | { name?: string; position?: Vec3; } & { eulerOrientation?: Vec3; } & Partial<Record<"orientation", never>> & { perspective_lens?: Partial<PerspectiveLens>; } & Partial<Record<"orthographic_lens", never>> & { renderGraphRef?: UUID; settings?: RenderGraphDataObject; renderTargetIndex?: number; } | { name?: string; position?: Vec3; } & { eulerOrientation?: Vec3; } & Partial<Record<"orientation", never>> & { orthographic_lens?: Partial<OrthographicLens>; } & Partial<Record<"perspective_lens", never>> & { renderGraphRef?: UUID; settings?: RenderGraphDataObject; renderTargetIndex?: number; }{}The properties used to create 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: null | Entity;
}

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

NameType
isPendingboolean
cameraEntitynull | Entity