|
@@ -21168,7 +21168,7 @@ var WebXRMotionControllerTeleportation = /** @class */ (function (_super) {
|
|
|
_this._tmpRay.origin.copyFrom(_this._tmpVector);
|
|
|
_this._tmpRay.direction.set(0, -1, 0);
|
|
|
var pick = _this._xrSessionManager.scene.pickWithRay(_this._tmpRay, function (o) {
|
|
|
- return _this._options.floorMeshes.indexOf(o) !== -1;
|
|
|
+ return _this._floorMeshes.indexOf(o) !== -1;
|
|
|
});
|
|
|
// pick must exist, but stay safe
|
|
|
if (pick && pick.pickedPoint) {
|
|
@@ -21216,6 +21216,7 @@ var WebXRMotionControllerTeleportation = /** @class */ (function (_super) {
|
|
|
if (!_this._options.teleportationTargetMesh) {
|
|
|
_this.createDefaultTargetMesh();
|
|
|
}
|
|
|
+ _this._floorMeshes = _this._options.floorMeshes || [];
|
|
|
_this.setTargetMeshVisibility(false);
|
|
|
return _this;
|
|
|
}
|
|
@@ -21224,16 +21225,16 @@ var WebXRMotionControllerTeleportation = /** @class */ (function (_super) {
|
|
|
* @param mesh the mesh to use as floor mesh
|
|
|
*/
|
|
|
WebXRMotionControllerTeleportation.prototype.addFloorMesh = function (mesh) {
|
|
|
- this._options.floorMeshes.push(mesh);
|
|
|
+ this._floorMeshes.push(mesh);
|
|
|
};
|
|
|
/**
|
|
|
* Remove a mesh from the floor meshes array
|
|
|
* @param mesh the mesh to remove
|
|
|
*/
|
|
|
WebXRMotionControllerTeleportation.prototype.removeFloorMesh = function (mesh) {
|
|
|
- var index = this._options.floorMeshes.indexOf(mesh);
|
|
|
+ var index = this._floorMeshes.indexOf(mesh);
|
|
|
if (index !== -1) {
|
|
|
- this._options.floorMeshes.splice(index, 1);
|
|
|
+ this._floorMeshes.splice(index, 1);
|
|
|
}
|
|
|
};
|
|
|
/**
|
|
@@ -21302,7 +21303,7 @@ var WebXRMotionControllerTeleportation = /** @class */ (function (_super) {
|
|
|
// first check if direct ray possible
|
|
|
controllerData.xrController.getWorldPointerRayToRef(this._tmpRay);
|
|
|
var pick = scene.pickWithRay(this._tmpRay, function (o) {
|
|
|
- return _this._options.floorMeshes.indexOf(o) !== -1;
|
|
|
+ return _this._floorMeshes.indexOf(o) !== -1;
|
|
|
});
|
|
|
if (pick && pick.pickedPoint) {
|
|
|
hitPossible = true;
|
|
@@ -21320,7 +21321,7 @@ var WebXRMotionControllerTeleportation = /** @class */ (function (_super) {
|
|
|
this._tmpVector.subtractToRef(this._tmpRay.origin, this._tmpRay.direction);
|
|
|
this._tmpRay.direction.normalize();
|
|
|
var pick_1 = scene.pickWithRay(this._tmpRay, function (o) {
|
|
|
- return _this._options.floorMeshes.indexOf(o) !== -1;
|
|
|
+ return _this._floorMeshes.indexOf(o) !== -1;
|
|
|
});
|
|
|
if (pick_1 && pick_1.pickedPoint) {
|
|
|
hitPossible = true;
|
|
@@ -23855,7 +23856,8 @@ var WebXRDefaultExperience = /** @class */ (function () {
|
|
|
result.pointerSelection = result.baseExperience.featuresManager.enableFeature(_features_WebXRControllerPointerSelection__WEBPACK_IMPORTED_MODULE_2__["WebXRControllerPointerSelection"].Name, "latest", {
|
|
|
xrInput: result.input
|
|
|
});
|
|
|
- if (options.floorMeshes) {
|
|
|
+ // Add default teleportation, including rotation
|
|
|
+ if (!options.disableTeleportation) {
|
|
|
result.teleportation = result.baseExperience.featuresManager.enableFeature(_features_WebXRControllerTeleportation__WEBPACK_IMPORTED_MODULE_4__["WebXRMotionControllerTeleportation"].Name, "latest", {
|
|
|
floorMeshes: options.floorMeshes,
|
|
|
xrInput: result.input
|
|
@@ -71639,7 +71641,7 @@ var ColorMergerBlock = /** @class */ (function (_super) {
|
|
|
* @param name defines the block name
|
|
|
*/
|
|
|
function ColorMergerBlock(name) {
|
|
|
- var _this = _super.call(this, name, _Enums_nodeMaterialBlockTargets__WEBPACK_IMPORTED_MODULE_3__["NodeMaterialBlockTargets"].Fragment) || this;
|
|
|
+ var _this = _super.call(this, name, _Enums_nodeMaterialBlockTargets__WEBPACK_IMPORTED_MODULE_3__["NodeMaterialBlockTargets"].Neutral) || this;
|
|
|
_this.registerInput("rgb ", _Enums_nodeMaterialBlockConnectionPointTypes__WEBPACK_IMPORTED_MODULE_2__["NodeMaterialBlockConnectionPointTypes"].Color3, true);
|
|
|
_this.registerInput("r", _Enums_nodeMaterialBlockConnectionPointTypes__WEBPACK_IMPORTED_MODULE_2__["NodeMaterialBlockConnectionPointTypes"].Float, true);
|
|
|
_this.registerInput("g", _Enums_nodeMaterialBlockConnectionPointTypes__WEBPACK_IMPORTED_MODULE_2__["NodeMaterialBlockConnectionPointTypes"].Float, true);
|
|
@@ -71802,7 +71804,7 @@ var ColorSplitterBlock = /** @class */ (function (_super) {
|
|
|
* @param name defines the block name
|
|
|
*/
|
|
|
function ColorSplitterBlock(name) {
|
|
|
- var _this = _super.call(this, name, _Enums_nodeMaterialBlockTargets__WEBPACK_IMPORTED_MODULE_3__["NodeMaterialBlockTargets"].Fragment) || this;
|
|
|
+ var _this = _super.call(this, name, _Enums_nodeMaterialBlockTargets__WEBPACK_IMPORTED_MODULE_3__["NodeMaterialBlockTargets"].Neutral) || this;
|
|
|
_this.registerInput("rgba", _Enums_nodeMaterialBlockConnectionPointTypes__WEBPACK_IMPORTED_MODULE_2__["NodeMaterialBlockConnectionPointTypes"].Color4, true);
|
|
|
_this.registerInput("rgb ", _Enums_nodeMaterialBlockConnectionPointTypes__WEBPACK_IMPORTED_MODULE_2__["NodeMaterialBlockConnectionPointTypes"].Color3, true);
|
|
|
_this.registerOutput("rgb", _Enums_nodeMaterialBlockConnectionPointTypes__WEBPACK_IMPORTED_MODULE_2__["NodeMaterialBlockConnectionPointTypes"].Color3);
|
|
@@ -77617,7 +77619,7 @@ var NodeMaterial = /** @class */ (function (_super) {
|
|
|
var mustRebind = this._mustRebind(scene, effect, mesh.visibility);
|
|
|
if (mustRebind) {
|
|
|
var sharedData = this._sharedData;
|
|
|
- if (effect && scene.getCachedMaterial() !== this) {
|
|
|
+ if (effect && scene.getCachedEffect() !== effect) {
|
|
|
// Bindable blocks
|
|
|
for (var _i = 0, _a = sharedData.bindableBlocks; _i < _a.length; _i++) {
|
|
|
var block = _a[_i];
|
|
@@ -78426,7 +78428,8 @@ var NodeMaterialBlock = /** @class */ (function () {
|
|
|
block.build(state, activeBlocks);
|
|
|
var localBlockIsFragment = (state._vertexState != null);
|
|
|
var otherBlockWasGeneratedInVertexShader = block._buildTarget === _Enums_nodeMaterialBlockTargets__WEBPACK_IMPORTED_MODULE_2__["NodeMaterialBlockTargets"].Vertex && block.target !== _Enums_nodeMaterialBlockTargets__WEBPACK_IMPORTED_MODULE_2__["NodeMaterialBlockTargets"].VertexAndFragment;
|
|
|
- if (localBlockIsFragment && (((block.target & input.target) === 0) ||
|
|
|
+ if (localBlockIsFragment && (((block.target & block._buildTarget) === 0) ||
|
|
|
+ ((block.target & input.target) === 0) ||
|
|
|
(this.target !== _Enums_nodeMaterialBlockTargets__WEBPACK_IMPORTED_MODULE_2__["NodeMaterialBlockTargets"].VertexAndFragment && otherBlockWasGeneratedInVertexShader))) { // context switch! We need a varying
|
|
|
if ((!block.isInput && state.target !== block._buildTarget) // block was already emitted by vertex shader
|
|
|
|| (block.isInput && block.isAttribute) // block is an attribute
|
|
@@ -141705,6 +141708,44 @@ var RecastJSCrowd = /** @class */ (function () {
|
|
|
this.recastCrowd.agentGoto(index, new this.bjsRECASTPlugin.bjsRECAST.Vec3(destination.x, destination.y, destination.z));
|
|
|
};
|
|
|
/**
|
|
|
+ * Teleport the agent to a new position
|
|
|
+ * @param index agent index returned by addAgent
|
|
|
+ * @param destination targeted world position
|
|
|
+ */
|
|
|
+ RecastJSCrowd.prototype.agentTeleport = function (index, destination) {
|
|
|
+ this.recastCrowd.agentTeleport(index, new this.bjsRECASTPlugin.bjsRECAST.Vec3(destination.x, destination.y, destination.z));
|
|
|
+ };
|
|
|
+ /**
|
|
|
+ * Update agent parameters
|
|
|
+ * @param index agent index returned by addAgent
|
|
|
+ * @param parameters agent parameters
|
|
|
+ */
|
|
|
+ RecastJSCrowd.prototype.updateAgentParameters = function (index, parameters) {
|
|
|
+ var agentParams = this.recastCrowd.getAgentParameters(index);
|
|
|
+ if (parameters.radius !== undefined) {
|
|
|
+ agentParams.radius = parameters.radius;
|
|
|
+ }
|
|
|
+ if (parameters.height !== undefined) {
|
|
|
+ agentParams.height = parameters.height;
|
|
|
+ }
|
|
|
+ if (parameters.maxAcceleration !== undefined) {
|
|
|
+ agentParams.maxAcceleration = parameters.maxAcceleration;
|
|
|
+ }
|
|
|
+ if (parameters.maxSpeed !== undefined) {
|
|
|
+ agentParams.maxSpeed = parameters.maxSpeed;
|
|
|
+ }
|
|
|
+ if (parameters.collisionQueryRange !== undefined) {
|
|
|
+ agentParams.collisionQueryRange = parameters.collisionQueryRange;
|
|
|
+ }
|
|
|
+ if (parameters.pathOptimizationRange !== undefined) {
|
|
|
+ agentParams.pathOptimizationRange = parameters.pathOptimizationRange;
|
|
|
+ }
|
|
|
+ if (parameters.separationWeight !== undefined) {
|
|
|
+ agentParams.separationWeight = parameters.separationWeight;
|
|
|
+ }
|
|
|
+ this.recastCrowd.setAgentParameters(index, agentParams);
|
|
|
+ };
|
|
|
+ /**
|
|
|
* remove a particular agent previously created
|
|
|
* @param index agent index returned by addAgent
|
|
|
*/
|