EvilMax Posted May 6, 2016 Share Posted May 6, 2016 Hi evevryone, to describe want i want to archive i have found this example: http://www.babylonjs-playground.com/#10VR41#11 I want to create something very similar, but: 1) I would like to know if there is a way to do it without animation 2) Cast Ray at picked (with length from source to picked destination) point to check collision Once i hove found a good example, but cant it find anymore, there was an android robot that were launching rays at mouse picked position 3) How could i perform this actions even if for example: left mouse button is pressed (i would like to perform this action even on continuous press) Quote Link to comment Share on other sites More sharing options...
EvilMax Posted May 6, 2016 Author Share Posted May 6, 2016 By the way, while i use heightmap + physics, the function reported in playground, make my cube go through terrain on hills. I tried to chancge function with add ing sin and cos but sobething is keep going wong, any suggestion? Quote Link to comment Share on other sites More sharing options...
iiceman Posted May 8, 2016 Share Posted May 8, 2016 Hi there Max, 1) does this playground help http://playground.babylonjs.com/#1NQTNE ? 2) You can create a ray (http://doc.babylonjs.com/classes/2.3/Ray) and then do a pickWithRay (http://doc.babylonjs.com/classes/2.3/Scene#pickwithray-ray-predicate-fastcheck-rarr-pickinginfo-classes-2-3-pickinginfo-) 3) You can use an event on mouse down to set a flag. In your game loop you do the action while the flag is set. On mouse up you set the flag to false. Combined playground for 2 and 3: http://playground.babylonjs.com/#22PWBR#0 GameMonetize and EvilMax 2 Quote Link to comment Share on other sites More sharing options...
EvilMax Posted June 5, 2016 Author Share Posted June 5, 2016 Interesting example in point 1) Thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.