|
Van Hellsing, Newbie
Posted: 03 June 2013 07:43 AM Total Posts: 30
Hi.
How to make camera not to go through walls in the game level? It’s clear that I have to tie it to something to detect collisions with, but I don’t exactly understand how to do this. And how to make it work with HoverCameraController or SpringCameraController
My game uses Away3D 4.1.1 beta and latest snapshot of AwayPhysics
|
Pierce, Jr. Member
Posted: 07 June 2013 06:43 PM Total Posts: 40
[ # 1 ]
Check out the example demos for AwayPhysics to see how the engine is instantiated and how collisions are handled. You basically just need to attach a collision volume (invisible geometric mesh) to your camera. Good Luck!
|
Van Hellsing, Newbie
Posted: 08 June 2013 11:22 AM Total Posts: 30
[ # 2 ]
Thank you, pierce. But how do I get the camera only to interact with a level, and not other objects on it?
|
Pierce, Jr. Member
Posted: 08 June 2013 03:27 PM Total Posts: 40
[ # 3 ]
You have complete control over what is added to the physics world. If they are separate meshes you shouldn’t have a problem. If you are importing an external file for your level geometry, make sure to export/import only the actual level as it’s own object, then save your non-colliding geometry in another file to be added separately. Does this clear it up?
|
Van Hellsing, Newbie
Posted: 08 June 2013 05:08 PM Total Posts: 30
[ # 4 ]
Yeah, that part is clear. But I really can’t figure out how to attach a collision volume to a camera, and the pass it on to a camera controller.
I want something like this to happen:
var cameraBox:AWPCollisionObject = new AWPCollisionObject(new AWPBoxShape(), view.camera);
var cameraController:HoverController = new HoverController(cameraBox);
|