Quote: "
The tricky part is having the "old" X,Y,Z position in order to detect collision. In my game, i ignore these, i put old and new is in the same values, it works but if the object move too fast sometime it fail.
My question is there any work around for the recording tricky "old" x,y,z position?"
The same values would be a cast of a single spot and that is why it is not working at fast speeds.
If you want to use the new values, then maybe use them as old and add a little to them for the direction you are traveling for the new.
That way you will be casting out in front a little even at a high speed.
Or even use the new as new and subtract a few for the old, so you cast will be a line and not a dot and have a better chance of detecting a hit.
I have trouble with raycasting too, so I have to play with the numbers a little, but I finally end up with something usable.
Quote: "PS: To AppGameKit Creator, is it possible to make basic 3d collision simpler in the future e.g
1.setobjectcollision(ID,collision on/off,shape of collision) and the check if entitycollide etc etc OR
2.raycasting always start from the object and outward(line or radius)"
Having the option to do things different is better, instead of always having to do it from center as #2 suggests.
#2 is how i use most of my raycasting now, but sometimes I do it other ways.
I use old values in the center of the object, then use new values in direction of travel or desired check.
Since it ignores the backfaces, casting from inside the object works well for me.
Sometimes I even have hidden boxes that are relocated as an object moves to stay with it.
Then, I use them for old and new to cast lines in the shape of the object.
Sometimes is take a lot of hidden boxes for a big oddly shaped object, but it works like a charm.
That is how I am doing the player ship in my anti-poaching game, and it works great to detect running into other ships or icebergs.
I am now working on using this hidden boxes method for the NPC ships to detect icebergs while navigating.
Using 3 boxes for the latter, one in center of ship, and two out in front moved to left and right side a little (width of ship+).
That will allow 3 lines of raycasting for those NPC ships, 2 being 1 from center to each in front, and 1 between the two in front.
That way I will know if the iceberg out in front is left, or right, or dead center. (those ships do not reverse, so bow checks are all that is needed)
Coding things my way since 1981 -- Currently using AppGameKit V2 Tier 1