These are chat archives for highfidelity/hifi

9th
May 2017
Rob Kayson
@MrRoboman
May 09 2017 00:02
Hi! I'm trying to understand how manipulating the position of an object in edit mode with far grab lasers work. I am having trouble finding the code in edit.js Anyone have more context on this than I do?
Midnight
@MidnightRift
May 09 2017 00:13
@MrRoboman take a look at translateXZTool in entitySelectionTool.js -- its more or less treated as a mouse.
Rob Kayson
@MrRoboman
May 09 2017 00:14
Haha. I was just reading that variable in that file right when your notification popped up.
Thanks!
Midnight
@MidnightRift
May 09 2017 00:14
the onMove method in translateXZTool is probaly what will intrest you most
Rob Kayson
@MrRoboman
May 09 2017 00:14
thank you
Midnight
@MidnightRift
May 09 2017 00:15
though there is setup in onbegin, just be mnindufll of all the variables. its kinda of a fun file to follow.
Rob Kayson
@MrRoboman
May 09 2017 00:15
cool
Anthony Thibault
@hyperlogic
May 09 2017 00:57
@amvmoody Try Entities.setAbsoluteJointRotationInObjectFrame(entityId, quat) or Entities.setAbsoluteJointTranslationInObjectFrame(entity, pos)
Philip Rosedale
@PhilipRosedale
May 09 2017 01:02
@MrRoboman Actually what I think might make more sense is to allow far grab and near grab to work when edit.js is turned on. Those things are accomplished by the script handControllerGrab.js
I don't think we need to re-do the far grab and near grab, we actually just need to not block them. Somehow edit.js is signalling to handControllerGrab that edit mode is ON, meaning don't grab objects that are pointed at. What I'm thinking might make more sense is to just allow far and near grab to work normally, so that you can move things that you are editing. Right now edit.js blocks the grabbing, and does it's only funny X/Z mouse-projection for grabbing with the hand controller. What I am suggesting is that you turn that OFF, and let handControllerGrab work normally for moving things that are being edited.
Midnight
@MidnightRift
May 09 2017 12:52
@hyperlogic Thanks that did the trick. a note, there are three paramaters :) Entities.setAbsoluteJointRotationInObjectFrame(entityId, jointIndex, quat)
Philip Rosedale
@PhilipRosedale
May 09 2017 14:36
Good morning! How are things going in here? Anyone need any help?
Midnight
@MidnightRift
May 09 2017 14:37
@PhilipRosedale I added some comments to highfidelity/hifi#10406
Rob Kayson
@MrRoboman
May 09 2017 14:42
@PhilipRosedale I might hit you up about the grabbing in edit.js a little bit later.
Rob Kayson
@MrRoboman
May 09 2017 20:27
@PhilipRosedale I found the code that turns off far grab when editing. It's actually in handControllerGrab.js. There are a couple of conditions that return early if isInEditMode() is set to true. Removing those I can make the grabbing work but only on dynamic objects that are willing to be moved. We want to be able to move non dynamic objects during editing as well. I'm exploring a solution. Might need to extend entitySelectionTool.js where I disabled the simulated mouse click on the hand controllers and instead hook up the grab code. Let me know if any ideas spring to mind.
Or, I suppose I could temporary change the entity properties if we are in editmode to be dynamic then return them to what they were upon release
Philip Rosedale
@PhilipRosedale
May 09 2017 21:00
@MrRoboman I think the right direction is to do the latter.... change to being dynamic while being far-grabbed.. and in fact... you are working on that, for me, right? https://worklist.net/21288
so if you do 21288 it will apply here too. All objects should be far-grabbable by setting the state to dynamic while being grabbed
Rob Kayson
@MrRoboman
May 09 2017 21:02
Cool. Thanks