Time Nick Message 20:10 stephan48 hey, I got a entity setup as a cube, for my project i require that i can detect which face of it a player punched(with coords on this face) - for a single face I can "bullshit" my way around by using the fixed updown/leftright coordinates as a reference but without knowing what face i need to account for I can't do this properly - as the calculations(or rather directions I need to account for) 20:10 stephan48 change per face. I tried to mess with faking the inputs to pointed_thing_to_face_pos which works for the single face, also raycasting fails me. any clues/hints/prior art I can peruse? https://paste.stejau.de/6b597a7f7a73 is my current code - an example of an entity https://filebase.stejau.de/b/d/9z2827/firefox_WfJr6obr7r.png 20:12 stephan48 (punching flips the numbers on/off) i can expect the player to "look"(or rather be directly infront of) at the entites face which they should control, but even looking at the pointed_thing_to_face_pos code I so far fail to see an easy way to figure out the cloest face 20:17 Krock stephan48: might pointed_thing.intersection_normal be helpful? 20:17 stephan48 https://paste.stejau.de/9d8ab6066fbb looked at it before but it was 0/0/0 20:19 stephan48 aha! 20:20 Krock current_raw_normal appears to be set properly in getSelectedActiveObjects 20:23 stephan48 before i dropped all subsequent raycast results because i(as you can see in the code) got into a endless loop by not calling "pointed_thing = ray:next()" - now i get https://paste.stejau.de/5cdc7c4d856e 20:24 stephan48 what should intersection_normal mean? 20:25 stephan48 its stably different per side it seems 20:25 stephan48 stably = i punch different areas on the face 20:25 Krock why do you need to perform a raycast when there's already pointed_thing passed to on_punch? 20:27 stephan48 for an entity? 20:27 Krock oh nvm. it's just "dir" for entity callbacks 20:27 stephan48 dir... hrm. 20:28 Krock > `dir`: unit vector of direction of punch. Always defined. 20:28 Krock at least that's more accurate than the player's direction (might depend on a separate packet) 20:29 Krock dir_to_facedir might then be helpful 20:35 stephan48 dir is stable it seems aslong as you punch the same face of the blog 20:36 stephan48 dir_to_facedir gives me a single number with the face number which is stable when punching different entities 20:41 Krock going offline. It's already late. I hope someone else got more ideas. 20:42 stephan48 Krock: thank you so much for your help, i really appreciate it! 20:42 Krock yw 20:43 stephan48 with this i can do the probably hacky logic of just declaring the needed angles per face 20:43 stephan48 since there are just 6, its not too icky 20:56 stephan48 with raycasting i get the propper and fairly stable position of a punch on the face it seems, so time to run some calculations! 22:27 stephan48 with some more logic it now works :) 22:30 stephan48 https://paste.stejau.de/9269e9d5e0dc this is the latest version of the code. still not completly happy - the offsets need some optimizing but it works! and out of lazyness i only consider two faces