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;
}),
): {
isPending: boolean;
cameraEntity: Entity | null;
};

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

A hook that creates a camera entity.

Parameters

ParameterTypeDescription
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. Once created, the camera entity will persist with this properties until the component using this hook is unmounted.

Returns

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

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

NameType
isPendingboolean
cameraEntityEntity | null