Hi!
I'm using your physics engine and it's great
I posted a movie on youTube of my game and of course credited you
(Search for "Oren Yona" on YouTube - it's the first 2 movies, they're the same)
I need some help with terrain collision.
My terrain is 513x513 size.
I'm creating a level editor and I used the terrain's physics entity to do Ray-casting for having some sort of a marker streached on the surface.
The problem is that it doesn't go smoothly... the raycasting returns Infinity a lot of times while it actually DOES suppose to collide.
Is there a better way to use your engine to use raycasting on a large terrain? (Maybe creating a triangle mesh entity instead of a terrain)
Is there any attribute I should change for it to work better? performance is less of an issue since this is just an editor...
Thanks in advanced!
Terrain collision returns infinity...
Re: Terrain collision returns infinity...
Your project looks great!
In some quick tests I couldn't seem to replicate the issue so I'll just try to collect some diagnostic information; are you using version 0.9.0? What kind of scaling does the terrain have (I.E. how large are individual triangles)? Does it occur at the meeting between different triangles? Does it occur when casting rays nearly parallel to the surface of the hit area? Are you using the Terrain.rayCast function specifically? If so, have you tried both versions (single-hit and multiple-hit)?
Technically you could create a StaticTriangleGroup to replace the Terrain (or just use a TriangleMesh for raycasting duties), but it would be pretty indirect and inefficient memory wise.
In some quick tests I couldn't seem to replicate the issue so I'll just try to collect some diagnostic information; are you using version 0.9.0? What kind of scaling does the terrain have (I.E. how large are individual triangles)? Does it occur at the meeting between different triangles? Does it occur when casting rays nearly parallel to the surface of the hit area? Are you using the Terrain.rayCast function specifically? If so, have you tried both versions (single-hit and multiple-hit)?
Technically you could create a StaticTriangleGroup to replace the Terrain (or just use a TriangleMesh for raycasting duties), but it would be pretty indirect and inefficient memory wise.
Re: Terrain collision returns infinity...
Thank you for the quick reply.
Yes I'm using version 0.9.0.
I'm using 513x513 pixels map with no scaling (1 unit spacing),
It also occures when I'm only moving INSIDE a triangle,
The angle in which the ray hit the surface also doesn't have any affect (in both extremes it returns infinity in the same frequency)
The only thing which does seem to have an affect is wether the camera is facing the X/Z axis directly.
It appears that when the camera is looking halfway between the Z and the X axis (I.E looking at one of the terrain's corners) it moves smoothly....
and when I look directly at the X or Z axis (I.E looking at one of the terrain's edges) It doesn't work properly...
the multiple-hit version worked (I went through the lists and took the first value which is not infinity)
Thanks for the help!
Yes I'm using version 0.9.0.
I'm using 513x513 pixels map with no scaling (1 unit spacing),
It also occures when I'm only moving INSIDE a triangle,
The angle in which the ray hit the surface also doesn't have any affect (in both extremes it returns infinity in the same frequency)
The only thing which does seem to have an affect is wether the camera is facing the X/Z axis directly.
It appears that when the camera is looking halfway between the Z and the X axis (I.E looking at one of the terrain's corners) it moves smoothly....
and when I look directly at the X or Z axis (I.E looking at one of the terrain's edges) It doesn't work properly...
I did now and it worked!If so, have you tried both versions (single-hit and multiple-hit)?
the multiple-hit version worked (I went through the lists and took the first value which is not infinity)
Thanks for the help!
Re: Terrain collision returns infinity...
Thanks for the information, I'll investigate further and fix any bugs for v0.10.0.