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.

Work in Progress / Kinetix - Physics Library...again

Author
Message
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 4th Oct 2006 01:35 Edited at: 16th Jan 2007 23:35
Update: 16 Jan 2007
Just the updated code. This works pretty seamlessly.




Yes people, yet another physics library, but this time it kicks the butt of every other one I've made. I'm totally serious.

Why did I make it?
I can't buy darkPhysics, and Newton... well, a bit complicated for me to bother with (Sorry Newton people!)

What makes this one better than my others?
A very large shortage in commands, and a much bigger enlargement in functionality...

The functionality compared to my last ones?
- This one has more realistic physics, which means it has real drag forces, collision forces, etc. All controlled by things like densities of air and objects... etc...

- Collision! Woohoo!! Almost works perfectly (and realistically, i.e. uses forces to make the collision, and makes you slide down the slope). Sometimes it can get buggy, but rarely.

- Materials. You can apply them to objects, which say the friction of the objects, and whether they are collidable, and with which objects.

- Other stuff.

The commands?


Explanations:



Example?
Oh, Deamon, sorry man, found your code for matrix to object, so I had to steal it... Thanks.



You will need:
Sparky's older collision dll. Not the one with the sphere collision commands and stuff... the older one.


Anyway, enjoy


[edit]
Attaching sparky's collision (I'm pretty sure that's it)

Attachments

Login to view attachments
Gil Galvanti
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 4th Oct 2006 02:01
could you attach sparky's collision DLL? I don't want to go searching for it . Sounds good though, but we'll just see how good it really is .

Pirates of Port Royale
Live the life of a pirate.
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 4th Oct 2006 02:03
Oops! Sorry! I'll edit the actual thread.

Gil Galvanti
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 4th Oct 2006 02:16
Ok, thanks . Hmm...when I try to compile the example code I get: "could not understand command at line 116"

Pirates of Port Royale
Live the life of a pirate.
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 4th Oct 2006 02:21
Hmmm... must be the wrong dll... try this one:

Attachments

Login to view attachments
Gil Galvanti
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 4th Oct 2006 02:28
nope . This is line 116 :
Quote: "setupcomplexobject obj,0,2"


Pirates of Port Royale
Live the life of a pirate.
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 4th Oct 2006 02:39 Edited at: 4th Oct 2006 02:52
yeah, that's sparky's command alright.... Hmmm... Tell ya what, I'll re-write it tomorrow in sparky's new dll, that should be more handy.

[edit]
Are you sure you put the dll in the plugins-user folder?

Gil Galvanti
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 4th Oct 2006 03:11 Edited at: 4th Oct 2006 03:11
Quote: "Are you sure you put the dll in the plugins-user folder?"

no, I didn't...I just have it in the same folder as the example code, I just made a new project and copied and pasted the example code then downloaded the dll to that project file. What should I do ?

Pirates of Port Royale
Live the life of a pirate.
dark coder
22
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 4th Oct 2006 09:00
I ran your example code and the object just fell through the floor.

Hallowed are the ori.
TEH_CODERER
21
Years of Service
User Offline
Joined: 12th Nov 2003
Location: Right behind you!
Posted: 4th Oct 2006 18:00
Same as Dark Coder.

Ulric
18
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Belgium
Posted: 4th Oct 2006 18:12
It's working here...but a little "jumpy"!!!

"A cow is not entirely full of milk; Some of it are hamburgers!"
ASUS P4G8X-Intel P4 HT 3.06GHz-1Gb DDR266 Dual
nVidia GeForce 6800GT 256Mb (FW. 91.33) - WinXP Pro SP2 - DX9c
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 4th Oct 2006 19:28
@Gil, put the DLL in the compiler>plugins-user folder

@dark and andrew, hmmm, I wonder why... what version of dbpro are you using?

@Ulric, I know, working on it now, heh


so I'm gonna update it with Sparky's new dll, that should clear things up a bit.

dark coder
22
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 4th Oct 2006 20:33
6.2b and whatever the latest sparkys dll is.

Hallowed are the ori.
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 4th Oct 2006 21:35
hmm... I'll have to think about that...

Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 4th Oct 2006 22:22
Here it is with Sparky's new version. It works just as well for me. Tell me what you think.



Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 5th Oct 2006 04:11
Both work for me! This is very nice! I may actually use it! And newton, yes, too complex for me (good to know I'm not the only one lol)

Just 1 thing: The object is a bit bouncy. Could you tone it down a bit to more of a smooth, sliding movement? Or is that too much to ask (it probably is)

Ummm...
Airslide
20
Years of Service
User Offline
Joined: 18th Oct 2004
Location: California
Posted: 5th Oct 2006 06:56
It say's sgn is a 'reserved' word or something I got it to work by chaning the refrences to sgn1. This seems to be happening to alot of things I try, like the Paddy Example in BLUEGUI cause it uses 'count'.

Want FPSC content? Click Here!
Want to get your content there? Send us an e-mail!
dark coder
22
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 5th Oct 2006 08:44
Not bad I guess, it's fairly basic though, and no way near the level of dp/newton, once youve sorted out the bouncing then you could add sphere/sphere collision as that would be pretty easy, then it would resemble more of a physics engine.

Hallowed are the ori.
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 5th Oct 2006 23:58
I'm now gonna work on fixing the bounciness a bit. It's good to hear that it's working (and that some people may actually use it!), then I'll try to work on objects inter-relating

Xenocythe
19
Years of Service
User Offline
Joined: 26th May 2005
Location: You Essay.
Posted: 6th Oct 2006 03:01
pretty cool


TEH_CODERER
21
Years of Service
User Offline
Joined: 12th Nov 2003
Location: Right behind you!
Posted: 7th Oct 2006 17:55
A bit jumpy and the ball rotates seeminlgy randomly but pretty cool.

Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 7th Oct 2006 22:14
I can't seem to fix the bouncyness yet, and the only reason the ball rotates randomly is because DB's rotation sucks

Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 7th Oct 2006 22:18
There's a bug in the rotation at lines 176-8

should be:


Also, I edited it so that it works with EZrotate:





Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 7th Oct 2006 22:48
Damn... I only have the free version of EZRotate... well, thanks for spotting the delibirate mistake anyway

Natflash Games
18
Years of Service
User Offline
Joined: 7th Feb 2006
Location:
Posted: 8th Oct 2006 16:46
Thats really good, espiecially since you were basicily using DBP core commands (Sparky's dosen't count) I didnt think it was possible to make physics so well without a decent physics DLL.
Good Work


Check out my site for the latest on my games.
Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 9th Oct 2006 23:35
Sparkys dll is a decent physics dll

dark coder
22
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 10th Oct 2006 13:56
Quote: "Sparkys dll is a decent physics dll"


Yeah... considering it doesn't do any physics work.

Hallowed are the ori.
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 10th Oct 2006 18:14
Just collision. I could've just used dbpro's commands, but I needed to get the normal of the polygon.

Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 10th Oct 2006 19:26
sparkys dll gives you the bounce normal, face normal, face number, and full sliding collision with multiple objects! It may not be a physics dll, but it's the closest decent free thing there is

Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 10th Oct 2006 19:46
What about Newton?

Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 16th Oct 2006 20:59
Woohoo! Got it to work!



Turoid
21
Years of Service
User Offline
Joined: 1st Nov 2003
Location: The Netherlands
Posted: 17th Oct 2006 10:21
Hmm I cant I tried all ways but none of them worked, just keep falling through the floor.

Can someone upload an exe for me?

Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 17th Oct 2006 12:50
The only thing I can think of is that you dont have Sparky's DLL V2, I posted a download for it somewhere up there

peabnuts
19
Years of Service
User Offline
Joined: 9th Nov 2005
Location: New Zealand
Posted: 19th Nov 2006 06:22
do u think you could post descriptions of what all the codes do and how to use them?

e.g:"kx_createBody==(Object, Dynamic mode, Mass, Drag Constant, Density, Material)

object=number of the object being created,
dynamic mode=setting this to 1 will etc etc
mass:

etc etc"

u get what im sayin'?
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 19th Nov 2006 23:02
Sure thing. Editted first post, all the explanations are there

Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 16th Jan 2007 23:33
Just thought I'd post the last updated code.



David R
21
Years of Service
User Offline
Joined: 9th Sep 2003
Location: 3.14
Posted: 17th Jan 2007 18:35
Just a word of wisdom: If people's balls keep falling through the floor (yes that does sound weird) then it may be that the physics aren't being 'sampled' enough - e.g. the ball is moving too fast for the physics to keep up -

If the ball is moving too fast for the physics to keep up, it will go from one side of the floor to the other without touching the floor in between - the physics will be non-the-wiser, and it will just fall through.

I experienced this with Newton a while ago on a demo app. I had to alter the timing of physics updates, and make the ball slower. It may not be the case here, but it could be


"History shall be kind to me, for I intend to write it" - Winston Churchill
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 17th Jan 2007 21:10
I have had problems with that many times before, and it doesn't matter how fast I make it go, it always works. I don't know what the problem is here. Well I fixed it up a bit anyway, so it should work pretty well now. I'll hook up a demo soon.

Aaron Miller
18
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 21st Jan 2007 03:00
@Zotoaster
I can convert that to a DBP Plugin for you, if you like.

-db


Olby
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location:
Posted: 22nd Jan 2007 22:57
It reports that the SGN function is a reserved word and wont compile, I changed it but it would be nice if you change it too, so it wont be that confusing for the newbies!

AMD Sempron 3.1+ Ghz, 512MB Ram, ATI R9550 256MB Ram, Sound Blaster Live!, WinXP SP2, DirectX 9.0c, DBP 6.2
http://www.myspace.com/producerolby
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 22nd Jan 2007 23:16
Hmm might be a good idea.

Aaron Miller
18
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 25th Jan 2007 01:41
@Zotoaster
Terribly sorry, but I just realised sparky's collision DLL is being used, I can not (currently) create functions which use sparky's collision DLL for a DBP Plugin. If there is an alternative collision source, one made in DBP (Using no external plugins), which is compatable with your kinetix library, I can convert it into a plugin for you, until then, I am terribly sorry.

Sorry,

-db


Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 27th Jan 2007 15:48
That's quite alright

MExe
17
Years of Service
User Offline
Joined: 11th Jan 2007
Location:
Posted: 27th Jan 2007 19:23
Uhm... could you name the DLL in a different way, like in example KINETIX.DLL?
Let's make hypotesys that everybody developing a collision DLL will call it COLLISION.DLL, you will have to choose which one to use, that's not very good.
After this, I am going to try this one library in short, I found the Newton one a bit complex. Hope this is easier to set up and run.
But please change the filename!
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 27th Jan 2007 19:26
The DLL isn't mine, but Sparky's (Paul Johnson) collision dll. It's only there if you dont already have it.

MExe
17
Years of Service
User Offline
Joined: 11th Jan 2007
Location:
Posted: 28th Jan 2007 15:35
You mean, the library is in made straight in DBP?
Maybe it's a bit slower than the others?
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 28th Jan 2007 15:55
It runs fine for me. Actually, the runtime bit is probably not even 100 lines of code, so it runs really fast, especially since it uses sparky's collision dll

tiresius
22
Years of Service
User Offline
Joined: 13th Nov 2002
Location: MA USA
Posted: 29th Jan 2007 04:59
How about a demo? I'd like to see this thing in action.

I'm not a real programmer but I play one with DBPro!
MExe
17
Years of Service
User Offline
Joined: 11th Jan 2007
Location:
Posted: 29th Jan 2007 08:49
Ye post some of your tests Zotoaster, looks interesting.
lower logic
18
Years of Service
User Offline
Joined: 15th Jun 2006
Location:
Posted: 30th Jan 2007 14:40 Edited at: 31st Jan 2007 02:45
Looks interesting. I'll need to try it later when I have a chance. I see you have an old version of my rotate_axis() function. The WIP post of the rotation functions has a newer rotate_axis() which doesn't use acos(), sqrt(), or cross product, and I find it works better than the older version, which used to get stuck at certain angles.

Edit:
I tried the example and it is quite fast. The ball is a little jumpy but it hopped down the slopes very nicely.

Login to post a reply

Server time is: 2024-11-23 21:39:04
Your offset time is: 2024-11-23 21:39:04