|
@@ -469,53 +469,83 @@ rogue_engine__WEBPACK_IMPORTED_MODULE_0__.registerComponent(BallRaycastReceiver)
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
-/***/ "./Assets/Components/DirectionalLightFixForMobileCamera.re.ts":
|
|
|
-/*!********************************************************************!*\
|
|
|
- !*** ./Assets/Components/DirectionalLightFixForMobileCamera.re.ts ***!
|
|
|
- \********************************************************************/
|
|
|
+/***/ "./Assets/Components/DirectionalLightShadowFixForMobileCamera.re.ts":
|
|
|
+/*!**************************************************************************!*\
|
|
|
+ !*** ./Assets/Components/DirectionalLightShadowFixForMobileCamera.re.ts ***!
|
|
|
+ \**************************************************************************/
|
|
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
|
|
|
|
__webpack_require__.r(__webpack_exports__);
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
|
-/* harmony export */ "default": () => (/* binding */ DirectionalLightFixForMobileCamera)
|
|
|
+/* harmony export */ "default": () => (/* binding */ DirectionalLightShadowFixForMobileCamera)
|
|
|
/* harmony export */ });
|
|
|
/* harmony import */ var rogue_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! rogue-engine */ "rogue-engine");
|
|
|
/* harmony import */ var rogue_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(rogue_engine__WEBPACK_IMPORTED_MODULE_0__);
|
|
|
/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! three */ "three");
|
|
|
/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(three__WEBPACK_IMPORTED_MODULE_1__);
|
|
|
var __defProp = Object.defineProperty;
|
|
|
+var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
|
+var __decorateClass = (decorators, target, key, kind) => {
|
|
|
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
|
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
|
+ if (decorator = decorators[i])
|
|
|
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
|
+ if (kind && result)
|
|
|
+ __defProp(target, key, result);
|
|
|
+ return result;
|
|
|
+};
|
|
|
|
|
|
|
|
|
-class DirectionalLightFixForMobileCamera extends rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Component {
|
|
|
+class DirectionalLightShadowFixForMobileCamera extends rogue_engine__WEBPACK_IMPORTED_MODULE_0__.Component {
|
|
|
constructor() {
|
|
|
super(...arguments);
|
|
|
this.initialOffset = new three__WEBPACK_IMPORTED_MODULE_1__.Vector3();
|
|
|
this.currentOffset = new three__WEBPACK_IMPORTED_MODULE_1__.Vector3();
|
|
|
+ this._normalBias = 0.04;
|
|
|
+ }
|
|
|
+ get light() {
|
|
|
+ return this.object3d;
|
|
|
+ }
|
|
|
+ get camera() {
|
|
|
+ return rogue_engine__WEBPACK_IMPORTED_MODULE_0__.App.currentScene.getObjectByProperty("uuid", rogue_engine__WEBPACK_IMPORTED_MODULE_0__.App.activeCamera);
|
|
|
+ }
|
|
|
+ get shadow() {
|
|
|
+ return this.light.shadow;
|
|
|
+ }
|
|
|
+ get normalBias() {
|
|
|
+ return this._normalBias;
|
|
|
+ }
|
|
|
+ set normalBias(value) {
|
|
|
+ this._normalBias = value;
|
|
|
+ if (this.shadow) {
|
|
|
+ this.shadow.normalBias = value;
|
|
|
+ }
|
|
|
}
|
|
|
awake() {
|
|
|
}
|
|
|
start() {
|
|
|
- const activeCamera = rogue_engine__WEBPACK_IMPORTED_MODULE_0__.App.currentScene.getObjectByProperty("uuid", rogue_engine__WEBPACK_IMPORTED_MODULE_0__.App.activeCamera);
|
|
|
- const directionalLight = this.object3d;
|
|
|
- this.initialOffset.copy(this.object3d.position);
|
|
|
+ this.initialOffset.copy(this.light.position);
|
|
|
this.initialOffset.sub(new three__WEBPACK_IMPORTED_MODULE_1__.Vector3(0, 0, 0));
|
|
|
this.updatePositions();
|
|
|
- directionalLight.target = activeCamera;
|
|
|
+ this.light.target = this.camera;
|
|
|
}
|
|
|
update() {
|
|
|
this.updatePositions();
|
|
|
}
|
|
|
updatePositions() {
|
|
|
- const activeCamera = rogue_engine__WEBPACK_IMPORTED_MODULE_0__.App.currentScene.getObjectByProperty("uuid", rogue_engine__WEBPACK_IMPORTED_MODULE_0__.App.activeCamera);
|
|
|
- const directionalLight = this.object3d;
|
|
|
- this.currentOffset.copy(this.initialOffset).add(activeCamera.position);
|
|
|
- directionalLight.position.set(this.currentOffset.x, this.currentOffset.y, this.currentOffset.z);
|
|
|
- directionalLight.shadow.camera.position.set(this.currentOffset.x, this.currentOffset.y, this.currentOffset.z);
|
|
|
+ this.currentOffset.copy(this.initialOffset).add(this.camera.position);
|
|
|
+ this.light.position.set(this.currentOffset.x, this.currentOffset.y, this.currentOffset.z);
|
|
|
+ if (this.shadow) {
|
|
|
+ this.shadow.camera.position.set(this.currentOffset.x, this.currentOffset.y, this.currentOffset.z);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
-__name(DirectionalLightFixForMobileCamera, "DirectionalLightFixForMobileCamera");
|
|
|
-rogue_engine__WEBPACK_IMPORTED_MODULE_0__.registerComponent(DirectionalLightFixForMobileCamera);
|
|
|
+__name(DirectionalLightShadowFixForMobileCamera, "DirectionalLightShadowFixForMobileCamera");
|
|
|
+__decorateClass([
|
|
|
+ rogue_engine__WEBPACK_IMPORTED_MODULE_0__.props.num()
|
|
|
+], DirectionalLightShadowFixForMobileCamera.prototype, "normalBias", 1);
|
|
|
+rogue_engine__WEBPACK_IMPORTED_MODULE_0__.registerComponent(DirectionalLightShadowFixForMobileCamera);
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
@@ -5683,7 +5713,7 @@ const OutputShader = {
|
|
|
/******/ // Load entry module and return exports
|
|
|
/******/ __webpack_require__("./Assets/Components/Animator.re.ts");
|
|
|
/******/ __webpack_require__("./Assets/Components/BallRaycastReceiver.re.ts");
|
|
|
-/******/ __webpack_require__("./Assets/Components/DirectionalLightFixForMobileCamera.re.ts");
|
|
|
+/******/ __webpack_require__("./Assets/Components/DirectionalLightShadowFixForMobileCamera.re.ts");
|
|
|
/******/ __webpack_require__("./Assets/Components/DummyShooter.re.ts");
|
|
|
/******/ __webpack_require__("./Assets/Components/FaceDirectionOfVelocityComponent.re.ts");
|
|
|
/******/ __webpack_require__("./Assets/Components/FloorCheckComponent.re.ts");
|