|
Post by Physicscoder on Aug 16, 2004 20:29:52 GMT 1
Is it possible to have multiple bodies point to the same dbp object as there visual representation?
I think it produced a funny bug in my game, but it's fixed now. The bug was caused by the fact that I was deleting a tank object, but not it's body, so in the next level there was 2 or more bodies pointing to the same tank object, therefore the object hopped from body to body, is was very funny, cause you'd be driving along and then drive into an invisible body (as in, a body with no visual object representation), once the body became active, the db object would appear on the body.
If it is possible, could there be an error like: "ERROR: multiple bodies are pointing to object x" because a dbp object can only be the visual representation of one body.
|
|
|
Post by Kjelle69 on Aug 17, 2004 6:05:22 GMT 1
hmmm... to be honest I think I'll leave that up to the user... to add such an error message would require me searching through an array looking for multiple entries of the same object, which would simply slow down the system.
...
unless I put the search into the NDB_BodySetDBProData command... I suppose that would work... when you call the command it could check for any other bodies that are assigned to that object.
but I'm not convinced the loss in speed would be worth it... what does everyone else think?
|
|
|
Post by zircher on Aug 17, 2004 15:16:11 GMT 1
It's an interesting error that might have a place in the documentation or might be elaborated on in some code comments. But, I don't think it is such a show stopper that it needed all the time. The time penalty for error checking is too high. -- TAZ
|
|
|
Post by Physicscoder on Aug 17, 2004 20:27:53 GMT 1
yeah maybe just a comment at the NDB_BodySetDBProData command part in the command page.
At the most you could consider makes a new command that just checks for duplicates of an object. Then the user could chose if/when to call it during his program with no slow down during the main game loop.
|
|