overte-org / overte

Overte open source virtual worlds platform.
https://overte.org/
Other
132 stars 48 forks source link

Getting "type" property gets all properties instead of just type #767

Closed ksuprynowicz closed 6 months ago

ksuprynowicz commented 7 months ago

Example interface script:

var entityID = Entities.addEntity({
    type: "Box",
    position: Vec3.sum(MyAvatar.position, Vec3.multiplyQbyV(MyAvatar.orientation, { x: 0, y: 0, z: -5 })),
    rotation: MyAvatar.orientation,
    dimensions: { x: 0.5, y: 0.5, z: 0.5 },
    lifetime: 500  // Delete after 5 minutes.
});

var start = Date.now();
var props;

for(var i = 0; i < 5000; i++) {
    props = Entities.getEntityProperties(entityID, ["type"]);
}
var endTime = Date.now();
print(JSON.stringify(props));
print("---------------load test finished----------------" + ((endTime - start)/1000.0));
Entities.deleteEntity(entityID);
ksuprynowicz commented 7 months ago

I almost have fix ready for this. Performance is improved by almost 100 times in extreme cases, but there are still bugs to fix.

ksuprynowicz commented 6 months ago

Fixed!