The following warnings occurred:
Warning [2] Undefined array key "lockoutexpiry" - Line: 94 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 94 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "lockoutexpiry" - Line: 573 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 573 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined variable $can_access_moderationqueue - Line: 752 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 752 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "avatartype" - Line: 892 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 892 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "avatartype" - Line: 892 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 892 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined variable $awaitingusers - Line: 34 - File: global.php(959) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/global.php(959) : eval()'d code 34 errorHandler->error
/global.php 959 eval
/printthread.php 16 require_once
Warning [2] Undefined array key "style" - Line: 1024 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 1024 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined property: MyLanguage::$lang_select_default - Line: 5308 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 5308 errorHandler->error
/global.php 1024 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key 1 - Line: 1474 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 1474 errorHandler->error
/inc/functions.php 1429 fetch_forum_permissions
/printthread.php 76 forum_permissions
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error



Forums
Collision Detection - Printable Version

+- Forums (https://www.vdrift.net/Forum)
+-- Forum: Project (https://www.vdrift.net/Forum/forumdisplay.php?fid=4)
+--- Forum: Development (https://www.vdrift.net/Forum/forumdisplay.php?fid=9)
+--- Thread: Collision Detection (/showthread.php?tid=1698)



Collision Detection - Linksblackmask - 03-01-2013

Hello All,

I'm as you can see a noob, and was looking for some pointers...

I'm looking to develop/implement if it has been already a sort of car awareness, such that the car I'm driving knows the distance to surrounding objects, in more specific case the car in front...

So my question is really, has this been done/being done by anyone, or would it be a case of starting from scratch... if so any pointers would be most appreciated...

Thank you in advance, any advice would be golden Smile


RE: Collision Detection - NaN - 03-01-2013

Hi Linksblackmask

VDrift is using bullet physics lib. So you can use any method for object queries offered by it. For more specific examples you can look into car ai code. The experimental ai(ai/ai_car_experimental.cpp) is using a ray to check whether there is a fixed obstacle in front of it. It is using the castRay function meant for the wheels, could be simplified by using bullets ray cast call directly(see castRay implementation).

If you don't require exact information or are concerned about ray cast performance, you can calculate the distance to the surrounding cars(their center of mass) along your forward vector. I think this code is there for braking calculation, but is disabled.


RE: Collision Detection - Linksblackmask - 03-07-2013

(03-01-2013, 06:08 AM)NaN Wrote: Hi Linksblackmask

VDrift is using bullet physics lib. So you can use any method for object queries offered by it. For more specific examples you can look into car ai code. The experimental ai(ai/ai_car_experimental.cpp) is using a ray to check whether there is a fixed obstacle in front of it. It is using the castRay function meant for the wheels, could be simplified by using bullets ray cast call directly(see castRay implementation).

If you don't require exact information or are concerned about ray cast performance, you can calculate the distance to the surrounding cars(their center of mass) along your forward vector. I think this code is there for braking calculation, but is disabled.

Hay NaN,

Thanks for the answer Smile , have looked into the ai_car_experimental, and have a few more questions, if you wouldn't mind...

Firstly, what unit of measurement does Vdrift use, I assume feet?

Secondly, when calling RayCastDistance to detect distance, is that only to fixed objects (assuming here, walls etc) or (what I think it to be) is that any object including other AI cars?

See I'm "simply" (dont really know how simple it is...) trying to obtain distance from the front of my car to the nearest object, be it a wall or nearest car, I can see that RayCastDistance has the functionality for me to do this already, providing ofcourse I pass, it MATHVECTOR and max_length; but I want the max_length to sort of be like 5280ft/1mile so that is do return the closest object. Hence my two Q's... Smile


RE: Collision Detection - NaN - 03-08-2013

VDrift is using metric units internally. The ray callback used in car ai is only reporting the closest contact, it is possible to write one which would return a list of course. The ray length is restricted for performance reasons, bullet is not optimized for ray queries. I haven't benchmarked it though, so it might perform better than I make it sound.


RE: Collision Detection - Linksblackmask - 03-13-2013

Its not honestly that intensive, I had it do five rays at max of 1000 and no noticeable game proformance was seen, however I'm not expert so... I just checked FPS...

But thank you very much anyways Smile