mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
Excluding EntityShapeVisualizer from Children list
Excluding EntityShapeVisualizer from Children list Now a name is given to the EntityShape of the EntityShapeVisualizer (used to display the zone) so we can now exclude them from the children list when it's time to figure if there are children for an entity. (This is a better approach than excluding al the local entities) The name has been used because it gives better results than trying to use the id map that arrive always too late. The name is unique for a session, it includes a UUID.
This commit is contained in:
parent
00575ae8f8
commit
b633bc4a16
1 changed files with 8 additions and 5 deletions
|
@ -116,12 +116,14 @@ function deepCopy(v) {
|
|||
return JSON.parse(JSON.stringify(v));
|
||||
}
|
||||
|
||||
function EntityShape(entityID) {
|
||||
function EntityShape(entityID, entityShapeVisualizerSessionName) {
|
||||
this.entityID = entityID;
|
||||
this.entityShapeVisualizerSessionName = entityShapeVisualizerSessionName;
|
||||
|
||||
var propertiesForType = getEntityShapePropertiesForType(Entities.getEntityProperties(entityID, REQUESTED_ENTITY_SHAPE_PROPERTIES));
|
||||
|
||||
this.previousPropertiesForType = propertiesForType;
|
||||
|
||||
|
||||
this.initialize(propertiesForType);
|
||||
}
|
||||
|
||||
|
@ -130,6 +132,7 @@ EntityShape.prototype = {
|
|||
// Create new instance of JS object:
|
||||
var overlayProperties = deepCopy(properties);
|
||||
|
||||
overlayProperties.name = this.entityShapeVisualizerSessionName;
|
||||
overlayProperties.localPosition = Vec3.ZERO;
|
||||
overlayProperties.localRotation = Quat.IDENTITY;
|
||||
overlayProperties.canCastShadows = false;
|
||||
|
@ -172,11 +175,11 @@ EntityShape.prototype = {
|
|||
}
|
||||
};
|
||||
|
||||
function EntityShapeVisualizer(visualizedTypes) {
|
||||
function EntityShapeVisualizer(visualizedTypes, entityShapeVisualizerSessionName) {
|
||||
this.acceptedEntities = [];
|
||||
this.ignoredEntities = [];
|
||||
this.entityShapes = {};
|
||||
|
||||
this.entityShapeVisualizerSessionName = entityShapeVisualizerSessionName;
|
||||
this.visualizedTypes = visualizedTypes;
|
||||
}
|
||||
|
||||
|
@ -185,7 +188,7 @@ EntityShapeVisualizer.prototype = {
|
|||
if (this.entityShapes[entityID]) {
|
||||
return;
|
||||
}
|
||||
this.entityShapes[entityID] = new EntityShape(entityID);
|
||||
this.entityShapes[entityID] = new EntityShape(entityID, this.entityShapeVisualizerSessionName);
|
||||
|
||||
},
|
||||
updateEntity: function(entityID) {
|
||||
|
|
Loading…
Reference in a new issue