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 GDK / Physics plug-in powered by PhysX

Author
Message
Matty H
16
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 4th Jan 2010 01:19 Edited at: 17th Dec 2010 21:56
Fulcrum Physics v1.4

Written for S3GE



Are you are tired of writing collision code? Why not give this a try(attached), its super-fast collision and physics powered by PhysX.

Version 1.4 is here:
Features:

Complete collision solution and dynamic physics
* Primitive shapes
* Convex mesh
* Compound shapes
* Triangle mesh (terrain and level geometry etc)
* Character controllers
* Vehicles
Collision groups
Contact reports
Raycasting
Materials
Visual debugger
Documentation
Examples
Demo




Here's a couple of videos:
Character controllers and dynamic physics
Vehicles

I would appreciate it if you could test it for me and let me know of any issues, thanks.





The fps is low in this pic as the visual debugger is also running.


New to 1.4:


Attachments

Login to view attachments
lesPaul456
15
Years of Service
User Offline
Joined: 8th Apr 2009
Location:
Posted: 4th Jan 2010 01:31
Looks nice.

I was able to run it without any problems.

Just curious...will we need to have the PhysX SDK installed to use the plug-in in our own applications? I ask because the PhysX SDK download is currently unavailable.

Anyway, it looks nice and I'm looking forward to the release.
Matty H
16
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 4th Jan 2010 21:39
Cool, glad it works, I will include the PhysX SDK files and that should be enough I think. The download on the PhysX site has been down for a while now, not sure what they are doing.
marlou
15
Years of Service
User Offline
Joined: 17th Jan 2009
Location:
Posted: 5th Jan 2010 13:44
It runs faster than my Newton Physics.

Just realized that PhysX is faster than Newton.

Good work. You have character controller working now. I dont have one yet in my Newton..

Im looking forward to its release.

When a person has nothing but a dream, can he dare to dream.
TechLord
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: TheGameDevStore.com
Posted: 5th Jan 2010 23:47
Matty H
16
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 7th Jan 2010 21:08 Edited at: 7th Jan 2010 21:09
Yeh, that demo will be in dosp pretty soon with full source etc.
The physics plug-in v1.0 will be ready this weekend, I have been away from my computer so all I could work on was the name of the plug-in lol.

Here are some ideas, let me know what you think is the best or if you have something different.

Name ideas:

free-fall
fall-out
g-Physics
arc
atom
quark (Q-Physics)
reaction
physodelic
cohesion
fulcrum physics
dynamic
dynamo
equilibrium
parabola
parrallax
fusion
impulse
inertia
flux
fusion
torsion
vector


My favourites are:
Fulcrum, Torsion, Fusion

Have not googled any of them though to see if they are already used for something similar.

I could call it S3GE Physics, or we could have a standard name for plug-ins specifically developed for the S3GE, maybe something above, maybe not.
Matty H
16
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 10th Jan 2010 19:53
Top post updated.

Its here, would appreciate it if you give it a try and let me know of any issues, thanks.
lesPaul456
15
Years of Service
User Offline
Joined: 8th Apr 2009
Location:
Posted: 11th Jan 2010 18:34
Nice job.

I had one problem though. When I try to create a triangle mesh from a .dbo file created in FPS Creator, I get an error saying that the object has more than one mesh.

Any ideas? Thanks!
Matty H
16
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 11th Jan 2010 18:44
This should work:



I did have it so it could make a triangle mesh from multiple meshes but there was no way to access all the collision meshes afterwards so I changed it knowing there is a workaround. This should be fixed in the next version.

Glad you got it going, did you need to do anything extra to get it working or was it straight forward?
lesPaul456
15
Years of Service
User Offline
Joined: 8th Apr 2009
Location:
Posted: 11th Jan 2010 21:31
When I tried that code, I got another error saying that the object has no indices.

Quote: "Glad you got it going, did you need to do anything extra to get it working or was it straight forward? "


Nope, everything was straight forward.
Matty H
16
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 11th Jan 2010 21:50 Edited at: 11th Jan 2010 21:53
O.K, sorry about this. In the 'Include' folder open physics.cpp and find the following function:




Comment out this part:



It will create multiple collision meshes from your object but you will only be able to release the last collision mesh, that may not be a problem for you or it might, I will fix this soon.
Matty H
16
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 15th Jan 2010 01:18
I've fixed the triangle mesh(terrain) issue, I am just doing a bit of testing and looking at the convex mesh function again before I update in a few days.

If anyone wants the updated file now just let me know and I'll attach it.
Matty H
16
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 22nd Jan 2010 23:07 Edited at: 22nd Jan 2010 23:08
Here's a vid of the demo:

DEMO

Still looking at convex/triangle mesh functions, they work but I'm not completely happy with them yet. Once these are done more features will be added.
Hassan
15
Years of Service
User Offline
Joined: 4th May 2009
Location: <script> alert(1); </script>
Posted: 23rd Jan 2010 07:03 Edited at: 23rd Jan 2010 07:11
nice, and the fps is still high with all those stuff

EDIT: is it possible to see the code for that demo?

EDIT 2: nvm i found it with the download

Hassan
15
Years of Service
User Offline
Joined: 4th May 2009
Location: <script> alert(1); </script>
Posted: 23rd Jan 2010 07:41 Edited at: 23rd Jan 2010 07:48
Sorry for the double post, im having some linking errors, and im pretty sure its because of the directory, but what have i done wrong?

Tools -> options... -> projects and solutions -> VC++ directories

i used : C:\Program Files\The Game Creators\Dark GDK\Fulcrum physics plug-in v1.0\Include for the include directory
and : C:\Program Files\The Game Creators\Dark GDK\Fulcrum physics plug-in v1.0\lib\Win32 for the libraries directory

(C:\program files\the game creators\ is the directory for the physics plugin)

Christopher Reeves
18
Years of Service
User Offline
Joined: 20th Dec 2005
Location: Texas, USA
Posted: 23rd Jan 2010 10:51
Not working. The Physics demo won't even run. It says "Could not create PhysXSDK".
Freedom Fighters
15
Years of Service
User Offline
Joined: 2nd Nov 2009
Location:
Posted: 23rd Jan 2010 11:25
it works for me well, sorry about those having troubles,

@Chris - your having a problem with physics, it must be your graphics driver that it not working or doesn't support it.

@hassan - put the include in the the directory of the GDK include but in a separate folder or with the GDK files.

Problem Solution That Never Fails: "Build A Bridge And Get Over It"
Matty H
16
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 23rd Jan 2010 12:04 Edited at: 23rd Jan 2010 12:05
@Hassan - Have you been through the setup document?

@Chris - Like Freedom Fighters said, I think its a driver issue, I need to update the setup document I made because I'm pretty sure you need this:
Driver
I would appreciate it if you tried this and let me know if it works, I can then update the setup doc, thanks.

@Freedom Fighters - Glad its working for you, let me know if you have any issues.

makeTriangleMesh() and makeConvexMesh() will be updated in the next couple of days, they will handle multiple mesh objects more elegantly, they will also scale your physics/collision mesh if you have previously scaled your object, this is something Dark Physics doesn't do.
Hassan
15
Years of Service
User Offline
Joined: 4th May 2009
Location: <script> alert(1); </script>
Posted: 23rd Jan 2010 13:27 Edited at: 23rd Jan 2010 13:37
are you kidding? do i have to add those 2000000 files to my project folder every time i make one?

EDIT: i see, just the cpp files, why dont you convert them to libs instead?

Christopher Reeves
18
Years of Service
User Offline
Joined: 20th Dec 2005
Location: Texas, USA
Posted: 23rd Jan 2010 13:40
Matty God bless you!

working now!
Matty H
16
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 23rd Jan 2010 14:53 Edited at: 23rd Jan 2010 14:54
@Hassan - I will make a lib instead eventually, its something I have never done so I need to look into it. I just create a new filter(physics) so you don't need to look at them all lol.

@Christopher Reeves - I'm really glad that worked for you, would be interesting to see if Dark Physics works for you now also.

If you guys are using this plug-in for your projects let me know what features you need implementing most, thanks.
Christopher Reeves
18
Years of Service
User Offline
Joined: 20th Dec 2005
Location: Texas, USA
Posted: 23rd Jan 2010 23:01
Hey Matty, actually the DarkPhysics does work now as well. I can now use both.
Matty H
16
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 25th Jan 2010 20:08
Glad I could help, obviously I would recommend using Dark Physics if you have already bought it, but keep an eye on this one as once it has more features I'm hoping it will be the better option.

v1.1 coming soon, no new features but better trianglemesh() and convexMesh() implementation, also added scaling in, would not recommend doing it every loop as you basically just delete actor, scale object, create actor, but its certainly good enough if you are making an editor and you want to resize objects and actors.

actors = another name for collision boxes(meshes) etc.
Cetobasilius
14
Years of Service
User Offline
Joined: 29th Dec 2009
Location: Mexico
Posted: 26th Jan 2010 10:12 Edited at: 26th Jan 2010 10:15
lol this is nice. it crashes when you press spacebar for a long time lol would be nice to be able to add vertical speed... like to simulate a jump.

hi
Matty H
16
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 26th Jan 2010 21:06
Lol, the reset function in the demo deletes everything and creates everything again, it would be better to just re-position everything but I could not be bothered lol, thats why it may crash if you try to crash it .

I will look at doing a jump function for the character controller and perhaps a crouch function also.

Thanks for giving it a go.
Hatzl
14
Years of Service
User Offline
Joined: 9th Jan 2010
Location:
Posted: 26th Jan 2010 22:25
Hello,

Look very nice... Good work..
Where can I download it.?
Does i need to buy Dark Physik first.?

Hatzl
Matty H
16
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 26th Jan 2010 22:46
Version 1.1 available, download from top post.

Thanks to lesPaul456 for discovering terrain issue(fixed) and for making some great guitars he he.
jCedborger
14
Years of Service
User Offline
Joined: 21st Jan 2010
Location:
Posted: 28th Jan 2010 01:23
ok, so i cant get PhysX to work...

tried my own code, but did not work, so i tried with the sample code that came with Fulcrum, didnt work either... =S



And here is the build log:



What can i do to solve this?
Cetobasilius
14
Years of Service
User Offline
Joined: 29th Dec 2009
Location: Mexico
Posted: 28th Jan 2010 09:37 Edited at: 28th Jan 2010 09:40
ah noticed the readme file said that! you are great. hope i can implement this to my game sometime. keep up the good work

hi
Matty H
16
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 28th Jan 2010 15:08
@Hatzl - Download attached document in the top post, you do not need to buy anything.

@jCedborger - Have you been through the setup document?

@Cetobasilius - Thanks, I'm gonna try and add compound actors and raycasting in the next couple of weeks.

jCedborger
14
Years of Service
User Offline
Joined: 21st Jan 2010
Location:
Posted: 28th Jan 2010 15:40
Yes, i have been through it, all the directories are right.. will try again though, sometimes VS has its power to fix itself...

How bout that jump and crouch functions? =) really looking forward to next update! =D
jCedborger
14
Years of Service
User Offline
Joined: 21st Jan 2010
Location:
Posted: 28th Jan 2010 16:40
Well no, that didn't do it... i've set everything up correctly. Why do i get theese errors?
Hassan
15
Years of Service
User Offline
Joined: 4th May 2009
Location: <script> alert(1); </script>
Posted: 28th Jan 2010 16:40
i think there's a good competition between xenophysics and fulcrum physics ( i heard that havok is better than physX, well not sure )

Matty H
16
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 28th Jan 2010 17:28
@jCedborger - I will try to re-create those errors and get back to you, it may be an issue with the update, I don't know if anyone else has tried the new version yet. I am looking at crouch function now, jump can be done at your end although I may still do a jump function.

@Hassan - Yeh, Ive seen Xenophysics, its good that people will have options for collision/physics. Havok is a top physics engine as is physX, they probably both have advantages and disadvantages, I think the main advantage with physX may be the licence, if you make a game with it you just need to show the PhysX logo and thats it, as far as I know.

Hassan
15
Years of Service
User Offline
Joined: 4th May 2009
Location: <script> alert(1); </script>
Posted: 28th Jan 2010 17:37 Edited at: 28th Jan 2010 17:38
how about havok? do you need to buy something or such? O_o

also, will you add ragdoll to fulcrum physics?

jCedborger
14
Years of Service
User Offline
Joined: 21st Jan 2010
Location:
Posted: 28th Jan 2010 17:52
Ok, What i did was as simple as, copying the sample code into my own project, put the needed files where they should be, and then just build... Nothing changed to your sample code.
Matty H
16
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 28th Jan 2010 18:00
@Hassan - I think if you use Havok commercially you need to buy the licence but I'm not completely sure, that should not be a problem for most people though as most of us are just hobbyists.

@jCedbourger - I will look at this in a couple of hours and get right back to you, have no time at the moment.

Matty H
16
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 28th Jan 2010 18:26
@jCedborger - Have you dragged the 'Include' folder into your solution explorer? I know this is a pain and I will try to make it into a lib for the next update, anyway, almost certain this is what the problem is.

Also, if you are using the demo code, you need to either comment out the terrain stuff or copy the media into your folder.

jCedborger
14
Years of Service
User Offline
Joined: 21st Jan 2010
Location:
Posted: 28th Jan 2010 18:53
Hey thanks bro! that did the trick =D didn't say anything bout' that in setup doc? or i missed it ;P

But AWSOME support man! THANKS A LOT!
Matty H
16
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 28th Jan 2010 19:09 Edited at: 28th Jan 2010 20:56
@jCedborger - No probs, hope you like.

@Hassan - I think I was wrong about Havok, just looked into it, I think it is also free for commercial use. So two free physics plug-ins, you wait ages for one then two come along at once he he.
EDIT: I will probably adding ragdoll in also, I have not looked into it but once I have done joints it should be straight forward.

jCedborger
14
Years of Service
User Offline
Joined: 21st Jan 2010
Location:
Posted: 29th Jan 2010 14:38 Edited at: 29th Jan 2010 15:57
Ok so next problem I can not figure out how to load in my character and steer instead of the box.

i thought it was just to replace



with



but no...? when i do that, the character is loading in, and i can steer it, BUT it wont hit the ground. like there was gravity, but it just moved up everything like 15meters(theroreticly).
just dont work like with the box, even though i just replaced the box...

and also, how do i scale the character down to fit the terrain?

EDIT: Found "dbScaleObject". But its still not touching ground
Matty H
16
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 29th Jan 2010 16:30
Ill take a look at it for you, what model are you using?
When you load the model without physics, are his feet at (0, 0, 0) or is the centre at (0, 0, 0)?

Try the debugger, you should see what is causing the problem.

jCedborger
14
Years of Service
User Offline
Joined: 21st Jan 2010
Location:
Posted: 29th Jan 2010 16:35 Edited at: 29th Jan 2010 16:36
im currently using the "Colonel-X.x" model that comes with darkGDK.
I have the model positioned:

dbPositionObject(characterID, 90, 0.1, 0);

just as the box in the sample, this shouldnt be a factor? sense gravity should take the model down to the ground.

I'll try the debugger. But unsure if it'll work though.

EDIT: I've scaled down the model by 50%, here is the complete vode for the character:

Matty H
16
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 29th Jan 2010 16:36
Have you deleted the 'offset limb' code from the demo, this is not needed when you load a model.

jCedborger
14
Years of Service
User Offline
Joined: 21st Jan 2010
Location:
Posted: 29th Jan 2010 16:42
Yes i have, i posted the complete code in the post ;P
Matty H
16
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 29th Jan 2010 16:48
You need to scale the model before you create the character controller.

Matty H
16
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 29th Jan 2010 16:56
O.K, that works for me.

Although I have noticed that the collision box dimensions are not correct. I was going to take another look at the way character controllers are implemented in Fulcrum Physics over the weekend anyway and add a capsule controller in as well, so, if you can wait, the dimension issue will be fixed in a couple of days.

jCedborger
14
Years of Service
User Offline
Joined: 21st Jan 2010
Location:
Posted: 29th Jan 2010 17:10
awsome, i still noted that of i get up a bump, he'll hover
ofcourse i can wait =)
Matty H
16
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 29th Jan 2010 17:17
Yeh, for some reason his collision box is a bit wider than his body, like his collision has ate more pies than he has.

jCedborger
14
Years of Service
User Offline
Joined: 21st Jan 2010
Location:
Posted: 29th Jan 2010 17:40
it sure looks like it ;P and one small question. How do i make my character face AWAY from the camera? no matter where i put dbYRotateObject( characterID, 180); it still wont turn away from me

Login to post a reply

Server time is: 2024-11-19 10:30:22
Your offset time is: 2024-11-19 10:30:22