External ballistic sim
Posted: Tue Oct 09, 2012 5:18 pm
So far, from what I have red here, best way to simulate external ballistic would be:
1) simulation running at fixed step (i.e. default 1/60)
2) establish how far bullet travel for a particular timeframe - in this case 0,016sec
3) once per update do a raycast test with ray length set based on 2) and position set to ray "endpoint" position from the last update
4) after each step in 3) check how far you got to not exceed max travel distance you established for particular bullet type
Now if this is correct - to find collisions I'd need to check hits returned from raycast.
Taking it little bit further, if I want to ignore collisions with some type of objects (i.e. invisible script trigger entities) should I ask broadphase first for bounding box collisions, list thru them and then do space.Raycast against only qualified objects or may be there is a way to do this with some kind of collision filtering in a single step?
Thanks,
S.
1) simulation running at fixed step (i.e. default 1/60)
2) establish how far bullet travel for a particular timeframe - in this case 0,016sec
3) once per update do a raycast test with ray length set based on 2) and position set to ray "endpoint" position from the last update
4) after each step in 3) check how far you got to not exceed max travel distance you established for particular bullet type
Now if this is correct - to find collisions I'd need to check hits returned from raycast.
Taking it little bit further, if I want to ignore collisions with some type of objects (i.e. invisible script trigger entities) should I ask broadphase first for bounding box collisions, list thru them and then do space.Raycast against only qualified objects or may be there is a way to do this with some kind of collision filtering in a single step?
Thanks,
S.