private void FormMain_Load(object sender, EventArgs e) { var position = new vec3(0, 0.4f, 1) * 4; var center = new vec3(0, 0, 0); var up = new vec3(0, 1, 0); var camera = new Camera(position, center, up, CameraType.Ortho, this.winGLCanvas1.Width, this.winGLCanvas1.Height); this.scene = new Scene(camera); this.scene.RootNode = GetRootNode(); var list = new ActionList(); list.Add(new TransformAction(scene)); list.Add(new RenderAction(scene)); this.actionList = list; this.pickingAction = new Picking(scene); this.pointTip = new LegacyPointNode(); Match(this.trvScene, scene.RootNode); this.trvScene.ExpandAll(); var manipulater = new FirstPerspectiveManipulater(); manipulater.BindingMouseButtons = GLMouseButtons.Right; manipulater.Bind(camera, this.winGLCanvas1); }
protected bool GetInsertionPosition(out Vec3F result, Point clientPt) { var ray = GetWorldRay(clientPt); var pick = Picking.RayPick( GameEngine.GetEngineDevice(), Adapter.SceneManager, Adapter.TechniqueContext, ray, Utils.AsCameraDesc(Camera), ClientSize, Picking.Flags.Terrain); if (pick != null && pick.Length > 0) { result = pick[0].hitPt; return(true); } // If the ray is off the terrain, find the intersection of the ray with Z=0 plane. float distance = ray.Origin.Z / -ray.Direction.Z; if (distance > 0.0f) { result = ray.Origin + distance * ray.Direction; return(true); } result = new Vec3F(0.0f, 0.0f, 0.0f); return(false); }
private void FormMain_Load(object sender, EventArgs e) { var position = new vec3(1, 0.6f, 1) * 16; var center = new vec3(0, 0, 0); var up = new vec3(0, 1, 0); var camera = new Camera(position, center, up, CameraType.Perspecitive, this.winGLCanvas1.Width, this.winGLCanvas1.Height); this.scene = new Scene(camera); this.scene.RootNode = GetRootNode(); var list = new ActionList(); list.Add(new TransformAction(scene.RootNode)); list.Add(new RenderAction(scene)); this.actionList = list; this.pickingAction = new Picking(scene); this.pickingBoard = new FormBoard(); this.pickingBoard.Show(); Match(this.trvScene, scene.RootNode); this.trvScene.ExpandAll(); var manipulater = new FirstPerspectiveManipulater(); manipulater.Bind(camera, this.winGLCanvas1); }
// Update is called once per frame void Update() { if (Camera.current == null) { return; } Ray ray = Camera.current.ScreenPointToRay(Input.mousePosition); // Perform the raycasting. PickSurfaceResult pickResult; bool hit = Picking.PickSurface(terrainVolume, ray.origin, ray.direction, 1000.0f, out pickResult); if (hit) { // Use this value to compute the inner radius as a proportion of the outer radius. float brushInnerRadius = brushOuterRadius * brushInnerScaleFactor; if (Input.GetMouseButton(0)) { float multiplier = 1.0f; if (Input.GetKey(KeyCode.LeftShift)) { multiplier = -1.0f; } TerrainVolumeEditor.SculptTerrainVolume(terrainVolume, pickResult.volumeSpacePos.x, pickResult.volumeSpacePos.y, pickResult.volumeSpacePos.z, brushInnerRadius, brushOuterRadius, brushOpacity * multiplier); } } }
/// <summary> /// Incio, finalizacion o imprecion de liquidacion para marcacion /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void gvLiqPicking_RowCommand(object sender, GridViewCommandEventArgs e) { this.msnMessage.HideMessage(); string str1; if (e.CommandName.Equals("anularpedido")) { GridViewRow row = (GridViewRow)(((ImageButton)e.CommandSource).NamingContainer); string _noLiq = e.CommandArgument.ToString(); str1 = string.Empty; try { str1 = Picking.anular_liquidacion_marcacion(_noLiq); // Async //Log_Transaction.registerUserInfo(_user, "CREATE PICKING:" + _noLiq); this.msnMessage.LoadMessage("Se Anulo la marcación para la liquidación No." + _noLiq + ".", ucMessage.MessageType.Information); } catch (Exception ex) { this.msnMessage.LoadMessage("Error al anular el pedido No." + _noLiq + "; Detalle: " + ex.Message, ucMessage.MessageType.Error); } this.refreshGridView(); } }
private void FormMain_Load(object sender, EventArgs e) { var position = new vec3(5, 3, 4) * 0.2f; var center = new vec3(0, 0, 0); var up = new vec3(0, 1, 0); var camera = new Camera(position, center, up, CameraType.Perspecitive, this.winGLCanvas1.Width, this.winGLCanvas1.Height); this.scene = new Scene(camera) ; { var manipulater = new ArcBallManipulater(GLMouseButtons.Right); manipulater.Bind(camera, this.winGLCanvas1); manipulater.Rotated += manipulater_Rotated; var node = RaycastNode.Create(); this.scene.RootNode = node; (new FormProperyGrid(node)).Show(); } var list = new ActionList(); var transformAction = new TransformAction(scene.RootNode); list.Add(transformAction); var renderAction = new RenderAction(scene); list.Add(renderAction); this.actionList = list; this.pickingAction = new Picking(scene); this.triangleTip = new LegacyTriangleNode(); this.quadTip = new LegacyQuadNode(); }
public static string ajaxGetInfoPickingEmpl() { string str1 = string.Empty; Users user = (Users)HttpContext.Current.Session[Constants.NameSessionUser]; DataTable dataTable = Picking.getInfoPickingEmp().Tables[0]; Decimal num1 = new Decimal(0); Decimal num2 = new Decimal(0); string str2; if (dataTable != null && dataTable.Rows.Count > 0) { string str3 = str1 + "<table cellpadding='3' cellspacing='3'><tr><td><b>Empleado</b></td><td align='center'><b>Núm. Liquidaciones</b></td><td align='center'><b>Unidades</b></td></tr>"; foreach (DataRow dataRow in (InternalDataCollectionBase)dataTable.Rows) { num1 += Convert.ToDecimal(dataRow["no_Liq"]); num2 += Convert.ToDecimal(dataRow["ldn_qty"]); str3 = str3 + "<tr><td>" + dataRow["nameemployee"].ToString() + "</td><td align='center'>" + dataRow["no_Liq"].ToString() + "</td><td align='center'>" + dataRow["ldn_qty"].ToString() + "</td></tr>"; } str2 = str3 + "<tr><td><b>Totales</b></td><td align='center'><b>" + num1.ToString() + "</b></td><td align='center'><b>" + num2.ToString() + "</b></td>" + "</table>"; } else { str2 = "No existe información sobre la marcación en bodega."; } return(str2); }
private void FormMain_Load(object sender, EventArgs e) { var rootElement = GetRootElement(); var position = new vec3(4, 3, 5) * 0.5f; var center = new vec3(0, 0, 0); var up = new vec3(0, 1, 0); var camera = new Camera(position, center, up, CameraType.Perspective, this.winGLCanvas1.Width, this.winGLCanvas1.Height); this.scene = new Scene(camera) { RootNode = rootElement, ClearColor = Color.SkyBlue.ToVec4(), }; Match(this.trvScene, scene.RootNode); this.trvScene.ExpandAll(); var tansformAction = new TransformAction(scene); var renderAction = new RenderAction(scene); var actionList = new ActionList(); actionList.Add(tansformAction); actionList.Add(renderAction); this.actionList = actionList; this.pickingAction = new Picking(scene); var manipulater = new FirstPerspectiveManipulater(); manipulater.Bind(camera, this.winGLCanvas1); }
private void FormMain_Load(object sender, EventArgs e) { var position = new vec3(0, 0, 1) * 6; var center = new vec3(0, 0, 0); var up = new vec3(0, 1, 0); var camera = new Camera(position, center, up, CameraType.Perspecitive, this.winGLCanvas1.Width, this.winGLCanvas1.Height); this.scene = new Scene(camera); this.scene.RootNode = GetRootNode(); //this.triangleTip = new LegacyTriangleNode(); //this.triangleTip.LineWidth = 10; var list = new ActionList(); list.Add(new TransformAction(scene.RootNode)); list.Add(new RenderAction(scene)); this.actionList = list; this.pickingAction = new Picking(scene); var manipulater = new FirstPerspectiveManipulater(); manipulater.Bind(camera, this.winGLCanvas1); }
/// <summary> /// Load content for the screen. /// </summary> /// <param name="GraphicInfo"></param> /// <param name="factory"></param> /// <param name="contentManager"></param> protected override void LoadContent(GraphicInfo GraphicInfo, GraphicFactory factory, IContentManager contentManager) { base.LoadContent(GraphicInfo, factory, contentManager); RegisterDebugDrawCommand rc = new RegisterDebugDrawCommand(ddrawer); CommandProcessor.getCommandProcessor().SendCommandAssyncronous(rc); dlines = new DebugLines(); ddrawer.AddShape(dlines); Picking pick = new Picking(this, 2000); pick.OnPickedLeftButton += new OnPicked(pick_OnPickedLeftButton); { SimpleModel simpleModel = new SimpleModel(factory, "Model//block"); simpleModel.SetTexture(factory.CreateTexture2DColor(1, 1, Color.White), TextureType.DIFFUSE); ///Physic info (position, rotation and scale are set here) BoxObject tmesh = new BoxObject(Vector3.Zero, 1, 1, 1, 10, new Vector3(1000, 1, 1000), Matrix.Identity, MaterialDescription.DefaultBepuMaterial()); tmesh.isMotionLess = true; ///Forward Shader (look at this shader construction for more info) ForwardXNABasicShader shader = new ForwardXNABasicShader(); ///Deferred material ForwardMaterial fmaterial = new ForwardMaterial(shader); ///The object itself IObject obj = new IObject(fmaterial, simpleModel, tmesh); ///Add to the world this.World.AddObject(obj); } wh = new WaypointHandler(); wh.LoadConnectedWaypoints("waypoints.xml"); start = wh.CurrentWaypointsCollection.GetWaypointsList()[0]; { ///Procedural yellow diffuse texture SimpleModel sm = new SimpleModel(factory, "Model\\block"); sm.SetTexture(factory.CreateTexture2DColor(1, 1, Color.Yellow), TextureType.DIFFUSE); ///physic Ghost object(no collision) GhostObject pi = new GhostObject(start.WorldPos, Matrix.Identity, new Vector3(5)); ForwardXNABasicShader s = new ForwardXNABasicShader(); ForwardMaterial mat = new ForwardMaterial(s); IObject obj4 = new IObject(mat, sm, pi); this.World.AddObject(obj4); } ///add a camera this.World.CameraManager.AddCamera(new CameraFirstPerson(GraphicInfo)); { SimpleModel sm = new SimpleModel(factory, "Model\\block"); sm.SetTexture(factory.CreateTexture2DColor(1, 1, Color.Blue), TextureType.DIFFUSE); GhostObject pi = new GhostObject(start.WorldPos, Matrix.Identity, new Vector3(5)); ForwardXNABasicShader s = new ForwardXNABasicShader(); ForwardMaterial mat = new ForwardMaterial(s); IObject obj4 = new IObject(mat, sm, pi); obj4.OnUpdate += new OnUpdate(obj4_OnUpdate); this.World.AddObject(obj4); } }
private void FormMain_Load(object sender, EventArgs e) { var rootElement = GetRootElement(); var position = new vec3(4, 3, 5) * 0.5f; var center = new vec3(0, 0, 0); var up = new vec3(0, 1, 0); var camera = new Camera(position, center, up, CameraType.Perspecitive, this.winGLCanvas1.Width, this.winGLCanvas1.Height); this.scene = new Scene(camera) { RootNode = rootElement, ClearColor = Color.SkyBlue.ToVec4(), }; var tansformAction = new TransformAction(scene.RootNode); var renderAction = new RenderAction(scene); var actionList = new ActionList(); actionList.Add(tansformAction); actionList.Add(renderAction); this.actionList = actionList; this.pickingAction = new Picking(scene); var manipulater = new FirstPerspectiveManipulater(); manipulater.Bind(camera, this.winGLCanvas1); foreach (var item in Enum.GetNames(typeof(LogicOperationCode))) { this.cmbLogicOperation.Items.Add(item); } }
//Custom Code End //Custom Code Start | Replaced Code Block //Replaced Code Block Start //public PickBatchesController(IPickBatchesService pickbatchesService) //Replaced Code Block End public PickBatchesController(IPickBatchesService pickbatchesService, Inventory inventory, IStatusesService statusesService, IOutboundOrdersService outboundordersService, Picking picking) //Custom Code End { _pickbatchesService = pickbatchesService; _inventory = inventory; _statusesService = statusesService; _outboundordersService = outboundordersService; _picking = picking; }
public override FSMNode doActivity() { localTimeDelta = Time.time - lastTimeStamp; lastTimeStamp = Time.time; if (target == null) { if (controller.appleBackpack > 0) { target = controller.selectVillage(); } else { Idle idle = gameObject.AddComponent(typeof(Idle)) as Idle; idle.controller = this.controller; exit(); return(idle); } } float distanceThresh = target.tag == "fruitTree" ? pickingDistance : droppingDistance; if ((transform.position - target.transform.position).magnitude <= distanceThresh && !atDest) { atDest = true; } else if (atDest) { // Check if @ tree if (target.tag == "fruitTree") { Picking pickNode = gameObject.AddComponent(typeof(Picking)) as Picking; pickNode.controller = this.controller; pickNode.pickTarget = target; exit(); return(pickNode); } else // else village { Dropping dropNode = gameObject.AddComponent(typeof(Dropping)) as Dropping; dropNode.controller = this.controller; exit(); return(dropNode); } } else { transform.LookAt(target.transform.position); transform.position += transform.forward * speed * localTimeDelta; transform.position = new Vector3( transform.position.x, Terrain.activeTerrain.SampleHeight(transform.position), transform.position.z); } return(this); }
private void FormMain_Load(object sender, EventArgs e) { var position = new vec3(5, 3, 4); var center = new vec3(0, 0, 0); var up = new vec3(0, 1, 0); var camera = new Camera(position, center, up, CameraType.Perspective, this.winGLCanvas1.Width, this.winGLCanvas1.Height); this.scene = new Scene(camera) ; var list = new ActionList(); var transformAction = new TransformAction(scene); list.Add(transformAction); var renderAction = new RenderAction(scene); list.Add(renderAction); this.actionList = list; this.pickingAction = new Picking(scene); this.triangleTip = new LegacyTriangleNode(); this.quadTip = new LegacyQuadNode(); var manipulater = new FirstPerspectiveManipulater(); manipulater.Bind(camera, this.winGLCanvas1); //string folder = System.Windows.Forms.Application.StartupPath; //string filename = System.IO.Path.Combine(folder + @"\..\..\..\..\Infrastructure\CSharpGL.Models", "vnfHanoiTower.obj_"); //var parser = new ObjVNFParser(false); //ObjVNFResult result = parser.Parse(filename); //if (result.Error != null) //{ // MessageBox.Show(result.Error.ToString()); //} //else //{ // var model = new ObjVNF(result.Mesh); // var node = OITNode.Create(model, ObjVNF.strPosition, ObjVNF.strNormal, model.GetSize()); // float max = node.ModelSize.max(); // node.Scale *= 7.0f / max; // node.WorldPosition = new vec3(0, 0, 0); // var rootElement = this.scene.RootElement; // this.scene.RootElement = node; // if (rootElement != null) { rootElement.Dispose(); } //} // use teapot instead. var model = new Teapot(); var node = OITNode.Create(model, Teapot.strPosition, Teapot.strNormal, model.GetModelSize()); float max = node.ModelSize.max(); node.Scale *= 7.0F / max; node.WorldPosition = new vec3(0, 0, 0); this.scene.RootNode = node; }
Vector3 getSpawnPos() { PickVoxelResult pickResult; Vector3 spawnLoc = new Vector3(Random.Range(0, 50), 100, Random.Range(0, 50)); Picking.PickFirstSolidVoxel(coloredCubesVolume, spawnLoc, Vector3.down, 100f, out pickResult); Vector3 temp = pickResult.worldSpacePos; temp.y += 2; return(temp); }
protected void getSource_buscar() { DateTime _fecha_ini = Convert.ToDateTime(txtDateStart.Text); DateTime _fecha_fin = Convert.ToDateTime(txtDateEnd.Text); _dsResult = Picking.liquidacion_vs_despacho(_fecha_ini, _fecha_fin); Session[_nameSessionData] = _dsResult.Tables[0]; GridViewSourceType = "originalsource"; gvReturns.DataSource = _dsResult; refreshGridView(); }
void do_hit(Vector3 dir, Vector3 location) { PickVoxelResult pickResult; bool hit = Picking.PickFirstSolidVoxel(coloredCubesVolume, location, dir, 2f, out pickResult); if (hit) { int range = 2; DestroyVoxels(pickResult.volumeSpacePos.x, pickResult.volumeSpacePos.y, pickResult.volumeSpacePos.z, range); } }
private IBoxCollider Pick(int mouseX, int mouseY) { if (this.map == null) { return(null); } return(Picking.Pick( this.Mouse.X, this.Mouse.Y, this.WindowSize.X, this.WindowSize.Y, this.matViewProjection, this.map.OfType <IBoxCollider>().Concat(this.map.Entities.OfType <IBoxCollider>()))); }
void do_hit(Vector3 dir, Vector3 location) { PickVoxelResult pickResult; bool hit = Picking.PickFirstSolidVoxel(coloredCubesVolume, location, dir, 2f, out pickResult); if (hit) { DestroyVoxels(pickResult.volumeSpacePos.x, pickResult.volumeSpacePos.y, pickResult.volumeSpacePos.z, destructionRange); isDestroyed = true; Invoke("destroy", 5); } }
private void FormMain_Load(object sender, EventArgs e) { var position = new vec3(5, 3, 4); var center = new vec3(0, 0, 0); var up = new vec3(0, 1, 0); var camera = new Camera(position, center, up, CameraType.Perspecitive, this.winGLCanvas1.Width, this.winGLCanvas1.Height); this.scene = new Scene(camera) ; var list = new ActionList(); var transformAction = new TransformAction(scene.RootNode); list.Add(transformAction); var renderAction = new RenderAction(scene); list.Add(renderAction); this.actionList = list; this.pickingAction = new Picking(scene); this.triangleTip = new LegacyTriangleNode(); this.quadTip = new LegacyQuadNode(); var manipulater = new FirstPerspectiveManipulater(); manipulater.Bind(camera, this.winGLCanvas1); string folder = System.Windows.Forms.Application.StartupPath; string filename = System.IO.Path.Combine(folder, "nanosuit.obj_"); var parser = new ObjVNFParser(false); ObjVNFResult result = parser.Parse(filename); if (result.Error != null) { MessageBox.Show(result.Error.ToString()); } else { var node = ObjVNFNode.Create(result.Mesh); node.Children.Add(new LegacyBoundingBoxNode(node.ModelSize)); float max = node.ModelSize.max(); node.Scale *= 7.0f / max; node.WorldPosition = new vec3(0, 0, 0); var rootElement = this.scene.RootNode; this.scene.RootNode = node; if (rootElement != null) { rootElement.Dispose(); } } }
protected override void Update() { base.Update(); var input = GetMoveInput(); if (Moving) Moving.MoveInDirection(input); if (Looking) Looking.LookInDirection(input); if (Picking) { if (IsButtonDown("Fire1")) Picking.PickUpOrRelease(); if (enemySelecting) enemySelecting.SetEnabled(Picking.IsHolding); } }
protected override void LoadContent(GraphicInfo GraphicInfo, GraphicFactory factory, IContentManager contentManager) { base.LoadContent(GraphicInfo, factory, contentManager); Picking picking = new Picking(this); this.AddScreenUpdateable(picking); perlim = factory.CreateTexture2DPerlinNoise(512, 512, 0.03f, 3f, 0.5f, 1); to = new TerrainObject(factory, perlim, Vector3.Zero, Matrix.Identity, MaterialDescription.DefaultBepuMaterial(), 2, 2); //TerrainObject to = new TerrainObject(factory,"..\\Content\\Textures\\Untitled",Vector3.Zero,Matrix.Identity,MaterialDescription.DefaultBepuMaterial(),2,1); TerrainModel stm = new TerrainModel(factory, to, "TerrainName", "..\\Content\\Textures\\Terraingrass", "..\\Content\\Textures\\rock", "..\\Content\\Textures\\sand", "..\\Content\\Textures\\snow"); DeferredTerrainShader shader = new DeferredTerrainShader(TerrainType.MULTITEXTURE); DeferredMaterial mat = new DeferredMaterial(shader); IObject obj3 = new IObject(mat, stm, to); this.World.AddObject(obj3); #region NormalLight DirectionalLightPE ld1 = new DirectionalLightPE(Vector3.Left, Color.White); DirectionalLightPE ld2 = new DirectionalLightPE(Vector3.Right, Color.White); DirectionalLightPE ld3 = new DirectionalLightPE(Vector3.Backward, Color.White); DirectionalLightPE ld4 = new DirectionalLightPE(Vector3.Forward, Color.White); DirectionalLightPE ld5 = new DirectionalLightPE(Vector3.Down, Color.White); float li = 0.5f; ld1.LightIntensity = li; ld2.LightIntensity = li; ld3.LightIntensity = li; ld4.LightIntensity = li; ld5.LightIntensity = li; this.World.AddLight(ld1); this.World.AddLight(ld2); this.World.AddLight(ld3); this.World.AddLight(ld4); this.World.AddLight(ld5); #endregion this.World.CameraManager.AddCamera(new CameraFirstPerson(true, GraphicInfo)); SkyBoxSetTextureCube stc = new SkyBoxSetTextureCube("Textures//cubemap"); CommandProcessor.getCommandProcessor().SendCommandAssyncronous(stc); ///O PICKING FUNCIONA APENAS COM OBJETOS QUE TENHAM CORPO FISICO REAL !!! ///OS GHOST E OS DUMMY NUNCA SERAO SELECIONADOS ///Para ser informado a todo frame sobre as colisoes do raio, basta utilizar o outro construtor picking.OnPickedLeftButton += new OnPicked(onPick); }
public void Start() { // get stuff _levelManager = GameObject.Find("LevelManager").GetComponent<LevelManager>(); _picking = GetComponent<Picking>(); // spy on human dropping GameObject.FindWithTag("Player").GetComponent<Picking>().OnDropped += HumanDropped; // start stuff StartCoroutine(Hurt()); if (_picking) StartCoroutine(Pick()); }
public void DigFunction(Vector3 digWhere) { Ray ray = new Ray(Camera.main.transform.position, digWhere - Camera.main.transform.position);//Camera.main.ScreenPointToRay(new Vector3(digWhere.x, digWhere.y, 0)); // Perform the raycasting. PickSurfaceResult pickResult; bool hit = Picking.PickSurface(terrainVolume, ray, 1000.0f, out pickResult); // If we hit a solid voxel then create an explosion at this point. if (hit) { int range = 2; DestroyVoxels((int)pickResult.volumeSpacePos.x, (int)pickResult.volumeSpacePos.y, (int)pickResult.volumeSpacePos.z, range); } }
public bool Intersects(IntersectionParams parameters, ref Ray globalRay, out float value) { value = float.MaxValue; if (globalRay.Intersects(ref mBoundingBox) == false) { return(false); } var instRay = Picking.Build(ref parameters.ScreenPosition, ref parameters.InverseView, ref parameters.InverseProjection, ref mInverseMatrix); return(mModel.Intersect(ref instRay, out value)); }
void placeblock(float xPos, float yPos, float zPos) { Ray ray = Camera.main.ScreenPointToRay(new Vector3(xPos, yPos, 0)); // Perform the raycasting. PickSurfaceResult pickResult; bool hit = Picking.PickSurface(terrainVolume, ray, 1000.0f, out pickResult); if (hit) { Vector3 pos = new Vector3((int)pickResult.worldSpacePos.x, (int)pickResult.worldSpacePos.y, (int)pickResult.worldSpacePos.z); Instantiate(cube, pos, transform.rotation); } }
/// <summary> /// Load content for the screen. /// </summary> /// <param name="GraphicInfo"></param> /// <param name="factory"></param> /// <param name="contentManager"></param> protected override void LoadContent(GraphicInfo GraphicInfo, GraphicFactory factory, IContentManager contentManager) { base.LoadContent(GraphicInfo, factory, contentManager); RegisterDebugDrawCommand rc = new RegisterDebugDrawCommand(ddrawer); CommandProcessor.getCommandProcessor().SendCommandAssyncronous(rc); dlines = new DebugLines(); ddrawer.AddShape(dlines); Picking pick = new Picking(this, 2000); pick.OnPickedLeftButton += new OnPicked(pick_OnPickedLeftButton); wh = new WaypointHandler(); SimpleModel simpleModel = new SimpleModel(factory, "Model//block"); simpleModel.SetTexture(factory.CreateTexture2DColor(1, 1, Color.White), TextureType.DIFFUSE); ///Physic info (position, rotation and scale are set here) BoxObject tmesh = new BoxObject(Vector3.Zero, 1, 1, 1, 10, new Vector3(1000, 1, 1000), Matrix.Identity, MaterialDescription.DefaultBepuMaterial()); tmesh.isMotionLess = true; ///Forward Shader (look at this shader construction for more info) ForwardXNABasicShader shader = new ForwardXNABasicShader(); ///Deferred material ForwardMaterial fmaterial = new ForwardMaterial(shader); ///The object itself IObject obj = new IObject(fmaterial, simpleModel, tmesh); ///Add to the world this.World.AddObject(obj); { InputPlayableKeyBoard ipk = new SimpleConcreteKeyboardInputPlayable(StateKey.PRESS, Microsoft.Xna.Framework.Input.Keys.Space); ipk.KeyStateChange += new KeyStateChange(ipk_KeyStateChange); this.BindInput(ipk); } { InputPlayableKeyBoard ipk = new SimpleConcreteKeyboardInputPlayable(StateKey.PRESS, Microsoft.Xna.Framework.Input.Keys.Enter); ipk.KeyStateChange += new KeyStateChange(ipk_KeyStateChange2); this.BindInput(ipk); } ///add a camera this.World.CameraManager.AddCamera(new CameraFirstPerson(GraphicInfo)); }
protected bool GetTerrainCollision(out Vec3F result, Point clientPt) { var pick = Picking.RayPick( GameEngine.GetEngineDevice(), Adapter.SceneManager, Adapter.TechniqueContext, GetWorldRay(clientPt), Utils.AsCameraDesc(Camera), ClientSize, Picking.Flags.Terrain); if (pick != null && pick.Length > 0) { result = pick[0].hitPt; return(true); } result = new Vec3F(0.0f, 0.0f, 0.0f); return(false); }
public static string ajaxGetInfoPicking(string noLiq) { string str = string.Empty; HttpContext.Current.Session["ShippingInfoObj"] = (object)""; Users user = (Users)HttpContext.Current.Session[Constants.NameSessionUser]; DataTable dataTable = Picking.getInfoLiqPicking(noLiq).Tables[0]; if (dataTable != null && dataTable.Rows.Count > 0) { DataRow dataRow = dataTable.Rows[0]; TimeSpan timeSpan = DateTime.Now - Convert.ToDateTime(dataRow["pick_start"]); str = "<table cellpadding='2' cellspacing='2'><tr><td>Fecha de creación de liquidación:</td><td>" + (object)dataRow["datedesc"].ToString() + "</td></tr><tr><td>Fecha de liberación de la liquidación:</td><td>" + dataRow["datedesclear"].ToString() + "</td></tr><tr><td>Marcador:</td><td>" + dataRow["nameemployee"].ToString() + "</td></tr><tr><td>Fecha exacta de incio de marcación:</td><td>" + dataRow["pick_startdesc"].ToString() + "</td></tr><tr><td>Tiempo corrido:</td><td>" + (timeSpan.Days > 0 ? (string)(" " + timeSpan.Days + " Dias - ") : (string)"") + timeSpan.Hours + "Horas - " + timeSpan.Minutes + "Min - " + timeSpan.Seconds + "seg.</td></tr><tr><td>Número de liquidaciones asignAQUARELLAs a este marcador:</td><td>" + dataRow["noLiq"].ToString() + "</td></tr><tr><td>Número total de pares asignados a este marcador:</td><td>" + dataRow["ldn_qty"].ToString() + "</td></tr></table>"; } return(str); }
private void _onPicking(float p) { bool min = true; foreach (var transform in _pickList) { if (transform.Value < p) { min = false; break; } } if (min) { Picking?.Invoke(this); } }
/// <summary> /// <para>Returns Vector3[] of Length 2.</para> /// elem 0 is upper left corner and elem 1 is lower right corner /// </summary> /// <param name="ray"></param> /// <returns></returns> public Vector3[] DoCarveAction(Ray ray) { if (_terrainVolume == null) { return new[] { Vector3.zero, Vector3.zero }; } PickSurfaceResult pickResult; bool hit = Picking.PickSurface(_terrainVolume, ray, 1000.0f, out pickResult); if (hit) { int x = (int) pickResult.volumeSpacePos.x; int y = (int) pickResult.volumeSpacePos.y; int z = (int) pickResult.volumeSpacePos.z; DestroyVoxels(x, y, z); return new[] {new Vector3(x - RangeX, pickResult.worldSpacePos.y, z + RangeZ), new Vector3(x + RangeX, pickResult.worldSpacePos.y, z - RangeZ)}; } return new[] { Vector3.zero, Vector3.zero }; }