소스 검색

Update RayHelper to Mesh in Physics loop and make renderLine not pickable

regnaio 5 년 전
부모
커밋
2a0a038d0c
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      src/Debug/rayHelper.ts

+ 2 - 0
src/Debug/rayHelper.ts

@@ -72,6 +72,7 @@ export class RayHelper {
             this._scene = scene;
             this._renderPoints = [ray.origin, ray.origin.add(ray.direction.scale(ray.length))];
             this._renderLine = Mesh.CreateLines("ray", this._renderPoints, scene, true);
+            this._renderLine.isPickable = false;
 
             if (this._renderFunction) {
                 this._scene.registerBeforeRender(this._renderFunction);
@@ -171,6 +172,7 @@ export class RayHelper {
         if (!this._updateToMeshFunction) {
             this._updateToMeshFunction = (<() => void>this._updateToMesh.bind(this));
             this._attachedToMesh.getScene().registerBeforeRender(this._updateToMeshFunction);
+            this._attachedToMesh.getScene().onAfterStepObservable.add(this._updateToMeshFunction);
         }
 
         // force world matrix computation before the first ray helper computation