Sign in to follow this  

[HELP] getElementBoundingBox - BUG

Recommended Posts

Hello. So I'd want to create an object on the cursor position. I have calculated everything, it works fine but there are some objects that do not fit to the calculation. I think the problem can be that the bounding box of this objects are also buggy and I don't know what should I change in my calculation.


local sx, sy = guiGetScreenSize()
local relX, relY = getCursorPosition()
cursorX, cursorY = relX * sx, relY * sy
local camX, camY, camZ = getCameraMatrix()
local cursorWorldPosX, cursorWorldPosY, cursorWorldPosZ = getWorldFromScreenPosition(cursorX, cursorY, 1000)
local hit, hitX, hitY, hitZ, hitElement, normalX, normalY, normalZ = processLineOfSight(camX, camY, camZ, cursorWorldPosX, cursorWorldPosY, cursorWorldPosZ, true, true, true, true, true, true, false, true)

Picture about it: (The red lines show the bounding box of the object)


Share this post

Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.