public ChemEntity TraceRayInScene(Vector3 rayOrigin, Vector3 rayDir) { ChemEntity entity = (ChemEntity)sceneGraph.RayIntersectFirst(rayOrigin, rayDir); /*if (entity != null) * { * AtomSelectionEntity selEntity = new AtomSelectionEntity((AtomEntity)entity); * selEntity.Init(device); * postSceneViewEntities.Add(selEntity); * }*/ /*Ray3D ray = new Ray3D(rayOrigin, rayDir, 20f); * postSceneWorldEntities.Add(ray); * ray.Init(device);*/ return(entity); }