Constructor
Variables
Methods
Inherited Variables
Defined by FoxModel
@:value(new Matrix3D())__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.
@:value([0])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)
@:value([])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)
@:value(null)materialOverride:FoxMaterial = null
If set, this material will be applied to every mesh of this model when rendering.
@:value(null)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.
@:value(null)skin:FoxSkinData = null
The skin associated with this mesh, assigned when added to a FoxArmature
@:value(false)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.
Defined by FoxObject
parent:FoxObject
If set, will adapt parent transform. Make sure the parent has a higher priority so it updates in order
@:value(new Matrix3D())transform:Matrix3D = new Matrix3D()
This is the global transform for this Object, it encodes position, rotation and scale in a 4x4 matrix
Defined by FoxBasic
animation:FoxAnimationPlayer
An animation controller for this basic. Although properties have to be manually linked, this is intended to be a general-purpose animator for this object
Inherited Methods
Defined by FoxModel
loadJSON(name:String):Null<{meshes:Array<FoxMesh>, materials:Map<String, FoxMaterial>}>
Loads a FoxLite JSON model
loadOBJ(name:String, ?extraShaderFlags:Array<String>, ?customShaderPath:String):Null<{meshes:Array<FoxMesh>, materials:Map<String, FoxMaterial>}>
Defined by FoxObject
@:value({ z : 0, y : 0, x : 0 })inlinesetAngle(x:Float = 0, y:Float = 0, z:Float = 0):Void
Same as setRotation() but for angle degrees.
getAngle(?output:Vector3D):Vector3D
Gets the object's rotation as degrees, as a Vector3D
Parameters:
output | (Optional) the output vector to store the angles without allocating a new one |
|---|
Returns:
a Vector3D containing angleX, angleY and angleZ
@:value({ w : 1, z : 0, y : 0, x : 0 })setRotationQuaternion(x:Float = 0, y:Float = 0, z:Float = 0, w:Float = 1):Vector3D
Sets the object's rotation from a Quaternion, which is needed for accurate rotation representation when interpolating.
How dows it work? hell if i know
copyComponentsFrom(object:FoxObject):Void
Copies position, rotation and scale from another FoxObject,
so the other object's components doesn't affect this one when changing them