ArSceneView

کلاس عمومی ArSceneView

SurfaceView که با ARCore ادغام می شود و صحنه را رندر می کند.

ثابت های ارثی

فیلدهای ارثی

سازندگان عمومی

ArSceneView ( زمینه زمینه)
یک شی ArSceneView را می سازد و آن را به یک متن Android متصل می کند.
ArSceneView ( زمینه زمینه، AttributeSet attrs)
یک شی ArSceneView را می سازد و آن را به یک متن Android متصل می کند.

روش های عمومی

قاب
getArFrame ()
جدیدترین قاب ARCore را در صورت موجود بودن برمی‌گرداند.
بین المللی
getCameraStreamRenderPriority ()
اولویت رندر را دریافت کنید که ترتیب رندر جریان دوربین را کنترل می کند.
PlaneRenderer
getPlaneRenderer ()
Returns PlaneRenderer که برای کنترل تجسم هواپیما استفاده می شود.
جلسه
getSession ()
جلسه ARCore استفاده شده توسط این نما را برمی گرداند.
بولی
isEnvironmentalHdrLightingAvailable ()
اگر دوربین ARCore با Config.LightEstimationMode.ENVIRONMENTAL_HDR پیکربندی شده باشد، true برمی‌گردد.
بولی
isLightDirectionUpdateEnabled ()
بررسی می کند که آیا نور خورشید در هر فریم بر اساس برآورد نور محیطی HDR به روز می شود یا خیر.
بولی
خالی
مکث ()
رشته رندر و جلسه ARCore را متوقف می کند.
CompletableFuture< Void >
pauseAsync ( مجری اجرا)
تماس غیر مسدود کننده برای مکث موضوع رندر و جلسه ARCore.
خالی
رزومه ()
رشته رندر و جلسه ARCore را از سر می گیرد.
CompletableFuture< Void >
resumeAsync ( اجرا کننده)
تماس غیر مسدود کننده برای از سرگیری رشته رندر و جلسه ARCore در پس‌زمینه

این باید از onResume() فراخوانی شود.

خالی
setCameraStreamRenderPriority (اولویت int)
برای کنترل ترتیب رندر جریان دوربین، اولویت رندر را تنظیم کنید.
خالی
setLightDirectionUpdateEnabled (بولی isLightDirectionUpdateEnabled)
تنظیم می کند که آیا جهت نور خورشید تولید شده از نور محیطی HDR باید در هر فریم به روز شود یا خیر.
خالی
setLightEstimationEnabled (فعال کردن بولی)
تخمین نور را بر اساس فید دوربین فعال کنید.
خالی
setupSession ( جلسه جلسه)
نما را با یک جلسه AR تنظیم کنید.

روش های ارثی

سازندگان عمومی

عمومی ArSceneView ( زمینه زمینه)

یک شی ArSceneView را می سازد و آن را به یک متن Android متصل می کند.

برای اینکه کار رندر به درستی انجام شود، setupSession(Session) فراخوانی شود.

مولفه های
متن نوشته متن Android برای استفاده
همچنین ببینید

عمومی ArSceneView ( زمینه متن، AttributeSet attrs)

یک شی ArSceneView را می سازد و آن را به یک متن Android متصل می کند.

برای اینکه کار رندر به درستی انجام شود، setupSession(Session) فراخوانی شود.

مولفه های
متن نوشته متن Android برای استفاده
attrs Android AttributeSet برای ارتباط با
همچنین ببینید

روش های عمومی

قاب عمومی getArFrame ()

Returns the most recent ARCore Frame if it is available. The frame is updated at the beginning of each drawing frame. Callers of this method should not retain a reference to the return value, since it will be invalid to use the ARCore frame starting with the next frame.

public int getCameraStreamRenderPriority ()

Get the render priority that control the order of rendering the camera stream. The priority is between a range of 0 (rendered first) and 7 (rendered last).

The default value is 7, which forces the camera stream to render last. This is best for performance because it prevents overdraw. However, when using a material as an occluder (for example, in the augmented faces sample), this should be changed. Otherwise, the occluder will occlude the camera stream and black will be rendered.

public PlaneRenderer getPlaneRenderer ()

Returns PlaneRenderer, used to control plane visualization.

public Session getSession ()

Returns the ARCore Session used by this view.

public boolean isEnvironmentalHdrLightingAvailable ()

Returns true if the ARCore camera is configured with Config.LightEstimationMode.ENVIRONMENTAL_HDR. When Environmental HDR lighting mode is enabled, the resulting light estimates will be applied to the Sceneform Scene.

برمی گرداند
  • true if HDR lighting is enabled in Sceneform because ARCore HDR lighting estimation is enabled.

public boolean isLightDirectionUpdateEnabled ()

Checks whether the sunlight is being updated every frame based on the Environmental HDR lighting estimate.

برمی گرداند
  • true if the sunlight direction is updated every frame, false otherwise.

public boolean isLightEstimationEnabled ()

برمی گرداند
  • returns true if light estimation is enabled.

public void pause ()

Pauses the rendering thread and ARCore session.

This must be called from onPause().

public CompletableFuture< Void > pauseAsync ( Executor executor)

Non blocking call to pause the rendering thread and ARCore session.

This should be called from onPause().

If pauseAsync is called while another pause or resume is in progress, the pause will be enqueued and happen after the current operation completes.

مولفه های
executor
برمی گرداند
  • A CompletableFuture completed on the main thread on the pause has completed. The future Will will be completed exceptionally if the resume can not be done.

public void resume ()

Resumes the rendering thread and ARCore session.

This must be called from onResume().

Throws
CameraNotAvailableException if the camera can not be opened

public CompletableFuture< Void > resumeAsync ( Executor executor)

Non blocking call to resume the rendering thread and ARCore session in the background

This must be called from onResume().

If called while another pause or resume is in progress, the resume will be enqueued and happen after the current operation completes.

مولفه های
executor
برمی گرداند
  • A CompletableFuture completed on the main thread once the resume has completed. The future will be completed exceptionally if the resume can not be done.

public void setCameraStreamRenderPriority (int priority)

Set the render priority to control the order of rendering the camera stream. The priority is between a range of 0 (rendered first) and 7 (rendered last).

The default value is 7, which forces the camera stream to render last. This is best for performance because it prevents overdraw. However, when using a material as an occluder (for example, in the augmented faces sample), this should be changed. Otherwise, the occluder will occlude the camera stream and black will be rendered.

مولفه های
priority

public void setLightDirectionUpdateEnabled (boolean isLightDirectionUpdateEnabled)

Sets whether the sunlight direction generated from Environmental HDR lighting should be updated every frame. If false the light direction will be updated a single time and then no longer change.

This may be used to turn off shadow direction updates when they are distracting or unwanted.

The default state is true, with sunlight direction updated every frame.

مولفه های
isLightDirectionUpdateEnabled

public void setLightEstimationEnabled (boolean enable)

Enable Light Estimation based on the camera feed. The color and intensity of the sun's indirect light will be modulated by values provided by ARCore's light estimation. Lit objects in the scene will be affected.

مولفه های
enable set to true to enable Light Estimation or false to use the default estimate, which is a pixel intensity of 1.0 and color correction value of white (1.0, 1.0, 1.0).

public void setupSession ( Session session)

Setup the view with an AR Session. This method must be called once to supply the ARCore session. The session is needed for any rendering to occur.

The session is expected to be configured with the update mode of LATEST_CAMERA_IMAGE. Without this configuration, the updating of the ARCore session could block the UI Thread causing poor UI experience.

مولفه های
session the ARCore session to use for this view
همچنین ببینید