Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark Physics & Dark A.I. & Dark Dynamix / [DP] Deleting A Vehicle

Author
Message
Tv Xxx
16
Years of Service
User Offline
Joined: 23rd Sep 2007
Location: Behind You!
Posted: 27th Aug 2008 20:00
I've Found One Other Thread On This, and That Doesnt Answer How To Do It, So I'm Wondering If Since That Threads Date, anyone Has Managed To Delete A Vehicle?

Yours Tv.

kaedroho
16
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 27th Aug 2008 22:39
have you tried phy delete rigid body? because the vehicles are rotated/positioned with rigid body commands so that might work.

Tv Xxx
16
Years of Service
User Offline
Joined: 23rd Sep 2007
Location: Behind You!
Posted: 27th Aug 2008 22:41
Yerp, and when i use...

if phy get rigid body exist(2000) then phy delete rigid body 2000

My App. Crashes

Yours Tv.

Mista Wilson
15
Years of Service
User Offline
Joined: 27th Aug 2008
Location: Brisbane, Australia
Posted: 28th Aug 2008 12:48
I cant be sure, i use the GDK version... but the command.. dbPhyEnd(); ... Darkbasic equiv "Phy End" ( check the reference for definition) unloads all the resources that were used in the physics simulation and ends the simulation.. To delete a vehicle, i would think that first ending the physics simulation, then deleting the actual DB objects as you would any other... perhaps the error you have is because you are deleting objects that are still in use by the physics simulation..

just an idea

If it ain't broke.... DONT FIX IT !!!
kaedroho
16
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 31st Aug 2008 17:40
TV-Xxx only wants to delete a vehicle and 'phy end' deletes all rigid bodies, cloths, joints, etc.

Tv Xxx
16
Years of Service
User Offline
Joined: 23rd Sep 2007
Location: Behind You!
Posted: 31st Aug 2008 18:11
Yer, I Cant Delete The Vehicle as Phy Delete Rigid Body Crashes, and Phy End Deletes Everything, So I Just Use Hide Object Lol.

Thanks All Tv.

kaedroho
16
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 31st Aug 2008 21:45
if you do that then use 'phy sleep rigid body' so it keeps your performance

Tv Xxx
16
Years of Service
User Offline
Joined: 23rd Sep 2007
Location: Behind You!
Posted: 1st Sep 2008 01:09
good idea, cheers

Mista Wilson
15
Years of Service
User Offline
Joined: 27th Aug 2008
Location: Brisbane, Australia
Posted: 2nd Sep 2008 09:24
you could also consider using multiple physics scenes...( i think the dbPhySleepRigidBody commands are only for rigid bodies, how do they interact with vehicles ? i mean, i know the vehicle is made up of various rigid bodies, but would sleeping the rigid bodies affect the entire vehicle, or for instance, just its chassis ?)

that would increase the cpu load though and would need to be thought out, as to how it would be implemented..

for example, one physics simulation running with all of your "normal" physics interactions in it, and one with the vehicle and what it can interact with in it, that way, when you want your vehicle to leave the game(by being destroyed or whatever) you can just end that simulation and delete all its associated objects etc, leaving your "main" simulation unaffected.. ie. when you are "in" the vehicle, one sim would run, when u "leave" the vehicle, another would take over ... of course, if you are using more than one vehicle, that may not be feasible... and it also introduces a question that i am not sure of( having only just started using dark physics myself), is it possible to move physics objects from one simulation scene to another, and logistics wise, how badly would that affect the CPU do u think ?

If it ain't broke.... DONT FIX IT !!!

Login to post a reply

Server time is: 2024-05-21 05:36:06
Your offset time is: 2024-05-21 05:36:06