Editor.Components.BarycentricVertex
ClassSettings used with Editor.Components.Head to set position on the face.
Index
Example
const model = this.pluginSystem.findInterface(Editor.Model.IModel) as Editor.Model.IModel;
const scene = model.project.scene;
// Create a Head component and access its barycentric vertex
const obj = scene.createSceneObject('BarycentricTest');
const head = obj.addComponent('Head');
// Set barycentric coordinates for the attachment position
const vertex = new Editor.Components.BarycentricVertex();
vertex.indices = [0, 1, 2];
vertex.weights = [0.33, 0.33, 0.34];
head.attachedBarycentricVertex = vertex;
console.log('indices:', head.attachedBarycentricVertex.indices);
console.log('weights:', head.attachedBarycentricVertex.weights);
Constructors
Constructor
new BarycentricVertex():
BarycentricVertex
Create a new barycentric vertex.
Returns
BarycentricVertex
Properties
indices
indices:
number[]
Indices of the three vertices forming the barycentric coordinate triangle.
weights
weights:
number[]
Barycentric weights (u, v, w) determining position within the triangle.