WaveVRCameraTexture returns a texture2D to update preview image from an Android camera or an external camera (if available). You need to add a permission as shown below to access the camera in AndroidManifest.xml.
<uses-permission android:name=”android.permission.CAMERA” />
The WaveVRCameraTexture provides several functions to have properties of camera included
- EPixelFormat getCameraImageFormat()
Return format of UTexture2D object, current value is PF_R8G8B8A8.
- EWVR_CameraImageType getCameraImageType()
Return image type WVR_CameraImageType_Invalid, WVR_CameraImageType_SingleEye or WVR_CameraImageType_DualEye. Suggest to check this before you decide how to display your image.
- int getCameraImageWidth()
Return width of the camera image. 0 means camera has not started.
- int getCameraImageHeight()
Return height of the camera image. 0 means camera has not started.
The WaveVR Camera Texture also provides APIs to control the camera
- UTexture2D* getCameraTexture()
This API will start the camera and create an UTexture2D object to update later.
- void shutdownCamera()
Call this API to stop the camera.
- void updateCamera(float delta)
Call this API to update the camera image and draw on texture2D.
Camera is in WaveVR
WaveVRCameraTexture is in WaveVR category as
Blueprint is located in Plugins/WaveVR/Content/Blueprints/CameraTexture_Blueprint.uasset
How to use¶
Please refer to CameraTexture_Blueprint.
- Add WaveVRCameraTexture component to actor as
- Get camera texture from WaveVR Camera Texture as
- Use camera texture to update dynamic material
- Update the camera texture every frame
- Shutdown the camera when the game is going to end.