public class FakeImpressApi implements ImpressApi


Fake implementation of the JNI API for communicating with the Impress Split Engine instance for testing purposes.

Summary

Nested types

Test bookkeeping data for a Gltf gltfToken

Test bookkeeping data for a Material

Enum representing the different built-in material types that can be created.

Test bookkeeping data for a StereoSurfaceEntity

Enum representing the different canvas shapes that can be created.

public class FakeImpressApi.TestSurface extends Surface

Test bookkeeping data for a Android Surface

Public constructors

Public methods

@NonNull ListenableFuture<Void>
animateGltfModel(
    int impressNode,
    @Nullable String animationName,
    boolean loop
)
@NonNull Texture
void
int
int
@NonNull ListenableFuture<WaterMaterial>
createWaterMaterial(boolean isAlphaMapVersion)
void
destroyImpressNode(int impressNode)
void
destroyNativeObject(long nativeHandle)
void
long

Returns the current environment light token.

@NonNull Map<LongList<Integer>>
@NonNull List<Long>
int
getImpressNodeParent(int impressNode)

Returns the parent impress node for the given impress node.

@NonNull Map<FakeImpressApi.GltfNodeDataFakeImpressApi.GltfNodeData>

Returns the map of impress nodes to their parent impress nodes.

@NonNull List<Integer>
getImpressNodesForToken(long gltfToken)

Gets the impress nodes for glTF models that match the given token.

@NonNull Map<LongFakeImpressApi.MaterialData>

Returns the map of material tokens to their associated MaterialData object.

@NonNull Texture
@NonNull Map<IntegerFakeImpressApi.StereoSurfaceEntityData>
@NonNull Surface
getSurfaceFromStereoSurface(int panelImpressNode)
@NonNull Map<LongTexture>

Returns the map of texture image tokens to their associated Texture object.

int

Returns the number of impress nodes that are currently animating.

boolean
impressNodeHasParent(int impressNode)

Returns true if the given impress node has a parent.

int

Returns the number of impress nodes that looping animations.

int
instanceGltfModel(long gltfToken)
int
instanceGltfModel(long gltfToken, boolean enableCollider)
@NonNull ListenableFuture<Long>
@NonNull ListenableFuture<Long>
loadGltfAsset(@NonNull byte[] data, @NonNull String key)
@NonNull ListenableFuture<Long>
@NonNull ListenableFuture<Long>
@NonNull ListenableFuture<Texture>
void
void
void
releaseGltfAsset(long gltfToken)
void
void
setAlphaMapOnWaterMaterial(long nativeWaterMaterial, long alphaMap)
void
setAlphaStepMultiplierOnWaterMaterial(
    long nativeMaterial,
    float alphaStepMultiplier
)
void
setAlphaStepUOnWaterMaterial(
    long nativeWaterMaterial,
    float x,
    float y,
    float z,
    float w
)
void
setAlphaStepVOnWaterMaterial(
    long nativeWaterMaterial,
    float x,
    float y,
    float z,
    float w
)
void
setAuxiliaryAlphaMaskForStereoSurface(int impressNode, long alphaMask)
void
setFeatherRadiusForStereoSurface(
    int panelImpressNode,
    float radiusX,
    float radiusY
)
void
setGltfModelColliderEnabled(int impressNode, boolean enableCollider)
void
setImpressNodeParent(int impressNodeChild, int impressNodeParent)
void
setMaterialOverride(
    int impressNode,
    long nativeMaterial,
    @NonNull String meshName
)
void
setNormalBoundaryOnWaterMaterial(
    long nativeWaterMaterial,
    float normalBoundary
)
void
setNormalMapOnWaterMaterial(long nativeMaterial, long normalMap)
void
setNormalSpeedOnWaterMaterial(long nativeMaterial, float normalSpeed)
void
setNormalTilingOnWaterMaterial(long nativeMaterial, float normalTiling)
void
setNormalZOnWaterMaterial(long nativeWaterMaterial, float normalZ)
void
void
setPrimaryAlphaMaskForStereoSurface(int impressNode, long alphaMask)
void
setReflectionCubeOnWaterMaterial(
    long nativeMaterial,
    long reflectionCube
)
void
setStereoModeForStereoSurface(
    int panelImpressNode,
    @ImpressApi.StereoMode int mode
)
void
setStereoSurfaceEntityCanvasShapeHemisphere(
    int impressNode,
    float radius
)

This method sets the canvas shape of a StereoSurfaceEntity using its Impress ID.

void
setStereoSurfaceEntityCanvasShapeQuad(
    int impressNode,
    float width,
    float height
)

This method sets the canvas shape of a StereoSurfaceEntity using its Impress ID.

void
setStereoSurfaceEntityCanvasShapeSphere(int impressNode, float radius)

This method sets the canvas shape of a StereoSurfaceEntity using its Impress ID.

void
void
stopGltfModelAnimation(int impressNode)

Public constructors

FakeImpressApi

Added in 1.0.0-alpha04
public FakeImpressApi()

Public methods

animateGltfModel

Added in 1.0.0-alpha04
public @NonNull ListenableFuture<VoidanimateGltfModel(
    int impressNode,
    @Nullable String animationName,
    boolean loop
)

borrowReflectionTexture

Added in 1.0.0-alpha04
public @NonNull Texture borrowReflectionTexture()

clearPreferredEnvironmentIblAsset

Added in 1.0.0-alpha04
public void clearPreferredEnvironmentIblAsset()

createImpressNode

Added in 1.0.0-alpha04
public int createImpressNode()

createStereoSurface

Added in 1.0.0-alpha04
public int createStereoSurface(@ImpressApi.StereoMode int stereoMode)

createWaterMaterial

Added in 1.0.0-alpha04
public @NonNull ListenableFuture<WaterMaterialcreateWaterMaterial(boolean isAlphaMapVersion)

destroyImpressNode

Added in 1.0.0-alpha04
public void destroyImpressNode(int impressNode)

destroyNativeObject

Added in 1.0.0-alpha04
public void destroyNativeObject(long nativeHandle)

disposeAllResources

Added in 1.0.0-alpha04
public void disposeAllResources()

getCurrentEnvironmentLight

Added in 1.0.0-alpha04
public long getCurrentEnvironmentLight()

Returns the current environment light token.

getGltfModels

Added in 1.0.0-alpha04
public @NonNull Map<LongList<Integer>> getGltfModels()

getImageBasedLightingAssets

Added in 1.0.0-alpha04
public @NonNull List<LonggetImageBasedLightingAssets()

getImpressNodeParent

Added in 1.0.0-alpha04
public int getImpressNodeParent(int impressNode)

Returns the parent impress node for the given impress node.

getImpressNodes

Added in 1.0.0-alpha04
public @NonNull Map<FakeImpressApi.GltfNodeDataFakeImpressApi.GltfNodeDatagetImpressNodes()

Returns the map of impress nodes to their parent impress nodes.

getImpressNodesForToken

Added in 1.0.0-alpha04
public @NonNull List<IntegergetImpressNodesForToken(long gltfToken)

Gets the impress nodes for glTF models that match the given token.

getMaterials

Added in 1.0.0-alpha04
public @NonNull Map<LongFakeImpressApi.MaterialDatagetMaterials()

Returns the map of material tokens to their associated MaterialData object.

getReflectionTextureFromIbl

Added in 1.0.0-alpha04
public @NonNull Texture getReflectionTextureFromIbl(long iblToken)

getSurfaceFromStereoSurface

Added in 1.0.0-alpha04
public @NonNull Surface getSurfaceFromStereoSurface(int panelImpressNode)

getTextureImages

Added in 1.0.0-alpha04
public @NonNull Map<LongTexturegetTextureImages()

Returns the map of texture image tokens to their associated Texture object.

impressNodeAnimatingSize

Added in 1.0.0-alpha04
public int impressNodeAnimatingSize()

Returns the number of impress nodes that are currently animating.

impressNodeHasParent

Added in 1.0.0-alpha04
public boolean impressNodeHasParent(int impressNode)

Returns true if the given impress node has a parent.

impressNodeLoopAnimatingSize

Added in 1.0.0-alpha04
public int impressNodeLoopAnimatingSize()

Returns the number of impress nodes that looping animations.

instanceGltfModel

Added in 1.0.0-alpha04
public int instanceGltfModel(long gltfToken)

instanceGltfModel

Added in 1.0.0-alpha04
public int instanceGltfModel(long gltfToken, boolean enableCollider)

loadGltfAsset

Added in 1.0.0-alpha04
public @NonNull ListenableFuture<LongloadGltfAsset(@NonNull String path)

loadGltfAsset

Added in 1.0.0-alpha04
public @NonNull ListenableFuture<LongloadGltfAsset(@NonNull byte[] data, @NonNull String key)

loadImageBasedLightingAsset

Added in 1.0.0-alpha04
public @NonNull ListenableFuture<LongloadImageBasedLightingAsset(@NonNull String path)

loadImageBasedLightingAsset

Added in 1.0.0-alpha04
public @NonNull ListenableFuture<LongloadImageBasedLightingAsset(@NonNull byte[] data, @NonNull String key)

loadTexture

Added in 1.0.0-alpha04
public @NonNull ListenableFuture<TextureloadTexture(@NonNull String path, @NonNull TextureSampler sampler)

onPause

Added in 1.0.0-alpha04
public void onPause()

onResume

Added in 1.0.0-alpha04
public void onResume()

releaseGltfAsset

Added in 1.0.0-alpha04
public void releaseGltfAsset(long gltfToken)

releaseImageBasedLightingAsset

Added in 1.0.0-alpha04
public void releaseImageBasedLightingAsset(long iblToken)

setAlphaMapOnWaterMaterial

Added in 1.0.0-alpha04
public void setAlphaMapOnWaterMaterial(long nativeWaterMaterial, long alphaMap)

setAlphaStepMultiplierOnWaterMaterial

Added in 1.0.0-alpha04
public void setAlphaStepMultiplierOnWaterMaterial(
    long nativeMaterial,
    float alphaStepMultiplier
)

setAlphaStepUOnWaterMaterial

Added in 1.0.0-alpha04
public void setAlphaStepUOnWaterMaterial(
    long nativeWaterMaterial,
    float x,
    float y,
    float z,
    float w
)

setAlphaStepVOnWaterMaterial

Added in 1.0.0-alpha04
public void setAlphaStepVOnWaterMaterial(
    long nativeWaterMaterial,
    float x,
    float y,
    float z,
    float w
)

setAuxiliaryAlphaMaskForStereoSurface

Added in 1.0.0-alpha04
public void setAuxiliaryAlphaMaskForStereoSurface(int impressNode, long alphaMask)

setFeatherRadiusForStereoSurface

Added in 1.0.0-alpha04
public void setFeatherRadiusForStereoSurface(
    int panelImpressNode,
    float radiusX,
    float radiusY
)

setGltfModelColliderEnabled

Added in 1.0.0-alpha04
public void setGltfModelColliderEnabled(int impressNode, boolean enableCollider)

setImpressNodeParent

Added in 1.0.0-alpha04
public void setImpressNodeParent(int impressNodeChild, int impressNodeParent)

setMaterialOverride

Added in 1.0.0-alpha04
public void setMaterialOverride(
    int impressNode,
    long nativeMaterial,
    @NonNull String meshName
)

setNormalBoundaryOnWaterMaterial

Added in 1.0.0-alpha04
public void setNormalBoundaryOnWaterMaterial(
    long nativeWaterMaterial,
    float normalBoundary
)

setNormalMapOnWaterMaterial

Added in 1.0.0-alpha04
public void setNormalMapOnWaterMaterial(long nativeMaterial, long normalMap)

setNormalSpeedOnWaterMaterial

Added in 1.0.0-alpha04
public void setNormalSpeedOnWaterMaterial(long nativeMaterial, float normalSpeed)

setNormalTilingOnWaterMaterial

Added in 1.0.0-alpha04
public void setNormalTilingOnWaterMaterial(long nativeMaterial, float normalTiling)

setNormalZOnWaterMaterial

Added in 1.0.0-alpha04
public void setNormalZOnWaterMaterial(long nativeWaterMaterial, float normalZ)

setPreferredEnvironmentLight

Added in 1.0.0-alpha04
public void setPreferredEnvironmentLight(long iblToken)

setPrimaryAlphaMaskForStereoSurface

Added in 1.0.0-alpha04
public void setPrimaryAlphaMaskForStereoSurface(int impressNode, long alphaMask)

setReflectionCubeOnWaterMaterial

Added in 1.0.0-alpha04
public void setReflectionCubeOnWaterMaterial(
    long nativeMaterial,
    long reflectionCube
)

setStereoModeForStereoSurface

Added in 1.0.0-alpha04
public void setStereoModeForStereoSurface(
    int panelImpressNode,
    @ImpressApi.StereoMode int mode
)

setStereoSurfaceEntityCanvasShapeHemisphere

Added in 1.0.0-alpha04
public void setStereoSurfaceEntityCanvasShapeHemisphere(
    int impressNode,
    float radius
)

This method sets the canvas shape of a StereoSurfaceEntity using its Impress ID.

Parameters
int impressNode

The Impress node which hosts the StereoSurfaceEntity to be updated.

float radius

The radius in local spatial units of the hemisphere.

setStereoSurfaceEntityCanvasShapeQuad

Added in 1.0.0-alpha04
public void setStereoSurfaceEntityCanvasShapeQuad(
    int impressNode,
    float width,
    float height
)

This method sets the canvas shape of a StereoSurfaceEntity using its Impress ID.

Parameters
int impressNode

The Impress node which hosts the StereoSurfaceEntity to be updated.

float width

The width in local spatial units to set the quad to.

float height

The height in local spatial units to set the quad to.

setStereoSurfaceEntityCanvasShapeSphere

Added in 1.0.0-alpha04
public void setStereoSurfaceEntityCanvasShapeSphere(int impressNode, float radius)

This method sets the canvas shape of a StereoSurfaceEntity using its Impress ID.

Parameters
int impressNode

The Impress node which hosts the StereoSurfaceEntity to be updated.

float radius

The radius in local spatial units to set the sphere to.

setup

Added in 1.0.0-alpha04
public void setup(@NonNull View view)

stopGltfModelAnimation

Added in 1.0.0-alpha04
public void stopGltfModelAnimation(int impressNode)