class FoxModel
package foxlite
extends FoxObject › FoxBasic
extended by FoxFlxSprite, FoxPostProcess, FoxPanoramaSky, FoxInstancedModel
Constructor
Variables
__prevTransform:Matrix3D = new Matrix3D()
This is the object's transform from a previous frame, used for motion vector calculations.
Having to calculate previous transforms on empty objects is a bit pointless, so that's why this is here.
groups:Array<Int> = [0]
The draw groups from a scene this object will be drawn on.
Used mainly to separate meshes in passes in an optimized manner.
Note: When changing this array manually, always set FoxRenderer.mustRebuildDrawGroups to true
to ensure proper updating.
There are dedicated functions for this below:
addToDrawGroup(group)removeFromDrawGroup(group)setDrawGroupAt(i, group)
meshes:Array<FoxMesh> = []
Meshes that will be rendered by this model, they inherit this model transform.
Note: When changing this array manually, always set FoxRenderer.mustRebuildDrawGroups to true
to ensure proper updating.
There are dedicated functions for this below:
setMeshAt(i, mesh)addMesh(mesh)removeMesh(mesh)removeMeshByIndex(mesh)
materialOverride:FoxMaterial = null
If set, this material will be applied to every mesh of this model when rendering.
materialOverlay:FoxMaterial = null
If set, this material will be applied over every mesh of this model.
This will draw the meshes again using this material.
castColoredShadows:Bool = false
If true, this model will cast colored shadows, useful for tinted transluscent objects (stained glass, liquids, fabric).
Requires castShadows to be true.
Note: This is not implemented yet.
Methods
loadJSON(name:String):Null<{meshes:Array<FoxMesh>, materials:Map<String, FoxMaterial>}>
Loads a FoxLite JSON model