mirror of
https://github.com/openglobus/openglobus.git
synced 2025-12-08 19:25:27 +00:00
938 fixed.2
This commit is contained in:
parent
b43f70b4ab
commit
45ce13b069
@ -13,8 +13,8 @@ import {
|
||||
let renderer = new Renderer("frame", {
|
||||
msaa: 8,
|
||||
controls: [
|
||||
new control.SimpleNavigation({speed: 0.01}),
|
||||
// new control.GeoObjectEditor()
|
||||
new control.SimpleNavigation({ speed: 0.01 }),
|
||||
new control.GeoObjectEditor()
|
||||
],
|
||||
autoActivate: true
|
||||
});
|
||||
@ -76,6 +76,19 @@ class MyScene extends RenderNode {
|
||||
}
|
||||
});
|
||||
|
||||
let childEntity2 = new Entity({
|
||||
cartesian: new Vec3(0, 1, 0),
|
||||
independentPicking: true,
|
||||
relativePosition: true,
|
||||
yaw: 90 * Math.PI / 180,
|
||||
geoObject: {
|
||||
color: "rgb(255,255,255)",
|
||||
instanced: true,
|
||||
tag: `frustumObj`,
|
||||
object3d: frustumObj,
|
||||
}
|
||||
});
|
||||
|
||||
let childChildEntity = new Entity({
|
||||
cartesian: new Vec3(0, 3, -1),
|
||||
independentPicking: true,
|
||||
@ -88,8 +101,22 @@ class MyScene extends RenderNode {
|
||||
}
|
||||
});
|
||||
|
||||
let childChildEntity2 = new Entity({
|
||||
cartesian: new Vec3(0, 3, -1),
|
||||
independentPicking: true,
|
||||
relativePosition: true,
|
||||
geoObject: {
|
||||
color: "rgb(90,90,90)",
|
||||
instanced: true,
|
||||
tag: `cylinderObj`,
|
||||
object3d: cylinderObj,
|
||||
}
|
||||
});
|
||||
|
||||
childEntity.appendChild(childChildEntity);
|
||||
childEntity2.appendChild(childChildEntity2);
|
||||
parentEntity.appendChild(childEntity);
|
||||
parentEntity.appendChild(childEntity2);
|
||||
|
||||
let collection = new EntityCollection({
|
||||
entities: [parentEntity]
|
||||
|
||||
@ -496,7 +496,16 @@ class EntityCollection {
|
||||
*/
|
||||
public removeEntity(entity: Entity) {
|
||||
if (this.belongs(entity)) {
|
||||
if (!entity.parent) {
|
||||
|
||||
if (entity.parent) {
|
||||
let arr = entity.parent.childEntities;
|
||||
for (let i = 0, len = arr.length; i < len; i++) {
|
||||
if (arr[i].isEqual(entity)) {
|
||||
arr.splice(i, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this._entities.splice(entity._entityCollectionIndex, 1);
|
||||
this.reindexEntitiesArray(entity._entityCollectionIndex);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user