mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-12 19:15:57 +02:00
Add shouldRenderLocally to bat.js and fix findEntities
This commit is contained in:
parent
e3041f2667
commit
8b6db3b6c0
2 changed files with 5 additions and 1 deletions
|
@ -5,11 +5,13 @@
|
|||
this.startNearGrab = function() {
|
||||
print("Started near grab!");
|
||||
pitchingMachine.start();
|
||||
MyAvatar.shouldRenderLocally = false;
|
||||
};
|
||||
this.releaseGrab = function() {
|
||||
print("Stopped near grab!");
|
||||
if (pitchingMachine) {
|
||||
pitchingMachine.stop();
|
||||
}
|
||||
MyAvatar.shouldRenderLocally = true;
|
||||
};
|
||||
});
|
||||
|
|
|
@ -85,10 +85,12 @@ var PITCH_RATE = 5000;
|
|||
function findEntities(properties, searchRadius) {
|
||||
var entities = Entities.findEntities(MyAvatar.position, searchRadius);
|
||||
var matchedEntities = [];
|
||||
var keys = Object.keys(properties);
|
||||
for (var i = 0; i < entities.length; ++i) {
|
||||
var match = true;
|
||||
var candidateProperties = Entities.getEntityProperties(entities[i], keys);
|
||||
for (var key in properties) {
|
||||
if (entities[key] != properties[key]) {
|
||||
if (candidateProperties[key] != properties[key]) {
|
||||
// This isn't a match, move to next entity
|
||||
match = false;
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue