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
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 17th Dec 2010 22:02
Top post updated with new Lib.
Thanks for your help Noley, much appreciated

DeadTomGC
13
Years of Service
User Offline
Joined: 11th Aug 2010
Location: LU
Posted: 23rd Dec 2010 20:19
I could use some help.

The engine looks great, but I am running into a compiling error.
fatal error LNK1104: cannot open file 'PhysXCooking.lib'
I set up the engine the way described in the setup document.
Also, I can't find this file on my computer anyway.

Any ideas?

I'll get a new signature someday.
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 24th Dec 2010 10:55
It should come with the PhysXSDK, have you downloaded it from the PhysX site?
Here is where it is located on my computer.
C:\Program Files\NVIDIA Corporation\NVIDIA PhysX SDK\v2.8.3\SDKs\lib\Win32

When you have it, this is the important part for this error:

Quote: "Library Files
You need to do the same with the Lib folder that is included in the Fulcrum Physics plug-in (version) folder provided:
Tools -> options… -> Projects and Solutions -> VC++ Directories
Select 'Library files', click on the new line folder and copy the 'Lib' folder location into here.
You also need to add the PhysX library files which should be something like the following, although check your own machine to be sure:
C:\Program Files\NVIDIA Corporation\NVIDIA PhysX SDK\v2.8.3\SDKs\lib\Win32 "


Hope that helps.

DeadTomGC
13
Years of Service
User Offline
Joined: 11th Aug 2010
Location: LU
Posted: 24th Dec 2010 21:25 Edited at: 24th Dec 2010 21:26
I have all that setup and am running vc++ as admin, but still nothing. This of course make sense to an extent because the file 'PhysxCooking.lib' is not in the folder 'C:\Program Files (x86)\NVIDIA Corporation\NVIDIA PhysX SDK\v2.8.1\SDKs\lib\Win32'

Now there are a few things you should know.
1. I apparently am using v2.8.1 not v2.8.3
2. I did not download my SDK from the PhysX site.
3. I looked in the folder myself and there is a NxCooking and PhysxLoader but no PhysxCooking.

So could you post a link to where you downloaded the SDK?

I'll get a new signature someday.
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 24th Dec 2010 21:49 Edited at: 24th Dec 2010 21:49
Yeah no problem, you need to sign up to download:
PhysX SDK

DeadTomGC
13
Years of Service
User Offline
Joined: 11th Aug 2010
Location: LU
Posted: 24th Dec 2010 22:47
I sent in a request a couple days ago and just got my account.
I downloaded the file and I'll see if it works.

I'll get a new signature someday.
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 25th Dec 2010 00:21
Cool, you can also download the visual debugger from the same place, I think its under 'tools'.

Noley
13
Years of Service
User Offline
Joined: 13th Dec 2010
Location:
Posted: 25th Dec 2010 08:46
^
Isn't the visual debugger in the fulcrum package ? =]

Matty, I don't even know what to say.. I've been playing around with Fulcrum, you are actually amazing. Just wanted to let you know :p

and thanks so much for sharing Fulcrum with the community!! =]

I am having a bit of a difficulty right now with loading an object above the ground without having to make it at height like 30 (anything less seemed to make it fall through the ground)...
I could be just being completely dumb.. but I was wondering if I could possibly email you ? Possibly have you look through some of my code to see if you notice anything wrong ?

Aside from that, AMAZING.
I would definitely be willing to pay for the Pro version when you finish everything
Noley
13
Years of Service
User Offline
Joined: 13th Dec 2010
Location:
Posted: 25th Dec 2010 18:46
LOL omg when I woke up today and had my coffee, I took another look at my code and realized why I was a little above the real ground level.

I feel like an idiot, it's extremely obvious now that it isn't like 2AM
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 25th Dec 2010 19:27
Quote: "Isn't the visual debugger in the fulcrum package ?"


I used to include it but I dont think I have this time, there is a newer version than the one I used to supply and I think you need that one for v1.4(physx 2.8.3).

Thanks for your kind comments, glad you sorted your issue, you can email me any time, just click on my name here and you can get my email.

DeadTomGC
13
Years of Service
User Offline
Joined: 11th Aug 2010
Location: LU
Posted: 9th Jan 2011 21:09
Hey, I am getting this error
on every command in the demo source code.
I Think I set up the project and resources correctly.
What am I doing wrong?

I'll get a new signature someday.
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 10th Jan 2011 17:02
At the top of the code you should create a physics object:

Then you can access the functions like:

That error just means 'phy'(or whatever you called it) does not exist.

DeadTomGC
13
Years of Service
User Offline
Joined: 11th Aug 2010
Location: LU
Posted: 11th Jan 2011 22:07
Ok, that demo's code must be a little old.

I'll get a new signature someday.
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 11th Jan 2011 22:33
Ah, is it the demo from the video with all the bouncing balls/boxes?
If so then yes, that would need to be updated, it was made with the very first version.

TechLord
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: TheGameDevStore.com
Posted: 26th Jan 2011 16:03
Hi matty,

I'm just curious if your going to go open source with Fulcrum. I would highly encourage you to do so. Mike Pryor went open source with DarkNet 2.0 and its a billion times more flexible.

Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 26th Jan 2011 22:55
I think I said some time back that I would go open source if I ever stopped working on it, I am working on a total re-write and I hope I might be able to sell it.

I wrote Fulcrum as I learnt the PhysX SDK so for that reason the source code is not very pretty. My new plug-in is far more legible and efficient so when its time to go open-source then thats the one I will use, although I would need to put in some work to document the classes and how they relate, I should really do that for myself anyway.

JulianMH
13
Years of Service
User Offline
Joined: 17th Oct 2010
Location:
Posted: 1st Feb 2011 17:28 Edited at: 1st Feb 2011 18:45
I finally managed to try out the new version of Fulcrum Physics. Obtaining the PhysX SDK has taken a lot of time, cause my spam filter ate the registration e-mail.

The collision works fine now for all meshes, but somehow everything is incredibly slow: A Scene with a terrain, one model and 4 character controllers is running with 21 FPS. With the version 1.3 of Fulcrum it was like 50 - 60 FPS. If I remove the calls to Fulcrum, the game runs with 60 FPS. Any Ideas?
"Very Sleepy", a perfomance profiling tool, reports that a function called "NpCreatePhysicsSDK" is the bottleneck. I can send you the file, if you are familiar to the tool.
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 1st Feb 2011 21:05
Strange, I will look into this, I am not familiar with that tool. That function only gets called in phy.start(), is it possible that it could be slowing it down?
Is it possible you are using the debug PhysX dll's?
Did you download PhysX 2.8.3?

Seems I have missed out the density parameter when creating shapes also so that will also be addressed.

DeadTomGC
13
Years of Service
User Offline
Joined: 11th Aug 2010
Location: LU
Posted: 13th Feb 2011 19:18
Out of curiosity, would it be possible to use dbpro plugins via the dark gdk?

I'll get a new signature someday.
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 14th Feb 2011 16:50
Quote: "Out of curiosity, would it be possible to use dbpro plugins via the dark gdk?"


I would think no, I think most plugins are written in C++ though, so they usually have a GDK counterpart as it's not much more work.

A good example is Blitz Terrain, a GDK version is due soon so I would guess that maybe GDK give the author a few little extra problems hence the delay, or he may be just writing examples/docs for GDK version.

I have not had a chance to address some of the issues people have raised with Fulcrum Physics yet, I just need to find a free weekend or something and I will release another update.

DeadTomGC
13
Years of Service
User Offline
Joined: 11th Aug 2010
Location: LU
Posted: 14th Feb 2011 17:53
Ok, Blitz was exactly what I wanted to use.

I'll get a new signature someday.
iSilver
13
Years of Service
User Offline
Joined: 20th Feb 2011
Location:
Posted: 8th Mar 2011 03:30
Hi Everyone. I'm having problems trying to use Fulcrum Physics to integrate into my Zero-G 2D (with 3D Graphics) Space Flight demo.

I was using QuickODE before which worked. Now I took out ODE to replace my Physics with Fulcrum, and I haven't been able to get things to simulate properly.



Everything just doesn't move... and I get access violation errors everytime I hit ESC!

PS: as you can see from my code I've tried everything including adding updateActor() and updateActors(), I've got simulate() and update()... I've even tried throwing in forces just to move the system - NOTHING.


Please Help


Any help would be appreciated.
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 8th Mar 2011 16:10
Hi iSilver,

Thats alot of code to get through

You don't need to call updateActor() or updateActors(), these are only there if you want to do each actor individually. This will not fix your issues though.

I see you are retro-fitting Fulcrum into your game that was currently using something else. I suggest you try writing a small program which just tests the physics part of your game, this way you will get to know the plugin, see if it can do what you need and then you will probably spot the problem yourself.

I will try to find your issue but there is alot of code and my time is limited. If you could replicate the issue with less code that would help.

Also, do you have the visual debugger set up? If not then this is what you should do first. If you do, let me know what is happening in the debugger?

iSilver
13
Years of Service
User Offline
Joined: 20th Feb 2011
Location:
Posted: 8th Mar 2011 16:44
You're right. Let me check everything out and get back to you. There's no point in you going through all that code.
iSilver
13
Years of Service
User Offline
Joined: 20th Feb 2011
Location:
Posted: 9th Mar 2011 04:25
As per your suggestion, I've restarted testing Fulcrum from scratch using the Getting Started main.cpp as basis. Still unable to apply forces to the objects. As you can see I'm trying both applyForces() and applyLocalForces()... also tried torque, still nothing.

I hope someone will be able to help.


iSilver
13
Years of Service
User Offline
Joined: 20th Feb 2011
Location:
Posted: 9th Mar 2011 05:39
OMG I solved it and now feel like an idiot!

My objects were so large that no matter how much force I applied to it they wouldn't move! I reduced the size of my objects and everything is fine now.

I seem to be feeling a lot of "friction" in the environment. Any way to get rid of that?
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 9th Mar 2011 14:33
Try these:


There is also:

Although these will be 0 as default so not causing any friction.

iSilver
13
Years of Service
User Offline
Joined: 20th Feb 2011
Location:
Posted: 12th Mar 2011 16:00
That makes sense. I'll try that out when I get home.

Sorry I haven't checked the thread lately - too busy colliding spaceships and watching them spin in 3D Doing lots of coding, too.

BTW - Matty, you rock! Fulcrum has taken such a huge load off my shoulders in terms of object interaction. I hope I don't run into too many limitations down the line.
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 12th Mar 2011 17:10
Quote: "BTW - Matty, you rock! Fulcrum has taken such a huge load off my shoulders in terms of object interaction. I hope I don't run into too many limitations down the line. "


Thanks alot iSilver.

I know what you mean about running into limitations, that can happen when using 3rd party plugins. I would suggest you prototype each aspect of your game and figure out how you are going to do everything.

Although there is a chance you are just making it up as you go, I've done that a few times in which case you always run the risk of becoming unstuck with something down the line.

Good luck with your game.

iSilver
13
Years of Service
User Offline
Joined: 20th Feb 2011
Location:
Posted: 12th Mar 2011 22:35
You're right. I'm prototype each piece of the game right now in a test bed. Got the physics going (tried Sparky's, QuickODE, and now Fulcrum which I'll be settling on unless they fix QuickODE). Next I'm going to work on some of the actual game framework, so that's all me. Then, Multiplayer (I hear that DarkNET isn't bad). Maybe Lua scripting afterwards.

I'm counting on your continual support so I can actually finish my first ever 3D game coded from scratch!
FERSIS
17
Years of Service
User Offline
Joined: 17th May 2006
Location:
Posted: 19th Mar 2011 03:37 Edited at: 19th Mar 2011 04:10
Can i ask for a feature/function?

Currently we have these nice overloads of moveCharacterController:



What i would love to be implemented is:


Its an easier way to move objects in a given angle 'yangle'(Y Angle)
What do you guys think?

This is what im doing:

It works but it would be 'cleaner' if Fulcrum had the functionality.
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 19th Mar 2011 14:35


This command overload was supposed to make it easy for you to move your character around and its pretty similar to the one you suggest, the only differece is that you turn the object with the GDK commands:



FERSIS
17
Years of Service
User Offline
Joined: 17th May 2006
Location:
Posted: 20th Mar 2011 15:32 Edited at: 20th Mar 2011 16:23
Well yeah but you have to turn the object itself.
What im doing (And kindly asking) is a way to move the object in a given angle without rotating it.

Sorry for bothering you man! Im sure you have more important features to add.
Also: Mad props for your hard work.


EDIT: By the way how do i find out if a characterController its standing still on top of something.?
ie: Jumping only when the characterController is on the ground.
Yero008
13
Years of Service
User Offline
Joined: 5th Dec 2010
Location: Romania
Posted: 27th Mar 2011 18:00
I have a question. Why in the demo when you hit the boxes they don't react(move) and the ball's do?
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 27th Mar 2011 18:46
Its the default behaviour of the character controller, it will push actors around if they are awake but if they have settled and fell asleep the character conroller treats them as static actors.

Its nothing I have done, its just the way the PhysX character controller works for some reason.

If you want to push things then use a raycast and then apply a small force if the raycast hits. I have done this in a game I made and it worked pretty well.

I think I may have provided an example where you can kick a ball around, this uses the same method.

Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 27th Mar 2011 18:49
Quote: "EDIT: By the way how do i find out if a characterController its standing still on top of something.?
ie: Jumping only when the characterController is on the ground. "


Sorry Fersis, I never saw this.

Try a raycast straight down, you can set the raycast length to just below your feet and then only jump if its hitting something.

Yero008
13
Years of Service
User Offline
Joined: 5th Dec 2010
Location: Romania
Posted: 27th Mar 2011 19:04
So if I want to move the boxes I have to use raycast?
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 27th Mar 2011 21:06
FERSIS
17
Years of Service
User Offline
Joined: 17th May 2006
Location:
Posted: 27th Mar 2011 22:39 Edited at: 27th Mar 2011 22:47
Quote: "Sorry Fersis, I never saw this.

Try a raycast straight down, you can set the raycast length to just below your feet and then only jump if its hitting something.
"


I thought the same just wanted to be sure.
Thanks good man.

Any chance of exposing some other members of the NxRaycastHit struct? (faceID,internalFaceID,materialIndex,u,v?)
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 28th Mar 2011 01:04
Getting the face information is not really as simple a process as it should be. When cooking, alot of information changes for some reason, its a PhysX thing.

I will be implementing all this stuff in my new physics plugin(probably called Dark DynamiX or DynamiX), but I'm afraid I will probably be selling that one.

What is it you are doing? When I implement this stuff in my new plugin maybe you could beta test?

FERSIS
17
Years of Service
User Offline
Joined: 17th May 2006
Location:
Posted: 28th Mar 2011 03:26 Edited at: 28th Mar 2011 03:43
Quote: "
What is it you are doing? [B]When I implement this stuff in my new plugin maybe you could beta test?[/B]
"

No problem dood.


I was reading the RayCast example i have a question about this bit:

If i want rayDirectionY to be the camera orientation i have to use this?:

(What im looking for is to raycast from the center of the camera using the camera orientation)
This is what im doing:

But rayDirectionYdoesnt work.

Sorry for so many silly questions! And thank you so much for answering them.
FERSIS
17
Years of Service
User Offline
Joined: 17th May 2006
Location:
Posted: 28th Mar 2011 03:27 Edited at: 28th Mar 2011 03:29
Sorry for the double post.
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 28th Mar 2011 17:01
Hi Fersis,

There is a trig formula to do what you want and I will see if I can find it, in the mean time I think you can do the following:

1. Move camera forward 1 unit
2. Get the current position
3. Move camera back 1 unit
4. Take one position away from the other for each axis
5. Use the result as the amount to cast the ray on each axis

I think this should work, for example:
If your camera is facing straight up you will get a difference in camera positions of (0, 1, 0), which is the direction you want to cast your ray.

FERSIS
17
Years of Service
User Offline
Joined: 17th May 2006
Location:
Posted: 28th Mar 2011 18:31 Edited at: 28th Mar 2011 18:40
You mean something like this?:


EDIT: Nope, the Y direction doesnt work.
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 28th Mar 2011 19:11
Not quite, something like this(not tested):



Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 28th Mar 2011 19:17
This is from a post on the GDK.NET forum, credit to Sven B:

Quote: "A simple "orbit" calculation would be

X = centerX + radius*cos(angleY)*cos(angleX)
Y = centerY + radius*sin(angleX)
Z = centerZ + radius*sin(angleY)*cos(angleX)

where
(centerX, centerY, centerZ) is the starting point
radius is the distance
(angleX, angleY) are the angles that will determine the position on the sphere.

They are called sphere coördinates (you can wiki it for more information), though they'll probably use the starting point as the origin.

Cheers!
Sven B"


It does work but I think I had to alter a sign somewhere to get it working.
A simpler version may look like this:



FERSIS
17
Years of Service
User Offline
Joined: 17th May 2006
Location:
Posted: 28th Mar 2011 19:38 Edited at: 28th Mar 2011 19:41
Thanks for your help.
The 'move camera' method works, i thought i was doing the same math without moving the camera oh well.
(Moving the camera to raycast sounds so wrong!)

But i cant get to work the last example:

Im sure its the missing 'minus' which gives me problems.

Thanks for all your help!
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 28th Mar 2011 20:56 Edited at: 28th Mar 2011 20:58
I tried one axis at a time and made alterations to get them working, this should do the trick:



EDIT: Note that this probably will not work if your camera rolls, although the other method should.

FERSIS
17
Years of Service
User Offline
Joined: 17th May 2006
Location:
Posted: 28th Mar 2011 22:40 Edited at: 28th Mar 2011 22:42
Well this is weird:

It doesnt work as the 'move camera' method which so far is the only method that worked fine for me.
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 28th Mar 2011 23:05
What trig functions are you using?

I used GDK ones an they return degrees, if you are using some other math library then it may be using radians.

Login to post a reply

Server time is: 2024-04-26 16:21:13
Your offset time is: 2024-04-26 16:21:13