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.

Program Announcements / Tokamak Physics Wrapper - now available!

Author
Message
Ron Erickson
Moderator
21
Years of Service
User Offline
Joined: 6th Dec 2002
Location: Pittsburgh, PA, USA
Posted: 29th Mar 2004 00:21
LOL @ Hoowwlly Cow

Andrew,
There is no way to change the gravity settings once you set up the simulator. It is a limitation of Tokamak, not the wrapper. I am not sure why you would want to do this anyway. If you REALLY need something like that, you could apply a force to each of your rigid bodies every loop.

The TOKs_SetStaticMesh takes the following parameters: Pointer to vertices information, Number of vertices, Pointer to triangle information, Number of triangles. The example 3 that I have in the download DOES use a memblock mesh. A memblock mesh has a bunch of additional information that is not used my Tokamak though (such as normals). The function that I have set up in example 3 strips the needed info from a memblock mesh and dumps it into other allocated memory. The memblock is then deleted.

You can only have ONE mesh. With the way it is set up though, there is no reason why you can't load more than one memblock and dump all of their vertex/triangle info into the Tokamak memory block. So, no you can't have more than one static mesh, but you can use more than one model to create it. If you need to do this, try modifying the funtion in example 3. If you can't do it, let me know and I'll give it a go.

Ron

Hoooowwwwllll!!!!
andrew11
21
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: United States
Posted: 29th Mar 2004 00:41 Edited at: 29th Mar 2004 01:16
@WOLF

Thanks That clears alot up for me. I was thinking, say i wanted to make a game like Sonic adventure 2 Battle, if youve ever played that, theres a level that has many buttons, and stepping on them allows you to change the gravity (Up, Down, Left, Right). Also, say my character was on the moon, gravity would be much less than say Jupiter lol..

I think i can figure out the mesh stuff. Im just not sure about the vertex and triangle data.

Vertex
o X#
o Y#
o Z#
o ????

Triangle
o Vertex 1 ??
o Vertex 2 ??
o Vertex 3 ??
o Material??
o ???
o ???

Id just like to know what the info is, so i can do it myself.

Also, does it simulate centrufugal force? I.E. A roller coaster in a loop de loop.

"All programmers are playwrites and all computers are lousy actors" -Anon
Ron Erickson
Moderator
21
Years of Service
User Offline
Joined: 6th Dec 2002
Location: Pittsburgh, PA, USA
Posted: 29th Mar 2004 02:22
Basicly it works like this:
The vertex info is the X,Y,Z coordinate of each vertex. Don't worry about the extra info point on the vertex. It is for user data that isn't really usefull from the wrapper at this point.
All that does though is store all of the locations of all of the vertices. The triangle/poly info sotres how to connect all of the vetices. So, the first vetex in your list would be vertex 0. The second one would be vertex 1. The third one would be vertex 2, and so on. When you input the triangle info you would connect the dots to make a trangular poly. Say you wanted to make a poly out of vertex 0, 1 and 2. In your vertex/poly info, you would store it like:
Vertex 1: 0
Vertex 2: 1
Vertex 3: 2
If you wanted make a poly with vertices 6,7 and 8 you would do it like this:
Vertex 1: 6
Vertex 2: 7
Vertex 3: 8

Simple stuff.

The only other part of the trinagle/poly info that you have to worry about is the material. I'm not sure how much you have dabbled with Tokamak yet, but you can set up different materials with the TOKs_SetMaterial command (which has friction and restitution properties). Well, not only can you assign those materials to your rigid and animated bodies, but you can asign it to each "poly" of your static mesh via the material option. Cool, huh?

Just to note:
When using memblock meshs, DBpro stores the info in the FVF format. So basicly it stores it by poly. Each poly has 3 vertices. If you have 2 poly's that share vertices, it still stores 6 sperate vertices (3 for each poly). As you can imagine, that is not the most efficient way of doing things. At my first go at implementing this feature in the wrapper, I attempted a check to see if vertices already existed to save on some memory. The cost came in loading times. Since then I've come up with another idea to speed up the process, but I have yet to try it. If (when) I do get it working, I'll post up the function. The existing function does work well though, so this isn't too high on my priority list.

Ron

Hoooowwwwllll!!!!
andrew11
21
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: United States
Posted: 29th Mar 2004 02:52 Edited at: 29th Mar 2004 02:56
Thats amazing. So i could have my Terrain Ice? Or Rock, or grass...
I understand now!

Uhh.. I have more questions.. I hope you dont mind..

Is there a way to apply an impulse relative to the object rotation? I.E. A car's engine applies force in the direction the car is facing, not the X,Y,Z of the universe.

Thanks alot!

I was playing around with it, and I noticed that rotating an object against another causes it to move. Just like real life! You could make a car move by actually rotating the wheels!!

"All programmers are playwrites and all computers are lousy actors" -Anon
Ron Erickson
Moderator
21
Years of Service
User Offline
Joined: 6th Dec 2002
Location: Pittsburgh, PA, USA
Posted: 29th Mar 2004 03:51
Yes you could have your terrain be rock, or ice or grass. You could also make it be rock, and ice and grass. The material assignment is per poly, so you can actually assign a DIFFERENT material to each poly of your terrain.

As for your question, do you know anything about vectors or rotation matrices (preferably rotation matrices)?
Well, I'll assume that you don't and give you a REALLY QUICK explanation of what they are. A rotation matrix stores 3 points. The first is one unit on the X asis so it's XYZ location would be 1,0,0. The second point is one unit on the Y axis, so it's XYZ location would be 0,1,0. The thirs is one unit on the Z axis, so it's location would be 0,0,1. As you rotate your object around those marker positions update.
DBpro dosn't have access to rotation matrices. My other plugin, EZrotate is perfect for this task though. You can set up EZrotate with your object's current orientation, then retrieve matrix info for it.
Now, how do you use it? Say you wanted to apply an impulse of on the objects local Z axis. You would apply the impulse to all axis's multiplied by the corresponding matrix info.
So the impulse would be:
Xaxis# = impulse*EZro_GetMatZX()
Yaxis# = impulse*EZro_GetMatZY()
Zaxis# = impulse*EZro_GetMatZZ()
TOKrb_ApplyImpulse Rbno,Xaxis#,Yaxis#,Zaxis#
If you wanted to apply it on the Y axis it would be:
Xaxis# = impulse*EZro_GetMatYX()
Yaxis# = impulse*EZro_GetMatYY()
Zaxis# = impulse*EZro_GetMatYZ()
TOKrb_ApplyImpulse Rbno,Xaxis#,Yaxis#,Zaxis#

I hope that clears up your question. If you need further explanation, I could try.

As for your thoughts of the car working...
You wouldn't believe how well it actually does work. Using joints you can set it up pretty easily. I am working on a "car" example at the moment. When you apply torque to the rear wheels, they spin. The friction between the tires and the ground pushes the vehicle forward. This causes the front wheels to spin. When you turn the front wheels, the friction of the tires allows steering. It isn't the *easiest* thing to set up in the system, but it is a lot easier than writing actual car physics. It looks really cool to

Hoooowwwwllll!!!!
andrew11
21
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: United States
Posted: 29th Mar 2004 05:56
Yeah, Ive tried EZRotate. Awesome, too. Thanks for your help!

"All programmers are playwrites and all computers are lousy actors" -Anon
Ron Erickson
Moderator
21
Years of Service
User Offline
Joined: 6th Dec 2002
Location: Pittsburgh, PA, USA
Posted: 29th Mar 2004 14:40
I'm glad I could help.

Here are the features that have to be implemented in the wrapper yet:
-Collision table access
-Controllers
-Sensors
-Rigid Particles
-Breakage

I'm going to start working on collsion table access today. Sweenie already has that implemented in the BB wrapper, so I should have a head start and it shouldn't take too long. Look for the next version soon.

Hoooowwwwllll!!!!
Ron Erickson
Moderator
21
Years of Service
User Offline
Joined: 6th Dec 2002
Location: Pittsburgh, PA, USA
Posted: 29th Mar 2004 16:52 Edited at: 29th Mar 2004 16:55
edit

EZrotate!
Tokamak Physics Wrapper!
andrew11
21
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: United States
Posted: 29th Mar 2004 23:50
How exactly do joints work anyway? I cant figure it out.

"All programmers are playwrites and all computers are lousy actors" -Anon
Ron Erickson
Moderator
21
Years of Service
User Offline
Joined: 6th Dec 2002
Location: Pittsburgh, PA, USA
Posted: 30th Mar 2004 05:28
Hamish posted up an example on the LLRGT forums. The Tokamak physics thread is about 12 pages long there, so you might have to dig a little bit for it.
Here is a link to LLRGT:
http://www.dannywartnaby.co.uk/rgt/

I'll soon have some other examples for joints ready.
Here is another thread that might help also:
http://darkbasic.thegamecreators.com/?m=forum_view&t=28774&b=1
Sorry, I can't help more right now, but I'm short on time...

EZrotate!
Tokamak Physics Wrapper!
andrew11
21
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: United States
Posted: 30th Mar 2004 05:32
Thanks!

No need to say sorry! I should say sorry for taking your time! Thanks!

"All programmers are playwrites and all computers are lousy actors" -Anon
Ron Erickson
Moderator
21
Years of Service
User Offline
Joined: 6th Dec 2002
Location: Pittsburgh, PA, USA
Posted: 30th Mar 2004 07:23 Edited at: 30th Mar 2004 07:26
Actually, I appreciate the feedback, even if it is the form of questions, so no problem, ask away
In fact, in a strange sort of way you are doing me a favor. Once I start putting some tutorials together the first thing that I am going to do is search through the questions that have been asked.

Well, hopefully tomarow the next version of the wrapper will be ready. It adds:
-Rigid Particles (basicly just rb's that don't colide with each other)
-Complete access to collision table
-General updates (such as changing the joint limitations to use degrees instead of radians).

EZrotate!
Tokamak Physics Wrapper!
Ron Erickson
Moderator
21
Years of Service
User Offline
Joined: 6th Dec 2002
Location: Pittsburgh, PA, USA
Posted: 30th Mar 2004 14:57 Edited at: 30th Mar 2004 15:00
Just added something else:
-User Data

Now you can assign user data to your Tokamak objects. How is this usefull? Well, it allows you to attach your DB object number to RB's, AB's and Geom's. It really comes in handy when working with the collision table among other things.

New version *should* be ready today

EZrotate!
Tokamak Physics Wrapper!
Ron Erickson
Moderator
21
Years of Service
User Offline
Joined: 6th Dec 2002
Location: Pittsburgh, PA, USA
Posted: 30th Mar 2004 22:43
Another new version of the wrapper is now available!
Get version 1.03 at my site:
http://www.ericksonline.com

This update includes:
-Added Access to Collision Tables which adds the following commands:
TOKs_CollisionPointer
TOKs_SetColResponse
TOKs_GetCollisionCount
TOKab_SetCollisionID
TOKab_GetCollisionID
TOKrb_SetCollisionID
TOKrb_GetCollisionID

See example 4 for usage and Collision Table info.

-Added User Data Fields to Animated Bodies, Rigid Bodies and Geometries:
TOKab_SetUserData
TOKab_GetUserData
TOKrb_SetUserData
TOKrb_GetUserData
TOKg_SetUserData
TOKg_GetUserData

User data can be used to store an integer with the body/geom. This is usefull to
add things such as the DBpro Object number to the body/geom.

-Added Rigid Body Particles.
TOKrb_CreateParticle
Particles do not collide with each other.

-Modified the Joint Limits commands to be in Degrees instead of Radians.

EZrotate!
Tokamak Physics Wrapper!
Ron Erickson
Moderator
21
Years of Service
User Offline
Joined: 6th Dec 2002
Location: Pittsburgh, PA, USA
Posted: 31st Mar 2004 22:26
WOW! What a huge response!
Oh well... lol

The next version of the wrapper will include sensors and should be available Friday. To updates in one week! Could that be humanly possible???

After that I just have to add breakage, which shouldn't be too hard. I had a look into controllers last night and from what I can see they are pretty useless. I don't think there is any point in adding them.

EZrotate!
Tokamak Physics Wrapper!
andrew11
21
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: United States
Posted: 1st Apr 2004 06:19 Edited at: 1st Apr 2004 06:20
Sorry, ive been busy working with it rather than posting on the forums! The collision stuff is cool, and now i can add sounds when my objects collide! Its awesome. Havent tried particles yet.

"All programmers are playwrites and all computers are lousy actors" -Anon
Ron Erickson
Moderator
21
Years of Service
User Offline
Joined: 6th Dec 2002
Location: Pittsburgh, PA, USA
Posted: 1st Apr 2004 13:10
Quote: "Havent tried particles yet."

Neither have I. lol

EZrotate!
Tokamak Physics Wrapper!
K1W1
20
Years of Service
User Offline
Joined: 31st Dec 2003
Location: NZ
Posted: 1st Apr 2004 14:36
I've barely started using your wrapper, Wolf, and will no doubt have questions in the future. From what I've seen, it looks like an amazing tool that will enhance DBPro no end. Thanks for your work, its appreciated.

Just a quick(probably dumb) question - I've applied an impulse to an object which rolls over a matrix. I want it to stop dead at the press of a button, but I cant seem to stop the impulse from acting. I've tried applying an impulse with "0,0,0" as the force, which doesnt stop the object from moving, either.

Thanks.
Ron Erickson
Moderator
21
Years of Service
User Offline
Joined: 6th Dec 2002
Location: Pittsburgh, PA, USA
Posted: 1st Apr 2004 15:04
The apply impulse commands will add to the velocity that the object already has. So adding an impulse of 0,0,0 has absolutely no effect.
What you want to do is use the TOKrb_SetVelocity command. This command will set the velocity of the object to whatever you tell it. If you set the velocity to 0,0,0 then your object will stop.

EZrotate!
Tokamak Physics Wrapper!
K1W1
20
Years of Service
User Offline
Joined: 31st Dec 2003
Location: NZ
Posted: 1st Apr 2004 15:50
Thanks.
Just getting to grips with the basic commands & already the possibilities seem enormous.
I'll say it again, its amazing! Great work!
andrew11
21
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: United States
Posted: 2nd Apr 2004 05:36 Edited at: 2nd Apr 2004 05:38
How can I temporarily "hide" a tokamak object? So that it does not affect any others? To explain, "Hide object" visably hides an object. Is there a command such as "Hide Rigid Body" or "Disable Rigid Body"?

"All programmers are playwrites and all computers are lousy actors" -Anon
Ron Erickson
Moderator
21
Years of Service
User Offline
Joined: 6th Dec 2002
Location: Pittsburgh, PA, USA
Posted: 2nd Apr 2004 13:34
If you set up sepearate collision ID's for each of your RB's, you could possibly set the object's velocity to zero, then disable the collision response. There is also the capability to Enable or Disable gravity on a RB that you would need, which I have to add to the wrapper yet.
So, in short, I don't think there is an EASY way to do it. In fact, I don't know that it would even be possible in the wrappers current state.
I'll be adding the Enable/Disable gravity in the next version of the wrapper.

It might still be a couple days before I can finish the sensors. Sensors seem to be bugged in Tokamak. There is a way to get them to work, but it is quite involved. I want to make it as transparant and simple for the user as possible so I have to do some playing around before release the next version.

EZrotate!
Tokamak Physics Wrapper!
Scraggle
Moderator
21
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 2nd Apr 2004 18:52
Hi Wolf!

I have downloaded the Tokamak stuff and I have seen the demo's and now I would like to use the plugin my current project. However, I have no idea where to start!

I realise that you have not had time to write any documentation yet, so, is there anway I can learn what all the commands do?
Maybe a website somewhere that would have similar commands to the DarkBASIC ones?

I have tried 'reverse engineering' from the demo code but it is not very easy and doesn't cover everything.

Any help at all would be greatly appreciated

Thanks

Ron Erickson
Moderator
21
Years of Service
User Offline
Joined: 6th Dec 2002
Location: Pittsburgh, PA, USA
Posted: 2nd Apr 2004 22:44
Scraggle,
Sorry I can't really help you more at this point. All I can say is work through the demos, read the posts on this thread and read the thread on LLRGT.
I'll document more as soon as I can. If there is anything specific that you are having trouble with I could try to answer, but a rundown of the whole thing isn't possible in a few minutes. Sorry, I'll have some better doc's soon though...

EZrotate!
Tokamak Physics Wrapper!
andrew11
21
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: United States
Posted: 6th Apr 2004 02:58
When are you going to be done with the next version? I really need to disable gravity for a particular rb! Cant wait!!!

"All programmers are playwrites and all computers are lousy actors" -Anon
Ron Erickson
Moderator
21
Years of Service
User Offline
Joined: 6th Dec 2002
Location: Pittsburgh, PA, USA
Posted: 6th Apr 2004 05:26
Well...
I did add that over the weekend.
I was trying to add sensors first, but I ran into some bugs in Tokamak that has made it more than difficult. I worked on that a good bit of last week and over the weekend. When I realized how difficult it was going to be, I spent some time adding some other missing commands like the gravity. I also spent some time going through the helpfiles and updating them and I've added quite a bit to them. I wanted to release the new and improved help files with the next release, but I guess they can wait.
Just for you, I'll try to release the next version tomarow, or Wednesday at the latest. It won't be a BIG feature filled release though....

WOLF

EZrotate!
Tokamak Physics Wrapper!
treborguy
21
Years of Service
User Offline
Joined: 24th Sep 2003
Location: The trendy club
Posted: 6th Apr 2004 17:25
I think the wrapper's great, good job, only, i'd like to know if there were any explanations of how to use the program, i'm doing fine with it so far, but the joint commands are puzzling, when is the version withslide joints going to be ready?

Brains are for idiots
Ron Erickson
Moderator
21
Years of Service
User Offline
Joined: 6th Dec 2002
Location: Pittsburgh, PA, USA
Posted: 6th Apr 2004 18:04
As soon as I can get it done
Just to let you know, I haven't even tried using slide joints yet myself. I've done some investigating on the Tokamak forums and I've heard that the slide joints don't work properly within Tokamak.
I have two or three main updates to do yet. One will add sensors, one will add breakage, and then I'll probably have a general update to catch anything that is missing. Then my main concentration will be documenting.
Like I said earlier, I've been working on the documentation as much as I can when I can. I hope to update my site later today with the new docs that I have complete. I'm also working on a tutorial/user guide. The first part of that is almost complete. Believe it or not, I've been very busy and getting a lot done behind the scenes!

Speaking of which, I got an e-mail from Sweenie today. He said that he was able to get the sensors working on his Blitz3d version of the wrapper. He gave me some direction as to how he did it and I might take another shot at it later. I was on the right path, but didn't get far enough with it to see if how I was doing it would work. So, sensors WILL be added shortly!

EZrotate!
Tokamak Physics Wrapper!
treborguy
21
Years of Service
User Offline
Joined: 24th Sep 2003
Location: The trendy club
Posted: 6th Apr 2004 18:23
I can understand tha u've had ur work cut out 4 u, and it's all been worth it, so, i was just wondering, because i've seen this one pragram using tokamac that has a small truck driving around that has full suspension and it works just fine. It doesn't seem like the people on the tokamac forums have much of a problem with the slide joints.

But you're making some tutorials and that's really all i need at this stage. gd luck with the rest of ur work and don't give up on programs half way thru like most of the ppl on this site

One more thing. What would be the most suitable way of making a wheel for a simple buggy with the physics wrapper, something that will stay in one position in relation to the buggy and just rotate.

treborguy

It's the honest ones you can trust, honest.
Ron Erickson
Moderator
21
Years of Service
User Offline
Joined: 6th Dec 2002
Location: Pittsburgh, PA, USA
Posted: 6th Apr 2004 19:08
Use a hinge joint. I think it's rotation has to be set to 0,0,90.

Let me dig out some code for you from the car demo I was working on....



I don't think they actually use a slide joint. I can't remember off hand how they do it, I'll have to look again. I know they use sensors to determine the force acting on the wheel to simulate suspension, but I can't remember how they do the actual joint. hmm... now you have me curious

EZrotate!
Tokamak Physics Wrapper!
Ron Erickson
Moderator
21
Years of Service
User Offline
Joined: 6th Dec 2002
Location: Pittsburgh, PA, USA
Posted: 6th Apr 2004 19:31
This info might be usefull to

When creating a joint:
TOKj_Create ConnectionType,BodyA,BodyB
ConnectionType =
1 Rigid Body to World
2 Rigid Body to Rigid Body
3 Rigid Body to Animated Body

When setting the Joint Type:
TOKj_SetType Joint,JointType
JointType =
1 Ball/Socket
2 Not used - ignore
3 Hinge
4 Slide

EZrotate!
Tokamak Physics Wrapper!
Hamish McHaggis
21
Years of Service
User Offline
Joined: 13th Dec 2002
Location: Modgnik Detinu
Posted: 6th Apr 2004 21:44
I have been told that slide joints also do not work, it's just a placeholder.

Trying is the first step towards faliure.
Athelon XP 1600+/Radeon 9600 Pro/256 RAM
treborguy
21
Years of Service
User Offline
Joined: 24th Sep 2003
Location: The trendy club
Posted: 6th Apr 2004 22:04 Edited at: 6th Apr 2004 23:12
Thanks ,if they didn't use a slide joint they must have used a hinge joint as a sort of spring for the wheels. like if you bend a rubber it will spring out.

I'm trying to attach my wheel to the body of the car, but when i use the enable command it screws up and objects start falling through the "animated body" and also the setpositionworld command i dont understand.

I can't get the joint to attach the 2 objects, they're as unnatached as always.

Brains are for idiots
Cpt Caveman
22
Years of Service
User Offline
Joined: 29th Aug 2002
Location: New Zealand
Posted: 7th Apr 2004 13:59
Has anyone had any luck doing a simple car demo, or a box driving over terrain(without wheels), that jumps and can roll if it lands sideways etc. I just want to see what it looks like. Maybe I'll just have to give it ago over the weekend
Ron Erickson
Moderator
21
Years of Service
User Offline
Joined: 6th Dec 2002
Location: Pittsburgh, PA, USA
Posted: 7th Apr 2004 16:21
I started working on a car demo and it was going fairly well. I've been too busy working on the wrapper and some documentation to finish it off though

EZrotate!
Tokamak Physics Wrapper!
Ron Erickson
Moderator
21
Years of Service
User Offline
Joined: 6th Dec 2002
Location: Pittsburgh, PA, USA
Posted: 7th Apr 2004 23:20
Version 1.04 is now available. It's not a large update, but does include a couple of missing commands.

Head over to my site and get it.
http://www.ericksonline.com

The next version will have sensors and breakage. It should be ready within a couple of days!

Ron

EZrotate!
Tokamak Physics Wrapper!
andrew11
21
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: United States
Posted: 8th Apr 2004 02:08
YES!!! Couldnt wait for this one. Really needed gravity disabling. Great work!! Cant wait for the next one.

"All programmers are playwrites and all computers are lousy actors" -Anon
treborguy
21
Years of Service
User Offline
Joined: 24th Sep 2003
Location: The trendy club
Posted: 8th Apr 2004 20:23
what upgrades does it have?

(I don't want to download it first)

Brains are for idiots
andrew11
21
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: United States
Posted: 8th Apr 2004 20:56
What do you mean "What upgrades"? I dont understand.

"All programmers are playwrites and all computers are lousy actors" -Anon
treborguy
21
Years of Service
User Offline
Joined: 24th Sep 2003
Location: The trendy club
Posted: 8th Apr 2004 20:59
soz, that wasn't very clear, what are the extra commands does it have?

Brains are for idiots
treborguy
21
Years of Service
User Offline
Joined: 24th Sep 2003
Location: The trendy club
Posted: 8th Apr 2004 21:30
soz, don't bother answering, i realise now

Brains are for idiots
Ron Erickson
Moderator
21
Years of Service
User Offline
Joined: 6th Dec 2002
Location: Pittsburgh, PA, USA
Posted: 8th Apr 2004 21:51
Yeah, it wasn't a real big update this time. I mostly just released it so Andrew would have his Gravity commands available to him.

The next release should be a biggie. It should have both breakage (already added ) and sensors.

It probably won't be finished till next week sometime. I have some other things I'm also working on at the moment.

EZrotate!
Tokamak Physics Wrapper!
Nigel
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location:
Posted: 11th Apr 2004 05:26
Wolf: Is it possible to create basic custom Rigid bodys?, instead of the basic sphere,box,cyn?
andrew11
21
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: United States
Posted: 11th Apr 2004 06:11 Edited at: 11th Apr 2004 06:13
No, but you can make compound objects by combining say a sphere and a cube to make umm.. Well, you get the idea...

Just use:
Trb = TokRB_Create()
g1 = TokRB_AddSphere(Trb, 10)
g2 = TokRB_AddCube(Trb, 5)

..Erm I think that will work. Try it. Maybe WOLF can give a better example

"All programmers are playwrites and all computers are lousy actors" -Anon
Ron Erickson
Moderator
21
Years of Service
User Offline
Joined: 6th Dec 2002
Location: Pittsburgh, PA, USA
Posted: 11th Apr 2004 13:06
Yep, that is how you do it. You can then offset the poitions and rotations of your geometries by using the TOKg_SetPositionAndRotation command

EZrotate!
Tokamak Physics Wrapper!
Nigel
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location:
Posted: 12th Apr 2004 03:25
Cool thanks for that, but having a little trouble with the Geometry commands, where do ya get the GeomNo from?, or do ya just use the RBno that TOKrb_Create returns?, I tryed it anyway with TOKg_SetPositionAndRotation rb,0,0,50,0,0,0 etc, and all it does is disable all the collsions and it just falls thru everything??

Thanks
Ron Erickson
Moderator
21
Years of Service
User Offline
Joined: 6th Dec 2002
Location: Pittsburgh, PA, USA
Posted: 12th Apr 2004 03:51
No, no, no....

Say you create a RB:
rb = TOKrb_Create()

"rb" is your rigid body number. At this point it has NO geometry objects.

Now say you want to add a sphere geometry to that rigid body:
SphereGeom = TOKrb_AddSphere()

"SphereGeom" is your geometry number. You want to use that....

EZrotate!
Tokamak Physics Wrapper!
Nigel
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location:
Posted: 12th Apr 2004 04:27
Ok thanks I understand, umm think I found a problem with your wrapper?

Using TOKg_GetEulerX, returns a compiler error "Could not find function TOKGEOM_GetEulerX in 52BP-Tok.dll"
same with the y,z,

TOKg_GetX works ok
yes im using 1.04
Ron Erickson
Moderator
21
Years of Service
User Offline
Joined: 6th Dec 2002
Location: Pittsburgh, PA, USA
Posted: 12th Apr 2004 13:21
Thanks Nigel.
I found the problem. It has been fixed and will work correctly in the next version (hopefully it will be finished this week).

EZrotate!
Tokamak Physics Wrapper!
Scraggle
Moderator
21
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 29th Apr 2004 19:53
Hi wolf

I have been 'playing' with your wrapper and trying to get various things working and I have to say I am very surprised by how easy it is to use.

However, I do have one issue that I cannot resolve and I was hoping you could help.

I have been trying to use a DirectX object as a static mesh. I have been using your 'Object_2_TOKmesh(Obj)' function but my objects just fall through it as though it was not there.

The object I am trying to use was created in Cartography Shop. Is that the reason it won't work? Is there a problem with cerain types of DirectX objects or I am doing something wrong?

Thanks



1001001 S.O.S.

Login to post a reply

Server time is: 2024-11-22 08:30:36
Your offset time is: 2024-11-22 08:30:36