Example #1
0
        public override void OnUpdate()
        {
            if (animatedMesh)
            {
                offset += FrameDelta;
                SetVertexPositions(waveHeight, offset);
                Graphics.MeshFactory.RemoveShape(groundShape);

                Vector3 worldMin = new Vector3(-1000, -1000, -1000);
                Vector3 worldMax = new Vector3(1000, 1000, 1000);

                groundShape.RefitTree(ref worldMin, ref worldMax);

                //clear all contact points involving mesh proxy. Note: this is a slow/unoptimized operation.
                Broadphase.OverlappingPairCache.CleanProxyFromPairs(staticBody.BroadphaseHandle, Dispatcher);
            }

            raycastBar.Move(FrameDelta);
            raycastBar.Cast(World);
            if (IsDebugDrawEnabled)
            {
                raycastBar.Draw(World.DebugDrawer);
            }

            base.OnUpdate();
        }
 public void Raycast(float frameDelta)
 {
     _raycastBar.Move(frameDelta);
     _raycastBar.Cast(World, frameDelta);
     _raycastBar.Draw(World.DebugDrawer);
 }