Class ThreeMeshWrapper
java.lang.Object
nl.colorize.multimedialib.renderer.teavm.ThreeMeshWrapper
- All Implemented Interfaces:
Mesh,StageNode3D
Wrapper around a Three.js Mesh/Object3D instance in JavaScript, since that
cannot implement
Mesh directly. If the model is being loaded
asynchronously, instances of this class can be used even when the model
is still loading.-
Constructor Summary
ConstructorsConstructorDescriptionThreeMeshWrapper(nl.colorize.util.Subject<ThreeBridge.ThreeObject> meshPromise) -
Method Summary
Modifier and TypeMethodDescriptionvoidCalled by the renderer at the end of frame updates, while rendering the stage.voidapplyColor(ColorRGB color) voidapplyDynamicTexture(Sprite sprite) voidapplyTexture(Image texture) copy()Creates a copy of this mesh, which will use the same geometry, materials, textures, and animations as this mesh.If this mesh is currently using a dynamic texture, returns the sprite that is used as its source.Returns this node's global transform, which is interpreted relative to the stage.nl.colorize.util.Subject<ThreeBridge.ThreeObject> Returns this node's local transform, which is interpreted relative to its parent node.
-
Constructor Details
-
ThreeMeshWrapper
-
-
Method Details
-
animate
Description copied from interface:StageNode3DCalled by the renderer at the end of frame updates, while rendering the stage.animationTimercontains the elapsed time since the currently active scene was started. This allows animations to display correctly, without the need to update every single node during each frame update.- Specified by:
animatein interfaceStageNode3D
-
applyColor
- Specified by:
applyColorin interfaceMesh
-
applyTexture
- Specified by:
applyTexturein interfaceMesh
-
applyDynamicTexture
- Specified by:
applyDynamicTexturein interfaceMesh
-
copy
Description copied from interface:MeshCreates a copy of this mesh, which will use the same geometry, materials, textures, and animations as this mesh. The copy is not yet added to the stage. -
getMeshPromise
-
getThreeObject
-
getTransform
Description copied from interface:StageNode3DReturns this node's local transform, which is interpreted relative to its parent node. The local transform can be modified by application code to modify how and where the node is displayed.- Specified by:
getTransformin interfaceStageNode3D
-
getGlobalTransform
Description copied from interface:StageNode3DReturns this node's global transform, which is interpreted relative to the stage. The global transform is updated by the renderer when drawing the stage at the end of frame updates. Recalculating the global transform is relatively expensive, and is therefore only done once per frame. This means that any changes made to a node's local transform since the last frame update may not yet been reflected in the current state of its global transform.- Specified by:
getGlobalTransformin interfaceStageNode3D
-
getDynamicTexture
Description copied from interface:MeshIf this mesh is currently using a dynamic texture, returns the sprite that is used as its source. Returnsnullif this mesh is not using a dynamic texture.- Specified by:
getDynamicTexturein interfaceMesh
-