mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 23:40:11 +02:00
Rename getPitchingMachine to getOrCreatePitchingMachine
This commit is contained in:
parent
30841169ee
commit
20bdc7ee85
2 changed files with 4 additions and 4 deletions
|
@ -4,7 +4,7 @@
|
||||||
this.startNearGrab = function() {
|
this.startNearGrab = function() {
|
||||||
print("Started near grab!");
|
print("Started near grab!");
|
||||||
if (!pitchingMachine) {
|
if (!pitchingMachine) {
|
||||||
pitchingMachine = getPitchingMachine();
|
pitchingMachine = getOrCreatePitchingMachine();
|
||||||
Script.update.connect(function(dt) { pitchingMachine.update(dt); });
|
Script.update.connect(function(dt) { pitchingMachine.update(dt); });
|
||||||
}
|
}
|
||||||
pitchingMachine.start();
|
pitchingMachine.start();
|
||||||
|
@ -12,7 +12,7 @@
|
||||||
};
|
};
|
||||||
this.continueNearGrab = function() {
|
this.continueNearGrab = function() {
|
||||||
if (!pitchingMachine) {
|
if (!pitchingMachine) {
|
||||||
pitchingMachine = getPitchingMachine();
|
pitchingMachine = getOrCreatePitchingMachine();
|
||||||
Script.update.connect(function(dt) { pitchingMachine.update(dt); });
|
Script.update.connect(function(dt) { pitchingMachine.update(dt); });
|
||||||
}
|
}
|
||||||
pitchingMachine.start();
|
pitchingMachine.start();
|
||||||
|
|
|
@ -80,14 +80,14 @@ var PITCHING_MACHINE_PROPERTIES = {
|
||||||
z: 0.39
|
z: 0.39
|
||||||
},
|
},
|
||||||
collisionsWillMove: false,
|
collisionsWillMove: false,
|
||||||
shapeType: "Box",
|
shapeType: "Box"
|
||||||
};
|
};
|
||||||
PITCHING_MACHINE_PROPERTIES.dimensions = Vec3.multiply(2.5, PITCHING_MACHINE_PROPERTIES.dimensions);
|
PITCHING_MACHINE_PROPERTIES.dimensions = Vec3.multiply(2.5, PITCHING_MACHINE_PROPERTIES.dimensions);
|
||||||
var DISTANCE_FROM_PLATE = PITCHING_MACHINE_PROPERTIES.position.z;
|
var DISTANCE_FROM_PLATE = PITCHING_MACHINE_PROPERTIES.position.z;
|
||||||
|
|
||||||
var PITCH_RATE = 5000;
|
var PITCH_RATE = 5000;
|
||||||
|
|
||||||
getPitchingMachine = function() {
|
getOrCreatePitchingMachine = function() {
|
||||||
// Search for pitching machine
|
// Search for pitching machine
|
||||||
var entities = findEntities({ name: PITCHING_MACHINE_PROPERTIES.name }, 1000);
|
var entities = findEntities({ name: PITCHING_MACHINE_PROPERTIES.name }, 1000);
|
||||||
var pitchingMachineID = null;
|
var pitchingMachineID = null;
|
||||||
|
|
Loading…
Reference in a new issue