|
Post by jasond on Jul 22, 2004 22:33:29 GMT 1
First, let me say that you have done an *EXCELLENT* job making this wrapper and I appreciate all of Julio’s work making newton. Please keep it up!
Ok, now for a question: I currently use a loop of (pseudocode)
For WALL = 0 to 100 COLLISION = NDB_GetCollision( CANONBALL , WALLX ) if COLLISION then do something next WALL
is there a way to just ask COLCOUNT = “NDB_CountCollisions( IRON, STONE) or, “how many collisions between these two materials have occured?” then if there’s >0 you can loop thru (Perhaps an array with the 2 Newton Item ID#s? so I don’t have to check each?)
I ask because I’m doing a “smash the castle” type demo. It works really well - (my test computer is an 800MHz crappy computer with a crummy vidcard and I get over 150 boxes onscreen at about 16-40 FPS (It can slow down to 1 fps, but it looks like a slo-mo effect.) ) My problem is, is that I loop thru object arrays to detect Ball/Wall colisions and shatter the wall based on the impact. When I have 200 objects that’s a hella load of looping per frame and I would rather just ask if a collision happened.
Also, side note (for another project) I’m looking forward to Cylinder primitives! How about pyramid primitives? Newton-aware particles (bounce off stuff, but only exist as a point)?
Also, not really a request, but a basic explain of how the matrix math works for those of us who are math-retarded would be helpful.
;D -Jason
|
|
|
Post by Kjelle69 on Jul 23, 2004 5:32:23 GMT 1
some interesting ideas! I agree the collision feedback system could probably use some more features.
I'll be on a business trip for about 10 days from Monday, so I'll give it some thought while I'm away, and see if I can come up with some more options.
I used the collision feedback system extensively in Ragdoll Monkey Bowling as well for sound effects, so I know that it can be slightly cumbersome.
one note, If you call something like this: NDB_GetCollision( BODY1, BODY 2 )
internally, the collision system checks both possible combinations. in other words, it also checks (BODY2, BODY 1) as well.
perhaps something like you mentioned, a "material collision check" would be usefull... again I'll give it some thought.
as for new primitives, the cylinder should be in the next patch, and Julio has also mentioned conics, as well as something called "concave hull" primitives, which are REALLY cool. these should all be coming in the future.
I've heard no mention of particles... they seem like a cool idea though!
I'll post a basic explanation of matrix math (what you need to know for Newton) later.
|
|
|
Post by jasond on Jul 23, 2004 21:31:06 GMT 1
Thanks for the info, I'm looking forward to reading your matrix math info! (perhaps I can ditch my hack-ish "point at and move" routine.)
A material collision check would be nifty. I think I saw something like it in one of Julio's demos. (I think it was along the lines of "call this routine when these two materials collide") but that probably won't work in DB. An array of things that collided would be cool. Especially since I'm sure the wrapper needs to keep track of them in the first place.
I was thinking of Pyramids also because they're the simplest 3d object possible. (least faces). Plus by combining them you can pretty much make anything.
Also they might be a good start for particles although a single point Newton object attached to a small DB square/triangle/sphere object would make super nice particles, plus as a point you could get away without rotation or any of that so it might simplify the calculations a bunch.
Looking forward to your next release, I have a game idea in mind that would use the vehicle stuff.
I'll send you the code for my castle game when I get it cleaned up and presentable.
thanks again, -J
|
|