Type: mp.objLoader
Inputs
Property | Description |
---|---|
url: string default "" |
The url to the fbx file. |
materialUrl: string default `` |
The url to the material file. |
visible: boolean default true |
If true, the model is visible. |
localPosition: { x: number, y: number, z: number } default { x: 0, y: 0, z: 0 } |
The local offset of the model. |
localRotation: { x: number, y: number, z: number } default { x: 0, y: 0, z: 0 } |
The local rotation of model the in euler angles. |
localScale: { x: number, y: number, z: number } default { x: 1, y: 1, z: 1 } |
The local scale of the model. |
colliderEnabled: boolean default true |
When set, the collider output is set to the loaded model. |
Outputs
Property | Description |
---|---|
loadingState: string default "Idle" |
"Idle" - initialized no url is set "Loading" - url set, loading the model "Loaded" - model has been loaded "Error" - there was an error during loading |
objectRoot: Object3D default null |
null - no model loaded {Object3D} - the root of the loaded model. |
collider: Object3D default {objectRoot} |
null - no collider events if colliderEnabled is set to false {objectRoot} - Raycasting will be performed against the loaded model. |
var [ sceneObject ] = await sdk.Scene.createObjects(1);
var node = sceneObject.addNode();
var initial = {
url: "http://test.com/bunny.obj",
visible: true,
localScale: {
x: 1.1, y: 1.1, z: 1.1,
},
localPosition: {
x: 0, y: 0, z: 0.5,
},
};
node.addComponent('mp.objLoader', initial);
node.start();