Any plan on collision detection method between the viewpoint and the terrain?

286 views
Skip to first unread message

pim.res...@gmail.com

unread,
Jun 16, 2013, 12:18:14 PM6/16/13
to cesiu...@googlegroups.com
Hi, all,

When terrain is added, the viewpoint can get through the ground. Is there any plan on collision detection?

Thanks,
Shawn

Patrick Cozzi

unread,
Jun 17, 2013, 8:34:26 AM6/17/13
to cesiu...@googlegroups.com, pim.res...@gmail.com
Hi Shawn - there is.  Keep an eye on #449.

Patrick

pim.res...@gmail.com

unread,
Jun 20, 2013, 5:33:15 AM6/20/13
to cesiu...@googlegroups.com, pim.res...@gmail.com
I'm going to fix this issue by myself. My plan is save the height map when loading. Not all height map data , only some high point. Then, check the camera height with the height map during moving. But cesium code is too complex. Could anybody tell me the can add these code. For example, tell me which file and which function I should read.

Shawn

pim.res...@gmail.com

unread,
Jun 21, 2013, 12:17:22 AM6/21/13
to cesiu...@googlegroups.com, pim.res...@gmail.com
I found, I should modify these two functions, to avoid camera get into ground.

CameraController.prototype.move()
CameraController.prototype.rotate()

I'm finding the way to get the height map.

pim.res...@gmail.com

unread,
Jun 23, 2013, 2:49:08 AM6/23/13
to cesiu...@googlegroups.com, pim.res...@gmail.com
On Monday, June 17, 2013 8:34:26 PM UTC+8, Patrick Cozzi wrote:
Can I get the height of any point on a mountain, with terrain data?

Patrick Cozzi

unread,
Jun 24, 2013, 5:14:52 PM6/24/13
to cesiu...@googlegroups.com
Yes.  See the "Sample Everest Height" example in the Terrain Sandcastle example.

Patrick



--
You received this message because you are subscribed to a topic in the Google Groups "cesium-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cesium-dev/jQVFIOkk-K4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cesium-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.





--
www.seas.upenn.edu/~pcozzi/

pim.res...@gmail.com

unread,
Jun 25, 2013, 9:17:24 AM6/25/13
to cesiu...@googlegroups.com
Hi, all,

I almost solved this issue, but not perfect.I get ground height by sampleTerrain() in rotate() and move() call. And compare to current camera height. If camera get into ground then let it out. sampleTerrain() is an async function, cannot get ground height real-time. The result is, camera gets into ground firstly, user can see the black starry sky. Then jump out ground about 0.1 second later. If I keep camera height 30 meters up to ground, and move camera not very fast, camera will not get into ground finally.

Thanks,
Shawn

Reply all
Reply to author
Forward
0 new messages