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
Parameter | Type | Default value | Description |
---|---|---|---|
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 > | undefined | The perspective lens of the camera entity, can't be used with orthographic_lens. |
props.orthographic_lens ? | Partial <OrthographicLens > | undefined | The orthographic lens of the camera entity, can't be used with perspective_lens. |
props.renderGraphRef ? | UUID | undefined | The render graph to use within the camera entity. |
props.settings ? | RenderGraphDataObject | undefined | The settings of the camera entity. |
props.renderTargetIndex ? | number | undefined | The render target index to use to render the frame. |
props.orientation ? | Quat | undefined | The initial orientation of the camera entity in quaternion form, can't be used with eulerOrientation. |
props.eulerOrientation ? | Vec3 | undefined | The initial orientation of the camera entity in Euler angles form, can't be used with orientation. |
props.name ? | string | undefined | The name of the camera entity. |
props.position ? | Vec3 | undefined | The initial position of the camera entity. |
watchedComponents | keyof 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.
Name | Type |
---|---|
isPending | boolean |
cameraEntity | Entity | null |