Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raycast doesn't work with embedded types #150

Open
gamerscomplete opened this issue Nov 22, 2019 · 1 comment
Open

Raycast doesn't work with embedded types #150

gamerscomplete opened this issue Nov 22, 2019 · 1 comment

Comments

@gamerscomplete
Copy link

The type switch in the raycast specifically looks for graphic types, if the graphic type is embedded in another type the raycast will skip checking for the intersection.

Example of what does not work

type Cube struct {
    *graphic.Mesh
}
geom := geometry.NewCube(1)    
mat := material.NewStandard(&_cubeColor)
mat.SetSide(material.SideFront)
mesh := graphic.NewMesh(geom, mat)
cube := Cube{Mesh: mesh2}
app.Scene().Add(cube)

The cube added to the scene will not be able to be hit by the raycaster, but if

app.Scene().Add(cube.Mesh)

is used it can hit by the raycaster.

@danaugrs
Copy link
Member

Thanks @gamerscomplete - I agree this should be improved. Not sure what's the best approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants