Class: AxMaterial

AxMaterial(context)

new AxMaterial(context)

Creates a new material
Parameters:
Name Type Description
context Axis The context to use for the material
Source:

Methods

AddShadingLayer(shadingOp, colorOp) → {Integer}

Adds a shading layer to the material
Parameters:
Name Type Description
shadingOp AxShadingOperation The shading operation to insert
colorOp AxColorOperation The color operation to use with the shading operation
Source:
Returns:
The index at which the added shading layer can be found. Practically, this is the last index in the material's shading layers collection
Type
Integer

ApplyBones()

Sets the context's current bone transformations to the material's shader
Source:

ApplyLights(location)

If the material has light sources, sets them, choosing from the lights in the scene, which are closest to the given location The location should generally be the place where the object rendered with this material is located in the scene
Parameters:
Name Type Description
location AxVector3 Location in relation to which to select the closest lights in the scene
Source:

ApplyProperties()

Applies all material property values to the shader
Source:

ApplyProperty(materialProperty, shaderAddress)

Applies a material property's value to the shader
Parameters:
Name Type Description
materialProperty AxProperty The prperty, whose value is to be applied to the shader
shaderAddress Integer The address of the property in terms of the material's shader
Source:

ClearShadingLayers()

Removes all shading layers from the material
Source:

CommitRenderStates()

Applies the material's render states
Source:

Deserialize(source) → {Boolean}

Deserializes the material from a given stream
Parameters:
Name Type Description
source AxStream The stream holding the serialized data
Source:
Returns:
True if the deserialization was successfull
Type
Boolean

DeserializeChunk(reader) → {Boolean}

Reads the data of a chunk. The chunk header is already read by the reader and this method deserializes the contents of the chunk. Called continuously for each of the mesh's chunks
Parameters:
Name Type Description
reader AxHierarchyStreamReader Reader to use for reading the serialized data.
Source:
Returns:
True if a chunk was successfully deserialized
Type
Boolean

InsertShadingLayer(shadingOp, colorOp, index)

Inserts a shading layer at a given position
Parameters:
Name Type Description
shadingOp AxShadingOperation The shading operation to insert
colorOp AxColorOperation The color operation to use with the shading operation
index Integer The index at which to insert the shading operation
Source:

MoveShadingLayer(originalIndex, newIndex)

Moves a shading layer from one position to another in the material's shading layers collection
Parameters:
Name Type Description
originalIndex Integer The original index of the shading layer which is to be moved
newIndex Integer The index to which the shading layer should be moved to
Source:

RemoveShadingLayer(index)

Removes a shading layer at specified location
Parameters:
Name Type Description
index Integer The index of the shading layer to remove
Source:

SerializeChunks(writer)

Writes chunks for all the data which is needed to serialize the material.
Parameters:
Name Type Description
writer AxHierarchyStreamWriter Writer to use for writing the serialization data
Source:

UpdateShader() → {Boolean}

Updates the material shader according to the material's shading layers
Source:
Returns:
True if the shader was successfully updated
Type
Boolean

Documentation generated by JSDoc 3.5.3 on Wed Jan 17 2018 17:06:57 GMT+0200 (FLE Standard Time)