|
Post by kjelle69 on Dec 13, 2004 1:12:32 GMT 1
If a collision has occured, does the collision index (collisiondata) in this case ever get resetted? Or does it forever remind the last collision that occured to the body missile in this case?
Collisiondata=NDB_GetCollisionBodyToBody(missile,Floor )
if so , is there a way to say, Ok I have recorded and treated the collision, now I want to wait for another collision. (I want collsiiondata to be set to zero until next collision with the missile object)
|
|
|
Post by kjelle69 on Dec 13, 2004 1:59:33 GMT 1
Can someone explain what the command NDB_NewtonReleaseCollison does?
|
|
|
Post by JessTicular on Dec 13, 2004 5:06:09 GMT 1
You use NDB_NewtonReleaseCollison when you make a rigid body from some collision data, and you no longer need that collision data. It simply releases it from the wrapper's/Newton's memory. About your original Q... I'm not sure, sorry Jess.
|
|
|
Post by Kjelle69 on Dec 13, 2004 11:53:12 GMT 1
every time you call NDB_NewtonUpdate, the collision data is erased, and new data is recorded. so the index could be a different number every loop, or by chance it could be the same.
JessTicular's explanation of ReleaseCollision is exactly right.
|
|
|
Post by kjelle69 on Dec 13, 2004 12:11:14 GMT 1
Thanks for you answers, I have had some trouble with detecting a collision of a body against tha floor ( a treecollision .x landscape). It seems that my command Collisiondata=NDB_GetCollisionBodyToBody(missile,Floor ) Detects a collision right at the very creation of the object, and also I have difficulty in detecting the precise global location of the 'impact' But I will go through my code again, was really tired last night coding this part.
Also I see that some of the collision commands dont have the right keywords entered in the ini file, and the documentation differs in the explanation and the syntax sometimes, but Hey, I understand that it is a BIG job to keep track of all changes new version and all.
|
|
|
Post by kjelle69 on Dec 13, 2004 19:35:29 GMT 1
To clarify the unexpected behaviour:
Collisiondata=NDB_GetCollisionBodyToBody( missile(mis), Floor ) if collisiondata<>0 inc explosion
x1# = object position x(missilebase+mis) y1# = object position y(missilebase+mis) z1# = object position z(missilebase+mis)
make object sphere 1000+explosion,2 position object 1000+explosion,x1#,y1#,z1#
rem NDB_NewtonDestroybody missile(mis) rem dec missilecount
endif text 300,300+explosion*10,str$(collisiondata)+" "+str$(missile(mis))+" "+str$(NDB_GetCollisionbody( collisiondata, 1 ))
This loop reports collisions every step, the collisiondata is <> 0 in every step. Altough the sphere (missile) is flying through the air and not touches anything.
Collisiondata=NDB_GetCollisionBodyToMaterial( missile(mis), BallMat ) on the other hand seems to work, (Against an other body, not world)
|
|
|
Post by zircher on Dec 14, 2004 15:00:43 GMT 1
I'd try using the Newton debug/display commands to show the actual collision boxes and such. Perhaps the sphere's collision sphere is significantly larger than what the visual representation indicates. -- TAZ
|
|
|
Post by Kjelle69 on Dec 14, 2004 15:34:46 GMT 1
Newton uses radius, DBPro uses diameter...
I haven't been home in a few days (busy with work), and won't still for a few more, but once I get a little free time I'll look into the collision recorder to see if there's any obvious bugs!
|
|
|
Post by kjelle69 on Dec 14, 2004 15:48:40 GMT 1
Work is a Pita when one spend the whole nights programming Newton. Hehe. ;D You are ruining my sleep with your dll's and wrappers guys !
|
|
|
Post by wow gold on Apr 10, 2009 0:07:25 GMT 1
|
|
|
Post by wow gold on Apr 10, 2009 0:09:20 GMT 1
|
|