ThermionViewerFFI class
Constructors
ThermionViewerFFI ({RenderCallback ? renderCallback , Pointer <Void > ? renderCallbackOwner , required Pointer <Void > resourceLoader , Pointer <Void > ? driver , Pointer <Void > ? sharedContext , String ? uberArchivePath })
This controller uses platform channels to bridge Dart with the C/C++ code for the Filament API.
Setting up the context/texture (since this is platform-specific) and the render ticker are platform-specific; all other methods are passed through by the platform channel to the methods specified in ThermionFlutterApi.h.
Methods
addAnimationComponent (ThermionEntity entity )
→ Future
override
addBoneAnimation (ThermionEntity entity , BoneAnimationData animation , {int skinIndex = 0 , double fadeOutInSecs = 0.0 , double fadeInInSecs = 0.0 , double maxDelta = 1.0 })
→ Future
Currently, scale is not supported.
override
addCollisionComponent (ThermionEntity entity , {void callback (int entityId1 , int entityId2 )?, bool affectsTransform = false })
→ Future
override
addLight (LightType type , double colour , double intensity , double posX , double posY , double posZ , double dirX , double dirY , double dirZ , {double falloffRadius = 1.0 , double spotLightConeInner = pi / 8 , double spotLightConeOuter = pi / 4 , double sunAngularRadius = 0.545 , double sunHaloSize = 10.0 , double sunHaloFallof = 80.0 , bool castShadows = true })
→ Future <ThermionEntity >
override
clearBackgroundImage ()
→ Future
override
clearEntities ()
→ Future
override
clearLights ()
→ Future
override
createGeometry (List <double > vertices , List <int > indices , {String ? materialPath , PrimitiveType primitiveType = PrimitiveType.TRIANGLES })
→ Future <ThermionEntity >
override
createInstance (ThermionEntity entity )
→ Future <ThermionEntity >
override
createRenderTarget (double width , double height , int textureHandle )
→ Future
createSwapChain (double width , double height , {Pointer <Void > ? surface })
→ Future
destroySwapChain ()
→ Future
dispose ()
→ Future
override
getAnimationDuration (ThermionEntity entity , int animationIndex )
→ Future <double >
override
getAnimationDurationByName (ThermionEntity entity , String name )
→ Future <double >
getAnimationNames (ThermionEntity entity )
→ Future <List <String > >
override
getBone (ThermionEntity parent , int boneIndex , {int skinIndex = 0 })
→ Future <ThermionEntity >
override
getBoneNames (ThermionEntity entity , {int skinIndex = 0 })
→ Future <List <String > >
Gets the names of all bones for the armature at skinIndex
under the specified entity
.
override
getCameraCullingFar ()
→ Future <double >
override
getCameraCullingNear ()
→ Future <double >
override
getCameraCullingProjectionMatrix ()
→ Future <Matrix4 >
override
getCameraFrustum ()
→ Future <Frustum >
override
getCameraModelMatrix ()
→ Future <Matrix4 >
override
getCameraPosition ()
→ Future <Vector3 >
override
getCameraProjectionMatrix ()
→ Future <Matrix4 >
I don't think these two methods are accurate - don't rely on them, use the Frustum values instead.
I think because we use setLensProjection
and setScaling
together, this projection matrix doesn't accurately reflect the field of view (because it's using an additional scaling matrix).
Also, the near/far planes never seem to get updated (which is what I would expect to see when calling getCameraCullingProjectionMatrix )
override
getCameraRotation ()
→ Future <Matrix3 >
override
getCameraViewMatrix ()
→ Future <Matrix4 >
override
getChildEntities (ThermionEntity parent , bool renderableOnly )
→ Future <List <ThermionEntity > >
Returns all child entities under parent
.
override
getChildEntity (ThermionEntity parent , String childName )
→ Future <ThermionEntity >
override
getChildEntityNames (ThermionEntity entity , {bool renderableOnly = false })
→ Future <List <String > >
override
getInstanceCount (ThermionEntity entity )
→ Future <int >
override
getInstances (ThermionEntity entity )
→ Future <List <ThermionEntity > >
override
getInverseBindMatrix (ThermionEntity parent , int boneIndex , {int skinIndex = 0 })
→ Future <Matrix4 >
override
getLocalTransform (ThermionEntity entity )
→ Future <Matrix4 >
override
getMainCamera ()
→ Future <ThermionEntity >
Returns the entity associated with the main camera.
override
getMorphTargetNames (ThermionEntity entity , ThermionEntity childEntity )
→ Future <List <String > >
override
getNameForEntity (ThermionEntity entity )
→ String ?
override
getParent (ThermionEntity child )
→ Future <ThermionEntity ? >
override
getWorldTransform (ThermionEntity entity )
→ Future <Matrix4 >
override
hide (ThermionEntity entity , String ? meshName )
→ Future
override
loadGlb (String path , {bool unlit = false , int numInstances = 1 })
→ Future <ThermionEntity >
override
loadGltf (String path , String relativeResourcePath , {bool force = false })
→ Future <ThermionEntity >
override
loadIbl (String lightingPath , {double intensity = 30000 })
→ Future
override
loadSkybox (String skyboxPath )
→ Future
override
moveCameraToAsset (ThermionEntity entity )
→ Future
override
noSuchMethod (Invocation invocation )
→ dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onDispose (Future callback () )
→ void
override
panEnd ()
→ Future
override
panStart (double x , double y )
→ Future
override
panUpdate (double x , double y )
→ Future
override
pick (int x , int y )
→ void
override
playAnimation (ThermionEntity entity , int index , {bool loop = false , bool reverse = false , bool replaceActive = true , double crossfade = 0.0 })
→ Future
override
playAnimationByName (ThermionEntity entity , String name , {bool loop = false , bool reverse = false , bool replaceActive = true , double crossfade = 0.0 , bool wait = false })
→ Future
override
queuePositionUpdate (ThermionEntity entity , double x , double y , double z , {bool relative = false })
→ Future
override
queueRotationUpdate (ThermionEntity entity , double rads , double x , double y , double z , {bool relative = false })
→ Future
override
queueRotationUpdateQuat (ThermionEntity entity , Quaternion rotation , {bool relative = false })
→ Future
Same as queueRotationUpdate .
override
removeAnimationComponent (ThermionEntity entity )
→ Future
override
removeCollisionComponent (ThermionEntity entity )
→ Future
override
removeEntity (ThermionEntity entity )
→ Future
override
removeIbl ()
→ Future
override
removeLight (ThermionEntity entity )
→ Future
override
removeSkybox ()
→ Future
override
render ()
→ Future
override
resetBones (ThermionEntity entity )
→ Future
override
reveal (ThermionEntity entity , String ? meshName )
→ Future
override
rotateEnd ()
→ Future
override
rotateIbl (Matrix3 rotationMatrix )
→ Future
override
rotateStart (double x , double y )
→ Future
override
rotateUpdate (double x , double y )
→ Future
override
setAnimationFrame (ThermionEntity entity , int index , int animationFrame )
→ Future
override
setAntiAliasing (bool msaa , bool fxaa , bool taa )
→ Future
override
setBackgroundColor (double r , double g , double b , double a )
→ Future
override
setBackgroundImage (String path , {bool fillHeight = false })
→ Future
override
setBackgroundImagePosition (double x , double y , {bool clamp = false })
→ Future
override
setBloom (double bloom )
→ Future
override
setBoneTransform (ThermionEntity entity , int boneIndex , Matrix4 transform , {int skinIndex = 0 })
→ Future
override
setCamera (ThermionEntity entity , String ? name )
→ Future
override
setCameraCulling (double near , double far )
→ Future
override
setCameraExposure (double aperture , double shutterSpeed , double sensitivity )
→ Future
override
setCameraFocalLength (double focalLength )
→ Future
override
setCameraFocusDistance (double focusDistance )
→ Future
override
setCameraFov (double degrees , double width , double height )
→ Future
override
setCameraManipulatorOptions ({ManipulatorMode ? mode , double orbitSpeedX = 0.01 , double orbitSpeedY = 0.01 , double zoomSpeed = 0.01 })
→ Future
override
setCameraModelMatrix (List <double > matrix )
→ Future
override
setCameraPosition (double x , double y , double z )
→ Future
override
setCameraRotation (Quaternion quaternion )
→ Future
override
setFrameRate (int framerate )
→ Future
override
setMainCamera ()
→ Future
override
setMaterialColor (ThermionEntity entity , String meshName , int materialIndex , double r , double g , double b , double a )
→ Future
override
setMorphAnimationData (ThermionEntity entity , MorphAnimationData animation , {List <String > ? targetMeshNames })
→ Future
override
setMorphTargetWeights (ThermionEntity entity , List <double > weights )
→ Future
override
setParent (ThermionEntity child , ThermionEntity parent )
→ Future
override
setPosition (ThermionEntity entity , double x , double y , double z )
→ Future
override
setPostProcessing (bool enabled )
→ Future
override
setPriority (ThermionEntity entityId , int priority )
→ Future
override
setRecording (bool recording )
→ Future
override
setRecordingOutputDirectory (String outputDir )
→ Future
override
setRendering (bool render )
→ Future
override
setRotation (ThermionEntity entity , double rads , double x , double y , double z )
→ Future
override
setRotationQuat (ThermionEntity entity , Quaternion rotation , {bool relative = false })
→ Future
override
setScale (ThermionEntity entity , double scale )
→ Future
override
setShadowsEnabled (bool enabled )
→ Future
override
setShadowType (ShadowType shadowType )
→ Future
override
setSoftShadowOptions (double penumbraScale , double penumbraRatioScale )
→ Future
override
setToneMapping (ToneMapper mapper )
→ Future
override
setTransform (ThermionEntity entity , Matrix4 transform )
→ Future
override
setViewFrustumCulling (bool enabled )
→ Future
override
stopAnimation (ThermionEntity entity , int animationIndex )
→ Future
override
stopAnimationByName (ThermionEntity entity , String name )
→ Future
override
testCollisions (ThermionEntity entity )
→ Future
override
toString ()
→ String
A string representation of this object.
inherited
transformToUnitCube (ThermionEntity entity )
→ Future
override
updateBoneMatrices (ThermionEntity entity )
→ Future
override
updateViewportAndCameraProjection (double width , double height )
→ Future
zoomBegin ()
→ Future
override
zoomEnd ()
→ Future
override
zoomUpdate (double x , double y , double z )
→ Future
override