浏览代码

Adjusting front-facing direction to match visuals

rickfromwork 4 年之前
父节点
当前提交
51cf4f532b
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      gui/src/3D/controls/touchHolographicButton.ts

+ 3 - 3
gui/src/3D/controls/touchHolographicButton.ts

@@ -252,9 +252,6 @@ export class TouchHolographicButton extends TouchButton3D {
 
     // Mesh association
     protected _createNode(scene: Scene): TransformNode {
-        this.collisionMesh = BoxBuilder.CreateBox(this.name + "CollisionMesh", { size: 1}, scene);
-        this._enableCollisions(scene);
-
         this._backPlate = BoxBuilder.CreateBox(this.name + "BackMesh", {
             width: 1.0,
             height: 1.0,
@@ -277,6 +274,9 @@ export class TouchHolographicButton extends TouchButton3D {
         this._textPlate.position.z = -0.08;
         this._textPlate.isPickable = false;
 
+        this._enableCollisions(scene, this._frontPlate);
+        this.collidableFrontDirection = this._frontPlate.forward.negate(); // Mesh is facing the wrong way
+
         return this._backPlate;
     }