Add a 3D mesh. A mesh can be in Collada (dae), Wavefront (obj), or Three.js (js) formats.
string, ( r )
The scriptable name for this molecule. This name can be set using rename function dynamically.
object, ( r )
Returns this mesh’s animation and audio tracks. (see tracks.Comments.)
getUV(point, face, index);
Given a point in space and the mesh’s face where the point lies, this function returns the UV coordinate of the indexed UV set.
point | (object) a point in space. (e.g as returned by Camera Molecule.rayCastSelect.) |
face | (object) a face on the mesh. (e.g as returned by Camera Molecule.rayCastSelect.) |
index | (int) index of a UV coordinate set. Default to 0. |
N/A
setMaterialName(name, submesh_index);
Sets the material of this mesh.
name | (string) an unique name of the material. (e.g. ‘materialName’, ‘materialMoleculeName.materialName’, ‘dropletName.materialMoleculeName.materialName’, or ‘app.dropletName.materialMoleculeName.materialName’). |
submesh_index | (int) optional. If this mesh is made of multiple sub-meshes each with different material. You can set each sub-mesh’s material by its index. |
N/A
setDepthMaterialName(name, submesh_index);
Sets the depth material of this mesh.
name | (string) an unique name of the material. (e.g. ‘materialName’, ‘materialMoleculeName.materialName’, ‘dropletName.materialMoleculeName.materialName’, or ‘app.dropletName.materialMoleculeName.materialName’). |
submesh_index | (int) optional. If this mesh is made of multiple sub-meshes each with different material. You can set each sub-mesh’s material by its index. |
N/A
play(start_time, end_time, toLoop); play(toLoop, period);
Play all animation tracks of this mesh between start_time and end_time.
start_time | (int) Optional. Start time in msec. Default is 0. |
end_time | (int) Optional. End time in msec. Default to the total length of animation. |
toLoop | (bool) Optional. Set to true to repeat the animation indefinitely. Default to false. |
period | (int) Optional. If toLoop is true, repeat the track segment of length given by this value. |
N/A
shatterBake(fragment_count, callback); shatterBake(fragment_count, force_direction, center_offset, entry_diameter, exit_diameter, callback);
Initiate the baking process for generating Voronoi fragments in a worker thread.
fragment_count | (int) the number of fragments to be generated. |
force_direction | (object) the direction of impact force in Vector3. |
center_offset | (object) the offset of the impact point from the mesh’s geometric center. |
entry_diameter | (int) the size of the entry point. |
exit_diameter | (int) the size of the exit point. |
callback | (function) a function for receiving the notification of process completion. |
N/A