Mesh instance is not needed in mesh.
This commit is contained in:
parent
6f9801010b
commit
c1e3a33107
@ -19,19 +19,13 @@ OV.MeshInstanceId = class
|
||||
|
||||
OV.MeshInstance = class extends OV.Object3D
|
||||
{
|
||||
constructor (id, node, mesh)
|
||||
constructor (node, mesh)
|
||||
{
|
||||
super ();
|
||||
this.id = id;
|
||||
this.node = node;
|
||||
this.mesh = mesh;
|
||||
}
|
||||
|
||||
GetId ()
|
||||
{
|
||||
return this.id;
|
||||
}
|
||||
|
||||
VertexCount ()
|
||||
{
|
||||
return this.mesh.VertexCount ();
|
||||
|
||||
@ -121,8 +121,7 @@ OV.Model = class extends OV.ModelObject3D
|
||||
this.root.Enumerate ((node) => {
|
||||
for (let meshIndex of node.GetMeshIndices ()) {
|
||||
let mesh = this.GetMesh (meshIndex);
|
||||
let instanceId = new OV.MeshInstanceId (node.GetId (), meshIndex);
|
||||
let meshInstance = new OV.MeshInstance (instanceId, node, mesh);
|
||||
let meshInstance = new OV.MeshInstance (node, mesh);
|
||||
onMeshInstance (meshInstance);
|
||||
}
|
||||
});
|
||||
|
||||
@ -91,7 +91,7 @@ describe ('Model Utils', function () {
|
||||
let transformation = new OV.Transformation (new OV.Matrix ().CreateTranslation (2.0, 0.0, 0.0));
|
||||
let node = new OV.Node ();
|
||||
node.SetTransformation (transformation);
|
||||
let cubeInstance = new OV.MeshInstance (new OV.MeshInstanceId (-1, -1), node, cube);
|
||||
let cubeInstance = new OV.MeshInstance (node, cube);
|
||||
let cubeInstanceBounds = OV.GetBoundingBox (cubeInstance);
|
||||
assert (OV.CoordIsEqual3D (cubeInstanceBounds.min, new OV.Coord3D (2.0, 0.0, 0.0)));
|
||||
assert (OV.CoordIsEqual3D (cubeInstanceBounds.max, new OV.Coord3D (3.0, 1.0, 1.0)));
|
||||
|
||||
@ -92,7 +92,7 @@ describe ('Quantities', function () {
|
||||
const transformation = new OV.Transformation (new OV.Matrix ().CreateScale (2.0, 2.0, 2.0));
|
||||
let node = new OV.Node ();
|
||||
node.SetTransformation (transformation);
|
||||
const meshInstance = new OV.MeshInstance (new OV.MeshInstanceId (-1, -1), node, mesh);
|
||||
const meshInstance = new OV.MeshInstance (node, mesh);
|
||||
assert (OV.IsEqual (OV.CalculateVolume (meshInstance), 8.0));
|
||||
assert (OV.IsEqual (OV.CalculateSurfaceArea (meshInstance), 24.0));
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user