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 / Bullet Physics Wrapper [NEW WORKING VERSION]

Author
Message
Clonkex
Forum Vice President
8
Years of Service
User Offline
Joined: 20th May 2010
Location: Northern Tablelands, NSW, Australia
Posted: 12th Sep 2011 00:55 Edited at: 12th Sep 2011 00:56
--- BULLET PHYSICS WRAPPER WIP ---

Description:

I have restarted my Bullet Wrapper. The old version and old source code can be found here. There isn't much point looking there, though, because I will be releasing the source code here as well. This post includes a working demo of the wrapper.

Have fun!

Status:

= Completed
= Work in progress
= Not started/doesn't work

Adding of rigid body dynamic boxes and spheres
Adding of rigid body static boxes and spheres
Automatic positioning and rotation of rigid bodies
Adding of convex and mesh rigid bodies (!)
Joints
Softbodies
Creation of vehicles
Character controller

The above items are not in order of what will come next.

Clonkex

Attachments

Login to view attachments
Wersolths
10
Years of Service
User Offline
Joined: 20th Jul 2008
Location: Scotland
Posted: 16th Sep 2011 16:34 Edited at: 16th Sep 2011 21:42
Looking forward to seeing this completed.
Good luck!

Just thought I would let you know that the demo doesn't work for me. I tried running the project but it comes up with an error saying "Could not understand command at line 8". Which is the "bp start" command.
Hope you can fix this.
Wersolths
10
Years of Service
User Offline
Joined: 20th Jul 2008
Location: Scotland
Posted: 16th Sep 2011 21:41 Edited at: 16th Sep 2011 21:42
<Sorry, double post. Edited the first one>
Clonkex
Forum Vice President
8
Years of Service
User Offline
Joined: 20th May 2010
Location: Northern Tablelands, NSW, Australia
Posted: 22nd Sep 2011 09:42
Sorry for not replying sooner, I recently bought a new laptop and it's becoming my dev computer, and you wouldn't believe the amount of stuff I have to copy across. It's taken hours.

I don't know why it would be doing- wait, I know why. Did you actually put the Bullet Wrapper DLL in the Compiler/plugins-user folder? That's a rather important step. You should also put the keywords file in Editor/keywords to make the commands light up.

Clonkex

Fluffy Rabbit
User Banned
Posted: 24th Sep 2011 00:16
I'm assuming there will be no DBC version? I recognize the directory structure from DarkBASIC Pro. It would be nice to get Bullet working in a language like DarkBASIC, rendering through DirectX 7.

Would it be feasible to port a physics engine like this using DarkBASIC's memblock commands?
SH4773R
9
Years of Service
User Offline
Joined: 18th Jan 2010
Location: AMERICA!!!
Posted: 24th Sep 2011 10:11
Yay! I will try this out!

Fluffy: dbc does not support plugins, so it doesn't support this

Blobby 101
12
Years of Service
User Offline
Joined: 17th Jun 2006
Location: England, UK
Posted: 29th Sep 2011 19:22
Hows this going? Really interested in the vehicles segment of this

Clonkex
Forum Vice President
8
Years of Service
User Offline
Joined: 20th May 2010
Location: Northern Tablelands, NSW, Australia
Posted: 14th Oct 2011 08:03
Hey guys,

Sorry I haven't been on here for a while, I've been busy with moving and also recently got a new laptop, which is becoming my new dev computer. It takes ages to copy stuff across.

I will be working again very soon (tonight hopefully), and I will focus heavily on vehicles, as I know WOR's current vehicles are pretty awful.

I just want to make it clear that if anyone wants anything in particular added, just ask and I will try to get it done ASAP.

Clonkex

SH4773R
9
Years of Service
User Offline
Joined: 18th Jan 2010
Location: AMERICA!!!
Posted: 14th Oct 2011 19:33
Have you added all of the collision shapes yet? If so rag dolls would be awesome! No rush

Fluffy Rabbit
User Banned
Posted: 15th Oct 2011 21:44
Quote: "Fluffy: dbc does not support plugins, so it doesn't support this "


Where did you get that crazy idea? DarkBASIC Classic supported plugins since the enhancement pack.
SH4773R
9
Years of Service
User Offline
Joined: 18th Jan 2010
Location: AMERICA!!!
Posted: 15th Oct 2011 22:40
I was unaware that the enhancement pack gave you that ability, im not sure of this supports doc or not then.

Clonkex
Forum Vice President
8
Years of Service
User Offline
Joined: 20th May 2010
Location: Northern Tablelands, NSW, Australia
Posted: 19th Oct 2011 03:39
Currently only the point2point joint is available in the wrapper, and there's no way to delete the joint or change any settings. Last night I tried adding some more joints, but the Bullet docs don't explain what some of the parameters are, and I'm just guessing. I'm just going to put the commands in. If someone can work out what the parameters are for, could you tell me? I will name them as they are named in Bullet so if someone has used Bullet before they can tell me what they are for.

If someone could point me to a webpage or tutorial explaining how to make plugins for DBC, I will have a go, but I don't have the enhancements pack so I can't really test it. I also intend to make the wrapper work for DGDK. It's the easiest product to make plugins for so I'm doing it last.

What do you mean by rag dolls? Do you mean built-in rag dolls or automatic rag dolls? When I get the joints all added and working it will be possible to make rag dolls just using standard 6DOF joints and point2point joints. In fact, that's how the Bullet demos do it. I don't know if Bullet has any dedicated rag doll code.

I need everyone to vote on this. There are two methods of doing vehicles in Bullet. One is the raycasting approximate method, which is fast and good for arcade racing games and even some simulation games, but isn't so realistic if the wheel happens to go into a hole. The other actually has separate collision shapes for each wheel and the body. It's slower but is more realistic. I need to know which method you would prefer I use - or maybe both?

Clonkex

TechLord
16
Years of Service
User Offline
Joined: 19th Dec 2002
Location: TheGameDevStore.com
Posted: 21st Oct 2011 18:26
Quote: "I need everyone to vote on this. There are two methods of doing vehicles in Bullet. One is the raycasting approximate method, which is fast and good for arcade racing games and even some simulation games, but isn't so realistic if the wheel happens to go into a hole. The other actually has separate collision shapes for each wheel and the body. It's slower but is more realistic. I need to know which method you would prefer I use - or maybe both?"
Both of course. They are in Bullet for a reason and you never know how clever developers can be using these methods beyond their purpose.

Clonkex
Forum Vice President
8
Years of Service
User Offline
Joined: 20th May 2010
Location: Northern Tablelands, NSW, Australia
Posted: 23rd Oct 2011 10:05
Oh, I know, I was just hoping no one would say that

It a lot more work to add both, that's all. And what with sanding the floors as well....

Clonkex

Clonkex
Forum Vice President
8
Years of Service
User Offline
Joined: 20th May 2010
Location: Northern Tablelands, NSW, Australia
Posted: 11th Nov 2011 04:10 Edited at: 11th Nov 2011 04:34
Ok, sorry for not replying for ages. I have actually been working on the plugin, but it's not ready for an update yet. We're moving, maybe to Newcastle or Stanthorpe or- well, basically I have no idea yet. I've been sanding floors and painting and replacing kitchen cupboards and horrid stuff like that, so the next update might be a while. Don't worry, though, it will come!

EDIT: I just thought of a way to make ragdolls completely automatic! It will mean there will be no manual positioning of cylinder collision thingies! I will research some more and see what I can do.

Clonkex

Clonkex
Forum Vice President
8
Years of Service
User Offline
Joined: 20th May 2010
Location: Northern Tablelands, NSW, Australia
Posted: 5th Dec 2011 05:20
I know this will mean a triple-post, but I 1) need to keep this thread open and 2) want to tell you I'm now working hard on getting an update ready for you. I have added several new joints now that I know the point2point joint is actually working. I have also fixed several little bugs in the positioning and rotation commands and corrected the order of the rotation angles returned from BP Get Angle X/Y/Z.

After I have finished adding all of Bullet's joints ("constraints", as they're known in the Bullet manual), I will be working on vehicles. I intend to make the vehicle creation system the best ever seen in DBPro. It will allow you to make wheels from limbs (the method used in the Dark Matter vehicles) or from separate objects (the method used by the Newton wrapper).

I am going to add new versions of the creation commands to allow you to make compound objects from object with multiple limbs (good for ragdolls) and new versions to allow you to manually specify the sizes for the rigid bodies.

The most trouble I've had so far has been trying to work out what the parameters in the joint creation commands are for. I have no idea what useReferenceFrameA does or even what FrameA is. The Bullet manual is not very helpful with that sort of thing and the commands are, for the most part, uncommented.

Anyway I have to go now. Forgive me for the triple-post

Clonkex

gwheycs62egydws
9
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 5th Dec 2011 05:47
Clonkex

I tried to run the compiled exe
nothing showed up

I created an exe and still nothing showed up

I watched the windows task manger
and the compiled showed up but there was no program showing up

I'm thinking the matrix utility is causing conflicts as it has
with other program in the past

to move side ways - is to move forward
Since a Strait line gets thin fast
gwheycs62egydws
9
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 5th Dec 2011 05:56
@Clonkex

one other thing
the following code is sitting out side
of the main loop



if thats ware it should be going then thats one reason
it is ending

to move side ways - is to move forward
Since a Strait line gets thin fast
Clonkex
Forum Vice President
8
Years of Service
User Offline
Joined: 20th May 2010
Location: Northern Tablelands, NSW, Australia
Posted: 13th Dec 2011 02:15
I've never had any problems whatsoever with the Matrix1Utils plugins. Since it runs fine on my computer it can't be the code.

What are your system specs? Does the program window appear at all?

I can't think of any reason why you wouldn't be able to see the window...

Clonkex

gwheycs62egydws
9
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 14th Dec 2011 05:10
@Clonkex

my system is

win xp sp3
2 gb ram
1 gb nvida video

DBP 7.61

I do have a bug when I run dbp and a few other programs

The procedure entry point_hander4_common could not be located
in the dynmic link library msvcrt.dll

the problem seams to show up when I installed the demo version of
Adobe Photoshop CS5.1

to move side ways - is to move forward
Since a Strait line gets thin fast
gwheycs62egydws
9
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 14th Dec 2011 05:18
Clonkex

every other program I've compiled or run built thought DBP
has run even it shows errors

I get nothing showing up

other than when I look at
Task Manager

run the compiled exe in the attachment

to move side ways - is to move forward
Since a Strait line gets thin fast

Attachments

Login to view attachments
gwheycs62egydws
9
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 14th Dec 2011 05:32
@Clonkex

take a look at the code below

I took out your addition and it compiled and ran




what version of DBP are you using ?

to move side ways - is to move forward
Since a Strait line gets thin fast
Clonkex
Forum Vice President
8
Years of Service
User Offline
Joined: 20th May 2010
Location: Northern Tablelands, NSW, Australia
Posted: 21st Dec 2011 09:24 Edited at: 21st Dec 2011 09:30
Was changing this line...



...the only thing you did? If so, then my theory is that DBPro is not correctly detecting your desktop resolution and is setting it incorrectly (probably to something really big or really small, even zero perhaps). I don't know why this would make the window invisible but clearly it does.

I am using the latest version of DBPro (the same as yours, I think).

To test, use this code and tell me what the printout says:



Clonkex

gwheycs62egydws
9
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 21st Dec 2011 11:33
@Clonkex

well it ran but would only show the objects when the mouse was off the screen

it's a good thing I do not suffer from the flickering that was happening

and I could only get the stats about video when I manually set debug to 1

the graphics card name was not shown

if your dll has to do with using msvcrt.dll

I've got a few program that will not work or pop up and error but run after
I press ok

to move side ways - is to move forward
Since a Strait line gets thin fast
gwheycs62egydws
9
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 28th Dec 2011 14:25
@Clonkex


any posobilty of you posting a video
of "BULLET PHYSICS WRAPPER" ?

So i can see what things look like in action

to move side ways - is to move forward
Since a Strait line gets thin fast
Clonkex
Forum Vice President
8
Years of Service
User Offline
Joined: 20th May 2010
Location: Northern Tablelands, NSW, Australia
Posted: 18th Jan 2012 04:55
Quote: "any posobilty of you posting a video
of "BULLET PHYSICS WRAPPER" ?"


Yeah, I'll see what I can do, but it may be a while in coming.

To everyone:

At this point in time this Bullet Wrapper post is dying. I have been way too busy to work on it (we're moving house) and I still have trouble understanding how certain aspects of Bullet work (joints, for example). I will post again if I ever get the time to finish it properly. Very sorry to disappoint

Clonkex

Cetobasilius
9
Years of Service
User Offline
Joined: 29th Dec 2009
Location: Mexico
Posted: 25th Jan 2012 13:01
How is it going? any new updates?

hi
gwheycs62egydws
9
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 27th Apr 2012 19:38
@Clonkex

hi

I got a new maxed out laptop computer about a month ago
running windows 7

I tried your dll again
but it will not show any results

either there is a conflict with one of the other additions I have
or there is some thing wrong with what you built

I get no error reporting
it all looks like it doing some thing but nothing shows up

to move side ways - is to move forward
Since a Strait line gets thin fast
Clonkex
Forum Vice President
8
Years of Service
User Offline
Joined: 20th May 2010
Location: Northern Tablelands, NSW, Australia
Posted: 26th May 2012 01:32
@Cetobasilius:

Sorry, no updates. I don't understand how anyone uses Bullet. I can't work out what most of the parameters for the joints are for and the documentation doesn't help.

Hi to you too

@Resourceful:

Interesting... I have no idea what the problem would be... Hmmm.... Try this:

Create a new project and name it whatever.
Copy the code from my example project and paste into this new project.
Compile and run.

If that works, then maybe it's something to do with the way I have the project settings set up. Otherwise, I have absolutely no idea why it wouldn't work perfectly on a near-new laptop.

Clonkex

Dar13
11
Years of Service
User Offline
Joined: 12th May 2008
Location: Microsoft VisualStudio 2010 Professional
Posted: 26th May 2012 01:54 Edited at: 26th May 2012 01:56
Here's how I use Bullet hinges in C++:


It requires two rigid bodies. The two pivots are where the two sides of the hinge are mounted. In my example, the first pivot is the connection point to my static (btBvhTriangleMesh) level, and the second pivot is the point that the other end of the hinge is attache to. Both pivots are local to their respective rigid bodies. The two axis set the axis that the hinge rotates around. In my example, the hinge rotates around the y-axis.

The hinge won't work if it's not added to the physics world, and needs to be deleted upon world clean-up. The limits are based off the initial orientation of the rigid body which is usually based off of the graphics representation.

Also keep in mind that Bullet uses a right-handed coordinate system while DBPro and DarkGDK use left-handed coordinate systems.

To have the hinge move, you apply a torque impulse to the dynamic rigid body or enable the angular motor with the appropriate parameters.

If you need any other tips on using Bullet, I'll either be here or in the Posting Competition.

EDIT: Sorry for stretching the page. Should be fixed now.

gwheycs62egydws
9
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 26th May 2012 03:46
@Clonkex

I removed the "Bullet Wrapper.dbpro" file

still nothing shows up on the screen

all key words are being highlighted

if there was a conflict with one of the other dll's
I should be told but I am not seeing any thing

I'm running DBP 7.62 now

to move side ways - is to move forward
Since a Strait line gets thin fast
Clonkex
Forum Vice President
8
Years of Service
User Offline
Joined: 20th May 2010
Location: Northern Tablelands, NSW, Australia
Posted: 27th Jun 2012 01:51
@Dar13:

Sorry for not getting back to you for so long - but thanks!! I'll definitely give that a try as soon as I can!

@Resourceful:

Hmm....you're just not having much luck with this, are you? Err...could you possibly send a screenshot of...hangon, follow these steps:

1) Open DBPro.
2) Create a new project and call it anything.
3) Paste the following code in the new project:

4) Run the project and tell me if you see a cube, spinning. If you do, could you run my Bullet Wrapper's example project and take a screenshot of it, please?

To take a screenshot, I find the free version of Fraps works well - otherwise, just press Ctrl+PrtScrn, open Paint, press Ctrl+V and save.

Clonkex

gwheycs62egydws
9
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 27th Jun 2012 02:43
@Clonkex

it would appear so ;o(

your example code posted "26th Jun 2012 11:51" dose work
the only thing missing was sync command before the loop command

it moved the box 1 unit and just sits there

I'm running DBP 7.62 at this point

to move side ways - is to move forward
Since a Strait line gets thin fast
gwheycs62egydws
9
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 27th Jun 2012 02:49
@@Clonkex

I can run the exe in the example but nothing shows up

the exe I build runs but nothing shows up

both windows xp and windows 7 produce the same results nothing

are either of my windows missing some dll your windows has ?

have you tweaked your windows some how ?

to move side ways - is to move forward
Since a Strait line gets thin fast
Clonkex
Forum Vice President
8
Years of Service
User Offline
Joined: 20th May 2010
Location: Northern Tablelands, NSW, Australia
Posted: 27th Jun 2012 11:24
Quote: "the only thing missing was sync command before the loop command "


Oops Will edit previous post

Quote: "it moved the box 1 unit and just sits there"


....err....ok...that's kind of weird... there should be no problem whatsoever, yet DBPro just doesn't seem to want to work for you...

I will research this problem some more - I have many computers with many different versions of Windows, so I'll test on them all.

Clonkex

gwheycs62egydws
9
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 28th Jun 2012 03:21
@Clonkex

umm should it not be



that makes it move

to move side ways - is to move forward
Since a Strait line gets thin fast
Clonkex
Forum Vice President
8
Years of Service
User Offline
Joined: 20th May 2010
Location: Northern Tablelands, NSW, Australia
Posted: 1st Jul 2012 07:23
Ooh sorry my bad Forgot yrotate didn't ADD but SET. Will remember to check it properly next time

Clonkex

gwheycs62egydws
9
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 1st Jul 2012 08:02
@Clonkex

I guess that would be the twist on all this lol

to move side ways - is to move forward
Since a Strait line gets thin fast
Clonkex
Forum Vice President
8
Years of Service
User Offline
Joined: 20th May 2010
Location: Northern Tablelands, NSW, Australia
Posted: 1st Jul 2012 08:55
gwheycs62egydws
9
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 1st Jul 2012 09:01
@Clonkex

I know your ahead of me on the high end programing ;o)
but I guess once in a wile the simple stuff eludes you ;oP

to move side ways - is to move forward
Since a Strait line gets thin fast
Clonkex
Forum Vice President
8
Years of Service
User Offline
Joined: 20th May 2010
Location: Northern Tablelands, NSW, Australia
Posted: 1st Jul 2012 11:05
Lol It does all too often

I'm still running various tests on different computers to try to emulate the problem your having, but so far without success I have a few more things I can try, though.

Clonkex

Login to post a reply

Server time is: 2019-05-19 20:27:02
Your offset time is: 2019-05-19 20:27:02