Quote: "I do not have time at the moment to code a camera collision function."
I'm not asking you too, but if the help files had actual working examples I could figure it out for myself. But they don't, so I can't. I don't mean to sound rude, and I apologise if I do, but I and others paid for AppGameKit, and there is a lack of information or examples provided. I know you're slowly adding examples, but not for this issue.
Quote: "There may be some errors in your example look at line 2 the variable names are just a #."
That's a code blocks error when pressing Ctrl + delete. I've already fixed that in my actual code (and the snippit above), they are Y1# and Z1# respectively.
Quote: " the ray needs to be cast from the cameras position ....."
it is. (Even though I've moved the camera to the final position)
X1#, Y1# and Z1# are the (old) cameras position.
Quote: "to a world vector a certain distance from the camera"
You used :
SetVector3( toVecID, distX, distY, distZ, 0.0 )
GetVector3Add( toVecID, fromVecID )
I don't understand this. Do I need to use trig to get these values? I just moved the camera backwards to that certain distance away to get the end point of the ray. Can't I just use these two position vectors? (Pre-camera moving, and post camera moving) If need be, I could just normalise these two vectors to get the distance from the original vector.
Quote: "Also Get3DPhysicsRayCastContactPosition() returns a world vector contact position on the object hit.
You would not want to position the camera at that location. I left the command in the example to show how ray casting works and the results it returns."
I tried running your version, it didn't work as expected.
Quote: "You will of course need more than one ray in different directions but that is up to you to code."
Why? The camera should move directly backwards until it hits something, or reaches the specified distance away from the player.
Quote: "There is no need to create and delete the rays and vectors every time just reuse them."
I know, I just didn't want to keep track of the IDs whilst testing. If I eventually get a working version, I can clean it up afterwards.