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 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
)
int
int
void
destroyImpressNode(int impressNode)
int
getImpressNodeParent(int impressNode)

Returns the parent impress node for the given impress node.

@NonNull List<Integer>
getImpressNodesForToken(long modelToken)

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

@NonNull Map<IntegerFakeImpressApi.StereoSurfaceEntityData>
@NonNull Surface
getSurfaceFromStereoSurface(int panelImpressNode)
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 modelToken)
int
instanceGltfModel(long modelToken, boolean enableCollider)
@NonNull ListenableFuture<Long>
void
void
void
releaseGltfModel(long modelToken)
void
setGltfModelColliderEnabled(int impressNode, boolean enableCollider)
void
setImpressNodeParent(int impressNodeChild, int impressNodeParent)
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-alpha02
public FakeImpressApi()

Public methods

animateGltfModel

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

createImpressNode

Added in 1.0.0-alpha02
public int createImpressNode()

createStereoSurface

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

destroyImpressNode

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

getImpressNodeParent

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

Returns the parent impress node for the given impress node.

getImpressNodesForToken

Added in 1.0.0-alpha02
public @NonNull List<IntegergetImpressNodesForToken(long modelToken)

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

getSurfaceFromStereoSurface

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

impressNodeAnimatingSize

Added in 1.0.0-alpha02
public int impressNodeAnimatingSize()

Returns the number of impress nodes that are currently animating.

impressNodeHasParent

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

Returns true if the given impress node has a parent.

impressNodeLoopAnimatingSize

Added in 1.0.0-alpha02
public int impressNodeLoopAnimatingSize()

Returns the number of impress nodes that looping animations.

instanceGltfModel

Added in 1.0.0-alpha02
public int instanceGltfModel(long modelToken)

instanceGltfModel

Added in 1.0.0-alpha02
public int instanceGltfModel(long modelToken, boolean enableCollider)

loadGltfModel

Added in 1.0.0-alpha02
public @NonNull ListenableFuture<LongloadGltfModel(@NonNull String name)

onPause

Added in 1.0.0-alpha02
public void onPause()

onResume

Added in 1.0.0-alpha02
public void onResume()

releaseGltfModel

Added in 1.0.0-alpha02
public void releaseGltfModel(long modelToken)

setGltfModelColliderEnabled

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

setImpressNodeParent

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

setStereoModeForStereoSurface

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

setStereoSurfaceEntityCanvasShapeHemisphere

Added in 1.0.0-alpha02
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-alpha02
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-alpha02
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-alpha02
public void setup(@NonNull View view)

stopGltfModelAnimation

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