Tokamak Physics Thread 5

Blitz3D Forums/Blitz3D Userlibs/Tokamak Physics Thread 5

skidracer(Posted 2004) [#1]
Download Blitz Tokamak: www.freewebs.com/sweenie

Tokamak Homepage: www.tokamakphysics.com

Tokamak Physics Threads:

www.blitzbasic.com/Community/posts.php?topic=29381
www.blitzbasic.com/Community/posts.php?topic=29680
www.blitzbasic.com/Community/posts.php?topic=30024
www.blitzbasic.com/Community/posts.php?topic=32503

Blitz Tokamak Tutorials

www.blitzcoder.com/cgi-bin/articles/show_article.pl?f=bot__builder102082004102230.html
www.blitzcoder.com/cgi-bin/articles/show_article.pl?f=bot__builder103252004031037.html


puki(Posted 2004) [#2]
Hello.


Eric(Posted 2004) [#3]
Does anyone know if Sensor will React with a static Mesh?


Beaker(Posted 2004) [#4]
Once again the official BlitzTokamak forums aren't mentioned!!:
http://playerfactory.proboards25.com
(top 2)


bradford6(Posted 2004) [#5]
Eric,
sensor will react to static mesh. I tested it


Eric(Posted 2004) [#6]
Now Why Can't I get it to work... I will have to try again. I just need to make sure the Sensor is extending the proper Direction. I am doing a Lunar Lander Remake kinda thing, and am using Linepick to determine Altitude.. After multiple times trying to get the sensor to work, I gave up.
Can you give me a small sample of what you did to get it to work?

I'm wondering if the Sensor is quicker than a line pick.
Regards,
Eric


Bot Builder(Posted 2004) [#7]
I haven't gotten it to work either :/


AntonyWells(Posted 2004) [#8]
any tutorials etc on using tokamak for ragdoll? Or what methods are prefered?


Picklesworth(Posted 2004) [#9]
Just play with connecting rigid bodies with joints and you'll get it. I would say first start off with the framework layout of joints and geometries, then play with the joint inertia settings, and limits.


Sweenie(Posted 2004) [#10]
Use the sensor examplecode that came with wrapper v0.6.
Change the ground(animated body) to be a static mesh instead.


AntonyWells(Posted 2004) [#11]
There any demos showing off joints etc?

I've used tokamak for standard stuff like boxes/spheres etc, just had troubles getting joints to work. (No docs/tutorials I could find at all.)


gellyware(Posted 2004) [#12]
Is the tokamak website homepage down? Figures when you finally try to go and learn something new ;)


Sweenie(Posted 2004) [#13]
There any demos showing off joints etc?


In the wrapper v0.5 zipfile you'll find a jointdemo.

Is the tokamak website homepage down?

Should be back online now.


Eric(Posted 2004) [#14]
Ok..How about Tokamak Particles...What is the difference between them and RB's? How do you implement them.

I have a fair understanding of Tokamak.

Thanks,
Eric


Bot Builder(Posted 2004) [#15]
Tokamak particles just don't collide with other tokamak particles. thats all. :/ Still, its handy for particle systems. Lotus by NoelCower (a free particle system) allows you to use tokamak.


gellyware(Posted 2004) [#16]
Can someone please explain the command TOKRB_ApplyImpulse2

From what I gather you can set the x force, y force , z force and also the x,y,z the force is coming from. However I have tested this numerous times changing the last 3 parameters and I can not get the direction of the force to act any differently.


Bot Builder(Posted 2004) [#17]
Well, TOKRB_ApplyImpulse always applys an impulse at the center of the rigidbody, thus no rotation is imparted. TOKRB_ApplyImpulse 2 on the other hand can apply an impulse anywhere, so, if not applied to the center, rotation is imparted. Note that the last three parameters are global so if you want to apply an impulse at an offset you will have to add the position of the rigid body to the offset.


gellyware(Posted 2004) [#18]
Thanks for your quick reply bot builder.

I follow what your saying but I cant get something that seems simple to work.

I am trying to apply a force based on the direction the camera is faceing. I basically have a sphere that is attached to a pivot in front of the camera. When you hold down space, i want the sphere to be projected forward away from the camera. The problem is I cant seem to get the sphere to project straight away from the camera. Does this make sense?

What would you recommend?

This is my last attempt so far:

    TOKRB_ApplyImpulse2 rb(i),5,20,5,TOKRB_GetX#(rb(i))+(EntityYaw(cameraPivot) ),TOKRB_GetY#(rb(i))-0.5,TOKRB_GetZ#(rb(i))+(EntityYaw(cameraPivot))



Tried so many different numbers for the last 3 parameters, nothing affects the result.

even if i try something like :
TOKRB_ApplyImpulse2 rb(i),5,20,5,50,50,50

or
    TOKRB_ApplyImpulse2 rb(i),5,20,5,TOKRB_GetX#(rb(i))+20, TOKRB_GetY#(rb(i))-0.5,TOKRB_GetZ#(rb(i))+20


I get the same result, no influence from the direction I want the force applied from.


Nacra(Posted 2004) [#19]
Charles, I'd skip TOKRB_ApplyImpulse2 for your purpose and just use TOKRB_ApplyImpulse. Now to explain the command a little, calling TOKRB_ApplyImpulse rb(i),5,20,5 will always push your object in the same world direction (5, 20, 5) which is about 45deg between the x and z axis and then up vertically (20).

What you need to do is pass the correct vectors based on the camera orientation. I didn't take the time to figure it out, but I'd look at a TFormVector on your camera and then just use TFormedX(), TFormedY() and TFormedZ() to get the vector components to pass to TOKRB_ApplyImpulse. Then you might want to scale the x, y, and z values so that you're applying the amount of force you want.


Bot Builder(Posted 2004) [#20]
Here's how I would do a sphere projecting away from the camera:

TFormNormal TOKRB_GetX#(rb(i)-EntityX(camerapivot),TOKRB_GetY#(rb(i)-EntityY(camerapivot),TOKRB_GetZ#(rb(i)-EntityZ(camerapivot),0,0
TOKRB_ApplyImpulse rb(i),TformedX()*amount#,TformedY()*amount#,TformedZ()*amount#


Dunno if it works, I typed it right in firefox. Anyway, basically this just makes the length of the vector between the camera and the sphere equal to one (normalizes), and then multiplys this by an amount that equals the force of the impulse.


gellyware(Posted 2004) [#21]
Thanks Nacra and bot builder, I will give both of these a shot.


gellyware(Posted 2004) [#22]
Hrm.. Still no luck. Im not sure I understand how the TformNormal command really works. Are there any examples of something being thrown from the camera? Like bullets or something?


Bot Builder(Posted 2004) [#23]
I think I just realized that you might want to shoot objects that are in the same location as the camera, in the direction the camera is pointing.

code:
TFormVector 0,0,1,camera,0
TOKRB_ApplyImpulse rb(i),TformedX()*amount#,TformedY()*amount#,TformedZ()*amount#


Remember to set the amount.


gellyware(Posted 2004) [#24]
Very nice, this works!

Thanks bot builder. Could you explain what this is doing if you dont mind? I dont get the TFormVector function.

Thanks for your help.


Damien Sturdy(Posted 2004) [#25]
Has anyone got a car physics demo? i cant find any demos to play with to teach myself the technique.. im quite slow like that!


cheers


Bot Builder(Posted 2004) [#26]
A recent quote of marksibly -
The TForm commands were the best thing I ever did in Blitz3D - and I had no idea at the time!

Live and learn...


In its usage there, TformVector finds the heading vector of the entity. If say, it was pointed up the heading vector would be 0,1,0. All the Tform commands are basically changing coordinate spaces for points,vectors,and normals.

It's a rather complex topic, but I'll attempt to explain. Each entity has a coordinate space defined by its position and orientation. 0,0,1 is 1 unit in front of the entity in "global space". Global space is what your used to using, say with positionentity. The first three parameters of a tform command is the position, vector, or normal. The last two parameters are the space to convert from and the space to convert to. Whenever 0 is there, it means global space.

So, in my example I am converting the vector 0,0,1 from the orientation of the camera to the global orientation. (TformVector and TFormnormal don't care about position of the object).


gellyware(Posted 2004) [#27]
Thanks bot builder,:) that explaination really does help. The Blitz documentation is a bit foggy on this command.

I'll post a demo of what ive done with it when it has reached its logical conclusion!


Sweenie(Posted 2004) [#28]
Has anyone got a car physics demo? i cant find any demos to play with to teach myself the technique.. im quite slow like that!


There should be some that comes with the wrapper.
You may have to check in an older version.

However, these demos uses a setup there the car is made up of one rigidbody for the carbody and 4 rigidbody-wheels that are connected to the car via joints.
Unfortunately this model isn't very easy to work with and tends to make the car slip around as it was on ice.

The way to go seems to be using only one rigidbody for the carbody and do linepicks instead of having physical wheels.
It should be faster and more stable since you don't have to involve joint-solvers.

Sample 8 from the Tokamak-SDK uses this method and I recently found out that this is the method used in Unreal 4, (they use Karma for physics though)


AntonyWells(Posted 2004) [#29]
Sweenie, when you say linepicks, could you explain a little more what to do with the returned info?

Apply an impulse at the centre of where the wheel joint would have been...for each wheel that's 'colliding'..

Or do you mean do a linepick from old wheel position to new wheel position with radius set to the size of the wheel?

(I was planning to use the other method myself is all, so I'm interested in the linepick method..just not all that clear on it.)


Sweenie(Posted 2004) [#30]
Basically you cast a ray from the centre position of the wheel(where it should be in its rest position) straight down. If the ray hits something and the distance from the contactpoint to the wheel-centre is within a certain range(for example 1.0 if the suspension length is 1.0) then apply a force at the wheel-centre using the ray's normal to get the force-direction and the distance to calculate the amount of force. Some damping has to be applied as well to keep the car from oscillating too much.
Repeat this for every wheel/ray.

Basically you make the car hover.

Then comes the tricky part.
Applying friction force, driving force and drag.
Since the car hovers there is no friction at all so you have to fake wheel friction.
Driving force is a matter of pushing the car from behind and apply proper torque on the turning axis to make the car steer.
Drag should be most simple as you damp the car's velocity based on it's speed.

If I manage to get my raycast car working I will try to explain this better.


WarpZone(Posted 2004) [#31]
Is Tokamak a good engine to use for spherical gravity? Or would I be better off using vanilla Blitz3D commands and creating my own half-assed, sphere-only physics?

I wanted to create a game that takes place within a hollow sphere, with gravity repulsing players and game objects outwards from the center of the world, turning the wall of the sphere into a floor. Kinda like the ringworld in HALO, only much smaller in scope. Also, note that it wouldn't be a perfect sphere; it would have mountians and valleys and manmade structures built into the walls. The whole inside-out world thingy would be a B3D mesh of arbitrary complexity (but probably around 3000 polygons.)

I love the way cylinders and boxes fall and bounce in Tokamak. But so far, it doesn't seem like you can get that effect with the gravity turned off.

I've tried setting the gravity to 0 and applying forces and impulses to control the objects, but I can't even get a simulated -Y gravity to work this way, let alone gravity based around a point. I keep having problems no matter what I try. Objects tend to sink through the floor, or never stop moving and tend to jiggle in place. And it gets really messy if I try to use sensors. That might just be my own inexperience, though.

I've seen some demos involving "magnet" effects, but they seem not to work very well.

I'm not asking for coding assistance at this point, I just want to know if it's *possible* to do with Takomak. Is there a way to make tokamak primatives bounce, roll, and come to a rest along the inside of a hollow sphere with simulated radial gravity the same way they do along the bottom of a hollow cube with real vertical gravity?

Thanks in advance for any helpful replies. I really hope Tokamak can do this, but my experiments so far don't seem very promising. Hopefully one of you Tokamak experts can set me straight.

Thanks again!
Is Tokamak a good engine to use for this sort of thing? Or would I be better off simply using Blitz3D and creating my own physics?

I love the way cylinders and boxes fall and bounce in Tokamak, but it seems to need the gravity to be linear. I've tried setting the gravity to 0 and applying forces and impulses to control the objects, but I can't even get a simulated -Y gravity to work, this way. I keep having problems. Objects tend to sink through the floor, or never stop moving and tend to jiggle in place. It gets really messy if I try to use sensors.

I'm not asking for coding assistance at this point, I just want to know if it's *possible* to do with Takomak. Is there a way to make tokamak primatives bounce and roll along the inside of a hollow sphere with simulated radial gravity the same way they do along the bottom of a hollow cube with real normal gravity?

Thanks in advance.


Pongo(Posted 2004) [#32]
All right,... what am I doing wrong here? I just tried to look at the .6 wrapper, but I can't get it to work.

I have checked and double checked that I am putting the right files in the userlibs directory. .5 examples work fine, but .6 examples give me the error "User lib not found"

As far as I can tell, I AM copying the .6 userlib, and I am using tokomak 1.2 dll

So what stupid thing am I doing wrong?


Space_guy(Posted 2004) [#33]
try putting the dlls in the windows\system32 folder. that way they will load from any folder but u will have to remember to include them in root directory of your application when u want to use it on other computers


Eric(Posted 2004) [#34]
Warp,

I did sperical Gravity on a lander game I am working on and it worked fine. I couldn't get the detail I wanted on a spherical terrain so I reverted back to Flat..

There is a set gravity command in Tokamak which allows you to change the direction of gravity.

So with that in mind I would think that you can make your Idea work with Tokamak.

I do know that Collisions happen on both sides of a triangle.

Also, If you make a nice landscape you can convert it into a static mesh... A little tip for collisions with static meshes... The Collision ID defaults to -1.

Good Luck with your project. I stayed away from Tokamak for a long time hoping to do it all myself I gave in.. I know that it is not the best solution for everything, but for my Lander Game, it is cool!!

Regards,
Eric


WarpZone(Posted 2004) [#35]
No, Eric, I want the gravity to affect MULTIPLE OBJECTS. Not just one player object. If I change the gravity depending on where the player is, the objects will all fall with him. I want all objects to fall away from the center of the sphere simultaneously.


Pongo(Posted 2004) [#36]
Ahhh, got it... in case anyone else has the same problem, I had the old tokamak.dll in the system32 folder


Sweenie(Posted 2004) [#37]
Get the directionvector from the center to the actual object.
Normalize the vector and call
TOKRB_SetForce RB,NormalX#*Grav*Mass,NormalY#*Grav*Mass,NormalZ#*Grav*Mass
This should make the object move away from the centre with respect to where in the sphere it is.
Don't forget to set the standard gravity to 0.


WarpZone(Posted 2004) [#38]
Ah! thanks, Sweenie. :D

I tried to follow your advice, but I only got so far. Can't seem to figure out how to get the mass of a Tokamak entity. GetMass(RB) doesn't seem to be the ticket. If you would do me the favor of throwing me yet another bone, head over to http://www.blitzbasic.com/Community/posts.php?topic=37658 . (Didn't want to clutter up this thread, so I started a new one. Yeah, I know, too late, huh? :P)

Thanks again!


Mac M(Posted 2004) [#39]
Hi!

Is there any function to get a joint angle? There is a GetUpperLimit() and a GetLowerLimit(), is something already made like GetJointAngle()? If not, which is the best method to do it, with differences between FrameA and FrameB angles?

Thanks!


Sweenie(Posted 2004) [#40]
If you get FrameA and FrameB directionvectors you should be able to get the "cos(angle)" by normalizing the directionvectors and calculate the dotproduct from them.
Then use Acos() on the dotproduct to get the angle in degrees.


Mac M(Posted 2004) [#41]
Does TOKRB_SetRotation() set angles of the rigid body relative to its local axis or universal one?


Bot Builder(Posted 2004) [#42]
It sets it relative to the global axis.


Eric(Posted 2004) [#43]
OK Besides the Sensor Demo, I have not been able to get sensors to work.


Has Anyone figured them out?

I have a Tokamak RB with 10 Geometries. I have a Sensor From 0,-1,0 to 0,-10,0.

I get nothing from GetDetechDepth#..

What is the way to set up the sensor. Picture a lunar Lander type vehicle. With a linepick (Sensor) to determine if there is something below the Lander.

AHH!! I am getting Frustrated... :)

Regards,
Eric


Filax(Posted 2004) [#44]
I have a question :

Is is possible to have a collision ID (TOKRB_SetCollisionID) with a
TOKSIM_SetStaticMesh ???


RepeatUntil(Posted 2004) [#45]
Hi Filax,

The collision ID for a static mesh is -1 (and you can not change it).


Filax(Posted 2004) [#46]
Thanks repeatuntil :)

I have try this function to convert a mesh into collider



the TOKRB_SetCollisionID MEsh,TOK_StaticMeshCollisionID is correct ?


RepeatUntil(Posted 2004) [#47]
No, it's not correct! You can not use this command with a mesh (which is not a RB). But you don't need to define the collision ID for the mesh: it's already defined by default and equal to -1.


Filax(Posted 2004) [#48]
Ok it work now :)


Filax(Posted 2004) [#49]
A little demo of my Tokamak lib :)

http://www.blitz3dfr.com/tempo/TestTOKA.zip

I'm making a lib for make toka more easy to setup :)

This is the demo source, lib coming for free

Left mouse : Launch objet
Right Mouse ; Move Chain
Middle Mouse : Bullet Time :)





N(Posted 2004) [#50]
filax: Er.. shouldn't the last tag be [/codebox] and not [/boxcode]? 0_o


Filax(Posted 2004) [#51]
OOps .. sorry ... :)


Sledge(Posted 2004) [#52]
Ummm, dumb question but how does one refer to one's static mesh after it has been set? I'm trying to convert some ODE stuff over to compare but whereas, in ODE, you go...

TriMesh = ODE_dTriMeshCreate(mesh)


...which gives you the handle "TriMesh", in Tokamak it's just...

TOK_AddMesh mesh
TOK_SetMesh


...which leaves you with nothing. So, what's the right way to interrogate and set the position and orientation of the static mesh in Tokamak? Looked high and low I have.


Sweenie(Posted 2004) [#53]
You can't set the position or orientation of a static mesh in Tokamak.
Move and rotate the vertices to get them where you want before you hand them over to Tokamak.


Filax(Posted 2004) [#54]
2 littles questions sweenie :)

It is possible to move manualy a RigidBody Entity without
impulse and force or twist ? because i can make rotation
(setrotation etc) with animated body.

I have some problem with tokamak joint type 1 and RB cylinder
some time the cylinder connected to joint disapear after an
apply impulse or twist but if i make the same thing with an RB box
there is no problem ???

But i love your lib :)


Sweenie(Posted 2004) [#55]
a)
Yes you can manually position and rotate a Rigid Body, but it's not recommended if you want the body to collide with other bodies properly.
I'm not sure if Tokamak keeps its linear and angular velocities after a move to a fixed position or if it calculates new velocities based on the previous and current position.
If it does the latter the body might shoot away like a comet unless you zero the velocities right after the move.

b)
Try setting a little higher angular damping on the cylinder.
Also try to increase the joint's iterations and set it's epsilonvalue to 0.0


Filax(Posted 2004) [#56]
Ok sweenie :) thanks for informations !


Filax(Posted 2004) [#57]
Do you see a very simple tutorial for create car ???
with simple box and cylinder ?


Sledge(Posted 2004) [#58]

You can't set the position or orientation of a static mesh in Tokamak.
Move and rotate the vertices to get them where you want before you hand them over to Tokamak.



Aha. Cheers. That'll be why it's called a static mesh I guess. :)


Eric(Posted 2004) [#59]
Anyone still active here?


bradford6(Posted 2004) [#60]
I think there is a lull in the activity here. many are looking forward to blitzMax. B3D is still a very good language. I will be posting some Tokamak stuff soon.


Wayne(Posted 2004) [#61]
I'm thinking of switching to Tok from ODE and wodering if that and easy switch? Considering the move because of ODE pauses and cylinder bug.

What can I expect when I switch ?


Shifty Geezer(Posted 2004) [#62]
I'm just starting out with B3D and Tokamak. Tokamak is beutifully simple for what I want; just cubes and spheres bouncing around with see-saws (teeter-totters).

Any reference point for what BlitzMax is going to add?


bradford6(Posted 2004) [#63]
I imagine there will be a Tokamak DLL or plugin for BMAX.

Tokamak has been pretty quiet. they are supposed to release 2.0 sometime. no word on license.

ODE is open source but has some issues. It is new to blitz3D (relatively) so it is enjoying more forum press right now.

Sweenie is responsible for the Tokamak DLL for Blitz. he did some awesome work on it and should be proud. In it's current state, it is quite usable for many applications.

it is stable and fast.

Havok support would be nice for BMAX. although license would be pricey.

It would be nice to standardize on a good physics engine.


Wayne(Posted 2004) [#64]
Installed Tokamak today and got it running. So far it seems similar to ODE. I need to read thru the documentation and help files and get comfortable.

My first impression thus far is ODE is friendlier and faster. Will see if my perception changes after using Tokamak in a few proggies.

Sweenie continues to support this nice wrapper, and answer questions. I appreciate his time and should I decide to use the wrapper will contribute.

Sweenie, any chance you would do ODE wrapper similar to how Arkon has done ? How much $ would it take to bribe you ??

8)


Sweenie(Posted 2004) [#65]
I'm not too sure I'm up to wrapping another physicslibrary at the moment. :/

Currently I've been working on my own physicsengine,
and I have to tell you that it has increased my respect for the authors of Tokamak,ODE,Novodex and Newton.
Getting a body to rotate in space and react to forces is the easy part.
Handling collisions, responses, stacking and friction, now that is something to chew on.
But I have learned alot and now understand much better why bodies behaves a certain way in Tokamak.

Something that caught my attention a while ago was a line from the chatlog with Mark.

"<marksibly> Instead, I'm gonna write a physics engine."

in this thread--->
http://www.blitzbasic.com/Community/posts.php?topic=39297

So Mark, are you really working on a physics engine or were you just joking?


Shifty Geezer(Posted 2004) [#66]
Is there really a need more yet anothr physics engine? Not that I'm complaining, but why reinvent the wheel? Only if the exisitng solutions are to be improved upon. Otherwise it seems like making unnecessary work for yourself!

From my point of view there's not much wrong with Tokamak; it's fast and fairly accurate, though I'm not involved with complex ragdoll models! What features will need to be added to amkea new physics engine worth creating.


Sweenie(Posted 2004) [#67]
In my case it's a way for me to get a better understanding of how existing physicsengines work.
I know I won't get anywhere near the "quality" of the existing engines and I will probably not even complete an engine worth releasing to the public, but it's great fun and very educational.

However, something that might be worth creating are simplified wrappers with helperfunctions for the existing engines.

Like premade cars & ragdolls for example.

Example functions:
TOK_CreateSimpleCar()
TOKCAR_SetLength()
TOKCAR_SetWidth()
TOKCAR_SetHeight()
TOKCAR_SetSuspensionLength()
TOKCAR_SetSuspensionDamping()
TOKCAR_SetWheelRadius()
TOKCAR_SetThrottle()
and so on...


bradford6(Posted 2004) [#68]
Sweenie,

Your Tokamak Wrapper is excellent. Thank you for your contribution to the community.

(Thanks to Bot also for the DOCS)

also. Don't evaluate a lack of activity in this forum as project abandonment. I usually take the summer off from programming. (too nice outside! camping, Fishing, Painting the house, etc...)

now that it is chilly outside, I will do more. right now I am doing a (VERY SIMPLE) Space Invaders clone. just to get the cobwebs out :)

That said. Blitz 3D and Tokamak in their current form are very robust and stable. It is possible to create some very nice programs with them. We All Always want more features. It is human nature. There has to be a point where you say. OK, I am going to use the tools I have to make my project work.


Jeannette(Posted 2004) [#69]
Hi all,

I have some problems to define friction between Terrain an my player-mesh, but first: sorry for my bad english

I've tried the following:


Const Rigid_Bodies=1,Animated_Bodies=5,Rigid_Particles=0

TOKSIM_SetRigidBodiesCount Rigid_Bodies
TOKSIM_SetAnimatedBodiesCount Animated_Bodies
TOKSIM_SetRigidParticleCount Rigid_Particles
TOKSIM_SetControllersCount 0
TOKSIM_SetGeometriesCount Rigid_bodies+Animated_Bodies

TOKSIM_CreateSimulator(0,-4,0)

TOKSIM_SetMaterial 1,0.9,1 ; Boden
TOKSIM_SetMaterial 2,0.5,0.7 ; spin

Global tex=CreateTexture(256,256)

SetBuffer Texturebuffer(tex)
ClsColor 35,135,35
Cls
For x = 0 To 127
For y = 0 To 127
Color 0,100,0
Rect x,y,1,1
Next
Next
SetBuffer BackBuffer()
MoveMouse MaxX/2,MaxY/2

Global boden=CreateTerrain(128)
EntityType boden,2
EntityTexture boden,tex
EntityColor boden,35,135,35
PositionEntity boden,-2,0,-2
abground = TOKAB_Create()
geom = TOKAB_AddBox(abground,100.0,1.99,100.0)
TOKAB_SetPosition(abground,-2.0,-1,-2.0)
TOKAB_SetCollisionID(abground,0)
TOKGEOM_SetMaterialIndex geom,1

Dim obj(Rigid_Bodies)
Dim rb(Rigid_Bodies)

i=1
ry# = 0.185
Global spin = CreateSphere(8)
ScaleEntity spin, 0.1,0.1,0.1
rb_spin = TOKRB_Create()
geom1 =TOKRB_Addsphere (rb_spin,0.2)
TOKRB_SetPosition rb_spin,0,1.5,5.5
TOKRB_SetLinearDamping rb_spin,0.001
TOKRB_SetAngularDamping rb_spin,0.02
TOKRB_SetMass rb_spin,0.8
TOKRB_SetsphereInertiaTensor rb_spin,0.2,0.8
TOKRB_SetCollisionID(spin,1)
TOKGEOM_SetMaterialIndex geom1,2
...


Whats wrong? The friction only works in the air but not at the ground/terrain.

Can You help me please?

Thanks a lot, Jeannette.


Kalisme(Posted 2004) [#70]
I've just recently got all the tokomak stuff,
looks kewl... I've just been looking through
some demo's and tutorials... Very kewl... Very fast
engine... I'm thinking of working this engine into
a game I was doing a while ago, but my physics engine was
a bit do dodgey... But I need to know:
If u make a 3d model in B3d format, then shove
in joints and stuff through milkshape... Can
U go over it with Tokomak commands to make a ragdoll?
(probably a really stoopid question)
but if NEone knows how... could u inform me or
direct me to a tutorial, code or demo?
Thanx 4 reading.


bradford6(Posted 2004) [#71]
u can. just look at the x,y,x and pitch,yaw,roll of each joint to create hinges.


bradford6(Posted 2004) [#72]
i guess everyone is off playing Half-Life 2


bradford6(Posted 2004) [#73]
I have an interesting project that I will share soon. need a little more time to squash bugs.


Picklesworth(Posted 2004) [#74]
Yup.
Playing halflife2 and silently feeling more and more upset about not doing my physics stuff sooner - when it wouldn't seem like I was just copying hl :(


Kalisme(Posted 2004) [#75]
I don't know if this is still relevant or even true... But a while ago I read that using tokamak, it is impossible to illiminate "twitchyness"... I was playing around with some code I was doing (I'm still working on an editor for making ragdolls, which I need to make b4 I start my new project: ASX) And In my first quick attempt of saving and loading, I didn't have the cubes used in the legs touching each other... I left gaps.. (I wasn't trying to do a good model.. I was just playing around) but the joints were right... And I didn't have any twitchyness (a little at first... but alot goes away.. and it actually sits still)... I don't know if this was a "flook" or what, but I thought I better share this... I hope it helps.


Sweenie(Posted 2004) [#76]
According to Chris at Tokamak directly connected bodies shouldn't collide, but I'm starting to think, maybe they do in the latest release.
If that is the case, twitching will occur if two bodies are connected in such a way that they always intersect and the joint prevents them from separating.
There is a function for enabling/disabling collision between DirectlyConnected bodies in the latest release of Tokamak, but I never got it to work.
But anyway I think it might be good practice to keep joint bodies separated/nonpenetrating, at least when setting them up.

[Edit...]

I remember now that Wolf(from the DB-forums) told me that he got strange results throughout the whole simulation if bodies were penetrating at the first simulation step.
Might be worth checking out.


bradford6(Posted 2004) [#77]
question: How many people have 3ds max?


Shifty Geezer(Posted 2004) [#78]
Okay, I'm trying to get my spheres to stop rolling ad infinitum. Cranking up the Angular dampening and SleepingParameter kinda works, but on some spheres the speed of rotation only gets smaller and smaller without ever stopping. Though the spheres look stationary they're still moving an imperceptible amount.

Does this add a processing overhead? Are totally stationary sphere's not being processed for collisions etc.?

If there is an overhead, how can I remove it? I've tried setting Torque and Force to zero when a certain threshold of AngularVelocity is reached, but it's never applied effectively.


bradford6(Posted 2004) [#79]
from docs:
NOTE:For spheres, oddly enough, they have to touch another rigid body to become idle. This is considered a tokamak bug and should be fixed in a future version.


Eric(Posted 2004) [#80]
If there is a future version... :)


bradford6(Posted 2004) [#81]
faith.

Tokamak 2 will be released sometime. not sure if Sweenie would be up for wrapping it since he is working on a physics engine of his own. the sphere thing is very minor and can be fixed in a variety of ways. should not be considered a showstopper


Sweenie(Posted 2004) [#82]
If there by any chance would be a Tokamak version 2 in the future I'm sure Bmax will be ready and wrapping would probably not be necessary(or at least minimal).


bradford6(Posted 2004) [#83]
good answer. btw, how is your physics engine coming along, Sweenie?

a Tokamak wrapper for BMAX would be trivial? how so?


Eric(Posted 2004) [#84]
Has Anyone Used The
TOKRB_AddConvex(RigidBody%,Bank%,BankSize%)
What is the proper Use of this?


Picklesworth(Posted 2004) [#85]
Use Adjacency, the QHull DLL (or, in january, apoe :D ) to create a convex hull object out of a mesh, which is saved as a file of some sort, then just load it in with that.


Eric(Posted 2004) [#86]
Huh? :)


bradford6(Posted 2004) [#87]
convex hull calculation is actually very interesting (if you are math-inclined)


this will show you what it is:

The convex hull of a set of points is the smallest convex set that includes the points.

http://www.cse.unsw.edu.au/~lambert/java/3d/ConvexHull.html

http://www.piler.com/convexhull/

http://riot.ieor.berkeley.edu/riot/Applications/ConvexHull/CHApplet.html

and finally. download the qhull dll from:

http://www.freewebs.com/elias_t/qhulldll.htm


Sweenie(Posted 2004) [#88]
btw, how is your physics engine coming along, Sweenie?


Well, it surely ain't the same as wrapping. ;)
But I'm slowly moving forward.
I began by buying a physicsbook with flawed code, typical.
But now I bought Dave Eberly's book. The math is almost killing me but luckily the book also contains pseudocode and pictures...(in color) :)

I started on a "prototype" engine in Blitz3D(check the code-archives) but later moved over to c++.
What I really want to do though is to make the engine in BlitzMax.


Eric(Posted 2004) [#89]
Ok I looked over the qHull Stuff, but I don't understand how to get that into Tokamak... Has anyone been sucessful?

Regards,
Eric


bradford6(Posted 2004) [#90]
very cool sweenie. Now that Blitzmax is out, you should be able to move forward with your Physics engine. 2D is prob a good place to start.

qhull stuff.

what is interesting is that the demo by sweenie had a rock.bin file in it. the qhull.dll output are x,y,z coordinates of vertices. I am working on how to sync those up.


Shifty Geezer(Posted 2004) [#91]
Can someone please shed some light on using materials with Bot Builders TOKAMAK Extras function TOK_AddMesh?

I've got a colliding environment working but can't figure how to assign a material to make it bouncy or slippery. I've assigned my materials, specified a texture (TOK_SetTextureMaterial("textures\arrow.png",1)), added my mesh

TOK_AddMesh(mdl_Table,0,-2,1)
TOK_SetMesh()

but no matter what numbers I try in the AddMesh function I can't change the texture or properties of my mesh? The documentation confuses my poor little brain, talking about multitextured, recursive meshes where I've I've got is a simple, single-surface mesh.


Eric(Posted 2004) [#92]
TOKSIM_SetMaterial(1,5,0)

TOK_AddMesh (Terrain,0,1) ;Mesh, Recursive, Material

This sets up Material 1, With a friction of 5 and a restitution of 0.

Use Large Number for Friction to make an obvious change. 0.0 - 1.0 is not a true representation of the friction range.

Hope this helps
Eric


Shifty Geezer(Posted 2004) [#93]
Thanks loads! That works great. I've now custom scenery meshes along with my magnets, blowers and assorted materials :)


Eric(Posted 2004) [#94]
Can someone help me with Joints.

I created A lunar Lander, It has been working fine up until I wanted the lander to react better on landings with rough terrain. So I had it in my mind that I would add slider joints to the four leg struts so it would look more realistic. But for the life of me I can not get the joints to work.. Visualizing the connection points and orientation are driving me crazy.

Does anyone have notes on connecting Joints.

Also if I have one rigid body with a total of 5 geometries, 4 of which are the connecting points for the landing gear. I can't seem to attach a Joint from a RigidBody to a Geometry of another Rigid Body... Is this normal?

Any help would be appreciated.
Eric


Kalisme(Posted 2004) [#95]
where would I get the upgrade that includes the command:
tok_addmesh
exactly?


Eric(Posted 2004) [#96]
The top of the Thread Last Link.
http://www.blitzcoder.com/cgi-bin/articles/show_article.pl?f=bot__builder103252004031037.html


Kalisme(Posted 2005) [#97]
isn't anyone using Tokamak anymore?
or does everyone just understand it now andf not need to ask questions like stupid ol' Kev here...?


Damien Sturdy(Posted 2005) [#98]
I just started using it again. I found the original layout to be a Pain in the arse to get used to so im writing yet more wrapper functions to make it easier to set up.


Shifty Geezer(Posted 2005) [#99]
I'm only using cubes and spheres, so I'm not doing anything clever, but I find Tokamak very easy to work with.


flying willy(Posted 2005) [#100]
Tokamak is brilliant to work with but it's friction and lack of cylinders is it's weakness.

Convex hull is a good cylinder replacement however much slower.

I just started using it again. I found the original layout to be a Pain in the arse to get used to so im writing yet more wrapper functions to make it easier to set up.
Of course! this is the done thing...

For example I have

TokCube(ent)
TokSphere(ent)

this creates a type and a tokamak rigid body (either cube or sphere) and adjusts the dimensions of the tok geo to match the size of the blitz entity. It then "links" the entity with the tokamak object.

Allowing me to update them all at once. As you can see I can then just load a car with loadanimmesh, and parse the entitynames for example the car body.

temp = TokCube(Findchild(car,"body")) ;- ALL DONE! the car body now has cube collision...

Then I can... SetMass(temp,10) with my other helper functions, as TokCube returns the rigid body.

The reason tokamak isn't this easy from the outset (same with ODE) is that it is so flexible... part of being a programmer is using your loaf.


Damien Sturdy(Posted 2005) [#101]
I found ode way easier to start with but i still wrapped it some more ;) About the loaf thing, Yes, true.. and thats why i made the extra functions. it wasnt a complaint, just a statement that meant it took me a while to get usd to it and it gave me a pain in the arse whilst doing it ;)


dwfait(Posted 2005) [#102]
Hi all, im having trouble setting up collsiions in tokamak, could anyone help?

Here is the code to set up toka:



Here is the code to set up the player:



and the "ground":


Yes, i am advancing in the code.

The player just passes through the white box...any ideas why?


Sweenie(Posted 2005) [#103]
How do you keep the "ground" in place?
Since it's a rigidbody as well I assume you must be constraining it somehow to prevent it from falling.


dwfait(Posted 2005) [#104]
oops..forgot that line. its:

TOKRB_GravityEnable(maprb,False)


And im running this every loop:

Text 0,150,TOKRB_GetX(maprb)+" "+TOKRB_GetY(maprb)+" "+TOKRB_GetZ(maprb)


for both the maprb and the players rb, and the map rb stays at 0,0,0 , and the player begins at 0,100,0 and descends through the box. When it gets to 0,0,0, the player and the map rb are thrown off a bit..their x and z move, and the maps y moves a bit.


Sweenie(Posted 2005) [#105]
Hmm, so you are not forcing the maprb in position with TOKRB_Setposition or something?

Maybe you could post the whole code so that we can give it a testrun?
Would be easier to spot any errors that way.


dwfait(Posted 2005) [#106]
Posting the whole could would be fifficult as it uses several libraries, and a whole lot of include files and media.


dwfait(Posted 2005) [#107]
Problem fixed. Reason for behaviour was: i wasnt setting the TOKRB_SetBoxInertiaTensor for the player. Just thought d let you knwo if anyone else was having this problem.


Eric(Posted 2005) [#108]
I was just on the Tokamak message board and Chris a moderator there said that there would be an announcement about tokamak in the next week or so...

Maybe tokamak isn't dead after all


Kalisme(Posted 2005) [#109]
YAY!!!!!! THANK YOU ERIC!!!!
Eric = bringer of good news
(well... in my opinion)


Picklesworth(Posted 2005) [#110]
Hey, who was it that did that little breakage thing?

Perhaps you could continue on the wrapper where sweenie left off?


HNPhan(Posted 2005) [#111]
ive stumbled into an odd problem, ive also posted it on the tokamak forum, but havent got an answer...

I did the tutorial on Static mesh posted on blitzcoder, but somehow with my own static mesh of a city, sometimes rigid bodies will go right through the static mesh...

the static mesh is around 50k polygons and the rigid bodies are boxes with an BoxInertiaTensor with the same size and mass as the rigid body

does someone have any ideas why this happens?
the rigidbodies arent going that blazing fast also.


Paolo(Posted 2005) [#112]
Well, those are just Toka-problems,
I also had some of that things, it seems there is no
way to resolve them since it is a tokamak problem and
not a wrapper one (I think).
To be honest, I wouldn't recommend to use tokamak if
you are going to base your gameplay in the physics, it's ok
if you use it for destruction fx such as wall explosions and so...


Sweenie(Posted 2005) [#113]
Check the tokamakforums(the announcement thread) for some good news... :)


Picklesworth(Posted 2005) [#114]
Yay!!!


Physt(Posted 2005) [#115]
Link to tokamak forums announcment...

http://www.tokamakphysics.com/phpbb/viewtopic.php?t=3


Eric(Posted 2005) [#116]
Sweenie,

Are you planning on continuing your wrapper on Tokamak?

Regards,
Eric

double post...Just answer here.


Paolo(Posted 2005) [#117]
Go, Go, Toka, Go :)

and of course,

Go, Go, Sweenie, Go :)

yep!
Paolo.


Picklesworth(Posted 2005) [#118]
I have a question regarding convex hulls:
When I add a convex hull, passing it a bank to tell it all the shape information, is it required for that bank to remain there in my blitz program, or can I delete it/change it after calling tokRB_AddConvex?


Picklesworth(Posted 2005) [#119]
Same question with material indices too.

Please! My program won't work well until this is answered and I'm too lazy to figure out for myself.


Paolo(Posted 2005) [#120]
I don't know what you mean with "material indices", keeping what?

Regarding convex hulls,
it is not necesary to keep banks when you load a trimesh, so
I guess it shouldn't be necesary to keep the bank for
convex hull after you pass the bank to tokamak, but
it can be tested very easy, just free the bank, and if it
still works well and if when you exit there is NOT a MAV,
then it is ok to free the bank I think :)

Paolo.


Picklesworth(Posted 2005) [#121]
Yay, I can!
Lol, thanks Paolo. I suck at testing quick things...

Contrarily, it seems that I can not reuse material indeces.


That stuff should be documented, because that can result in unnecessarily wasted memory.


Picklesworth(Posted 2005) [#122]
Random Hint:
There is a SetUserData function, with which you can link your tokamak objects to your visual objects :)



Now... I'm at the last stage of the last 20 lines of code of the last function of my first release of my program.

The question: Setboxinertiatensor, etc.
The docs are a bit clumsily worded for this function (or maybe it's the example, or maybe it's just me).


Description:
Sets a box Rigid Body inertia tensor. For Rigid Bodies with only a box geometry, use this command along with the diminsions of the box and the mass of the rigid body.


This creates a table and sets its box inertia tensor
i=1
obj(i) = CreateCube()
ScaleEntity obj(i),10,.5,10
rb(i) = TOKRB_Create()
TOKRB_AddBox rb(i),20.0,1.0,20.0
TOKRB_SetPosition rb(i),0,20,0
TOKRB_SetLinearDamping rb(i),0.001
TOKRB_SetAngularDamping rb(i),0.002
TOKRB_SetMass rb(i),2.0
TOKRB_SetBoxInertiaTensor rb(i),20.0,10.0,20.0,2.0
TOKRB_SetSleepingParameter rb(i),0
Addbox obj(i),rb(i),9,-5,9,2,10,2
Addbox obj(i),rb(i),-9,-5,9,2,10,2
Addbox obj(i),rb(i),9,-5,-9,2,10,2
Addbox obj(i),rb(i),-9,-5,-9,2,10,2
TOKRB_UpdateBoundingInfo(RB(i))
toks=toks+1

Function addbox(mesh,RigidBody,x#,y#,z#,Width#,Height#,Depth#,Pitch#=0,Yaw#=0,Roll#=0,alpha=1)
TOKGEOM_SetPositionAndRotation TOKRB_AddBox(RigidBody,Width#,Height#,Depth#),x#,y#,z#,Pitch#,Yaw#,Roll#
c=CreateCube(mesh)
ScaleEntity c,Width#/2,Height#/2,Depth#/2,1
PositionEntity c,x#,y#,z#,1
RotateEntity c,Pitch#,Yaw#,Roll#,1
End Function



So... Do I create the intertia tensor to fill up the full size of my mesh? What is it for? Do I have to call Set[shape]InertiaTensor after creating one geometry before going on to create others? Do I use it only if I'm using a single particular shape in my object?


Tom(Posted 2005) [#123]
I *think* inertia tensors define how the mass is spread throughout the volume of the object.

My guess is to use the closest possible shape to the object you have created, so for a table, use a suitably sized cube.


Sweenie(Posted 2005) [#124]
I haven't played around that much with asymmetric objects yet but I think to get for example a hammer to rotate somewhat correctly, add two boxgeometries(one for the hammerhead and one for the shaft) and calculate a boxtensor using only the hammerhead's dimensions and position the geometries so that the hammerhead is located at the center of the rigid body.


Picklesworth(Posted 2005) [#125]
Last thing before my program meets its complete enough stage...
It seems that my convex hull loader is obsolete. Has anyone got a good convex hull load function?

Edit: All fixed. Obviously.


Picklesworth(Posted 2005) [#126]
Okay... New question I should ask:
Is the Cylinder Inertia Tensor an actual cylinder, or a capsule?
I'm assuming it's a cylinder.


Storm8191(Posted 2005) [#127]
bradford6:
Have you had any luck syncing the qhull dll output and the Tokamak bin file input? I'm stuck on the convex bodies problem too. I'm wanting to generate my own convex bodies, and I'll definately need to know how to generate the .bin files for Tokamak before I can do so. If it's complicated, I could probably manage somehow anyway. Can you explain what kind of data is in the file? Just a file format would be enough to get me somewhere. I'd really appreciate your help (or if anyone else can help I'd appreciate it).


Picklesworth(Posted 2005) [#128]
My program, APE, hugely simplifies the process of building convex hulls. It does convex hulls as quickly as you can select a bunch of polygons and press enter.
http://crumbsoftware.f2o.org/products/ape/download.php
(Sorry about the PHP errors there... They'll be gone soon... Hopefully today)

A more decent version of the program is coming in a few weeks.


Storm8191(Posted 2005) [#129]
Pickles: that's cool. Is there any way you could release the convex hull construction stuff as a Blitz3D library? I'd be much more interested in Blitz3D source code, to use with my existing editor. I'm willing to pay money for source code such as this (though I can't afford to pay too much). I definately want my Cubix3D map editor workable with Tokamak.


Picklesworth(Posted 2005) [#130]
That program goes open source once I finish the remainder of my primary goals. As it is, my CHull source code is a mess, but I will clean it up :)


Sweenie(Posted 2005) [#131]
Just wanted to mention that I recompiled the wrapper to support Tokamak version 1.2.3
Also wrapped the new Advance function(called Advance2 in the wrapper) and FreeTerrainMesh(called FreeStaticMesh in the wrapper)

Download here
Http://www.svenberra.net/twrapperv07.zip


Picklesworth(Posted 2005) [#132]
Yay! Year by year we inch closer to version 1, at increments of one tenth :)
We're almost there!


RepeatUntil(Posted 2005) [#133]
Thank you very much, Sweenie !! Nice and very useful job!!!


Anatoly(Posted 2005) [#134]
Wow, just discovered this userlib... Excellent job!
Is there a demo of an animated mesh with ragdoll?
I kinda figured that you can use it for something like a grenade or a basket ball or some other simple mesh, but if I want an animated mesh to use ragdoll if I hit it (Max Payne II/ Half-Life II/ Doom III - you name it...), is there a sample code?


Armitage 1982(Posted 2005) [#135]
Hello all ;)

I need a full featured single surface physic engine for a "2D-like" simulation. My simulation must work with Trimesh polygons like Soldat (http://www.soldat.prv.pl/) but in a top down way.

In the Tokamak Forum some people have sucessfully done this : http://www.tokamakphysics.com/phpbb/viewtopic.php?t=26

Before learning Tokamak, could you please tell me if this kind of simulation is possible with the wrapper (0.7) ?

Others solutions are welcome too ;)

Thanks :)


Armitage 1982(Posted 2005) [#136]
Ok 1 week later... :)

You simply have to use the Skidracer code Pixies ( http://blitzbasic.com/codearcs/codearcs.php?code=773 ).
Then set rigidBody (or AnimatedBody) constraint like this :
TOKRB_SetRotation(rigidBody,0,0,TOKRB_GetRoll#(rigidBody))
TOKRB_SetPosition(rigidBody,TOKRB_GetX#(rigidBody),TOKRB_GetY#(rigidBody),Zpos)

And Finally set your Pixies :
CameraProject camera,TOKRB_GetX#(rigidBody),TOKRB_GetY#(rigidBody),Zpos
PositionEntity pixies,ProjectedX(),ProjectedY(),1

Hope this is a fast and acurate solution.


ronbravo(Posted 2005) [#137]
I was wondering if you would be allowed to distribute the tokomak.dll with a game you make? Or do you have to require that the end user of the game go to the Tokomak homepage and download the .dll file?


Sweenie(Posted 2005) [#138]
Yes you can.
You can distribute it with any non-commercial and commercial game/application as long as it isn't a physics-library/engine in itself.
I can't distribute the dll with my Tokamak-wrapper since that would technically make my wrapper a physics-api.
Also, as a developer you must also agree on their license which you will be required to do before you download the Tokamak-sdk.


Kalisme(Posted 2005) [#139]
Hello everybody :D
I've been working with tokamak alot latley. (I'm trying to make an engine that uses mainly tokamak collisions)
I have a problem that I need help with, I need to figure out how to dettect what objects have collided with just like the inbuilt blitz collisions can do.
I need to know how to do this with the collisions between rigidbodies and how to do this with tokamaks version of linepick().
Is this possible? If so, could someone put me in the right direction?
Thanks for any help given


Baystep Productions(Posted 2005) [#140]
Come on, I'm starting to change from blitz collisions to tokamak, but when I call the TOKSIM_Advance function i get a MAV. Any ideas? I'm just using the basic function in the simulator. Pretty much straight out of the tutorial. Maybe its somewhere in the TOK_AddMesh of my level??? I dunno.


aristid(Posted 2006) [#141]
hello all.
just picked up blitz and meant to take a look at tokamak.
I wanted to check out the tutorials, but blitzcoder seems to be down (and out!)
what is the case with this?
are the tutorials someplace else?

cheers and thanks.
aristides.


Picklesworth(Posted 2006) [#142]
Hi, aristid.
I have emailed you some tutorials :)


aristid(Posted 2006) [#143]
thank you.
the tokarally demo by sweenie is excellent!


Boiled Sweets(Posted 2006) [#144]
Could someone send me the tutorials too please


Kalisme(Posted 2006) [#145]
is there a way you could put these tutorials on the net somewhere and leave us a link?
I want them too... but I figure after a while many more people could want it too... so I figure posting them somewhere would just be handy


Picklesworth(Posted 2006) [#146]
Sure :)
We'll need to make sure BotBuilder is okay with it, though. (Otherwise, the ghost of BlitzCoder will come and haunt me).


Boiled Sweets(Posted 2006) [#147]
I have oodles of space and would be willing for the next 3 years at least to setup a Blitz Coder type site.

If there is enough interest I'll do it.


nrasool(Posted 2006) [#148]
Hi there, Please could someone send me the tutorials, or has anyone uploaded it? It would be useful to look at a few examples.


bytecode77(Posted 2006) [#149]
i downloaded wrapper06.zip, put the dlls into the userlib folder. then the 1.2.5 sdk and put the tokamakdll.dll into my system32 directory, but i still get "userlib not found."

but twrapper05 works perfect


MCP(Posted 2006) [#150]
Devils Child - I had the same problem, but solved it by placing ALL the DLLs in the system32 directory. That's tokamak.dll, tokamakdll.dll and tokamakwrapper.dll

Cheers,

Roy


Nmuta(Posted 2006) [#151]
Where do you get tokamakdll.dll from? I found the other two in the userlibs folder, but still I cannot get it working. I put them in the system32 folder, my Blitz userlibs folder, the project folder, etc. and nothing works.

HELP!!


Chroma(Posted 2007) [#152]
Same here. I can't get this working. I put the tokamakdll.dll in the system32 dir and nada. decls is in the right folder too.

What gives?


Sweenie(Posted 2007) [#153]
The latest version was v0.71.
See if that one works.
here -> http://www.svenberra.net/twrapperv071.zip
I wouldn't want to depend too much on Tokamak though. I think they stopped developing it a long time ago and the forums was heavily "infected" with spam.
I suggest going for ODE or Newton although I'm not sure there are any non-commercial wrappers left ;o(

Perhaps I will wrap Newton for free some day, I always enjoy irritating capitalists. ;o)


Sterling(Posted 2007) [#154]
Does anybody still have the tokomak v071 wrapper download available somewhere? Sweenie's link no longer seems to work.


Abrexxes(Posted 2007) [#155]
works for me


Sterling(Posted 2007) [#156]
Cheers...appears to be back up now :)


Eric(Posted 2007) [#157]
Is there a way to use Tokamak in BlitzMax? I'm thinking of buying the 3dSDK to use in Max, but I need Tokamak also.

Thanks in advance,
Eric


Chroma(Posted 2007) [#158]
...


Azaratur(Posted 2007) [#159]
I need to improve the adjacency.exe, i need more than 255 vertex. How i can do?
Aza


Blitz3dCoder(Posted 2007) [#160]
Dont regaurd this, I only posted so i could get this in my profile post page


Jaydubeww(Posted 2008) [#161]
I feel quite stupid asking this but...how do you "install" Tokamak? I've downloaded the wrapper and dll, but where do I put them? The BlitzTokamak forums isn't as clear and alive as i'd like it to be.


stayne(Posted 2008) [#162]
Download the tokamakdll.dll file and place it in the directory with your code. Place Tokamakwrapper.dll and Tokamak.decls in your Blitz3D /userlibs folder and you're set.


AbbaRue(Posted 2009) [#163]
Been a while since I worked with Blitz3D.
Were can I find some Tokamak demo downloads?
Looks like the original demo sites are all gone.
I want to create lottery number selector.
Use a large clear sphere with a hole in it which will only let one ball out at a time.
Then fill it with numbered balls and spin it.
I know this type of physics was easy to do with the Tokamak lib.
I remember a demo that dropped a bunch of balls on the ground.


_PJ_(Posted 2009) [#164]
I was wondering if anyone still has the wrapper.dll and decls for tokamak?


OJay(Posted 2009) [#165]
i'd suggest jv-ode to both of you...it still gets regular updates (both ODE and the wrapper) and support is fabulous! and its as easy as tokamak, to get a stable simulation is even easier...

i'd also want to vote this thread to be unstickied and the jv-ode thread stickied... ;)


_PJ_(Posted 2009) [#166]
Yes, I've played a lot with the JV-ODE demo and it's very user friendly, Also, I fear Tokamak may even be a bit too complex for my needs. Thanks Ojay, and I agree, JV-ODE needs a stickied thread :)


Vorderman(Posted 2009) [#167]
I'm still using Tokamak for my stunt race game, and I still maintain that it is more stable than ODE (never had one simulation explosion or crash during about 5 years of use) and also can simulate vehicles better..


Ian Caio(Posted 2009) [#168]
Hey people,
I was thinking about using Tokamak, the problem is that most of the links for codes, or tutorials are broken, and its not an updated lib. Its really confusing to find the most updated wrapper and DLL itself. I heard of the 1.2.3 version, but in the Tokamak website it says the most recent version is the 1.0.5a.. I had a lot of work to find the wrapper0.7 from sweenie, cause his website is closed, and im not even sure if its the most recent wrapper, or if theres another. About the Tokamak itself, it seens to be really good and fast. I only found 1 bug on it (if anyone wants to see it I can post the code, its because the post would be really large if I putted it here).
The bigger problem is not with the engine, its with the support, tutorials (Im trying hard to use joints, and I still cant get how to use them), updates, wrappers. If this engine had more support it would be perfect.
And it doesnt seens like theres other free Physics engines (Wrapper + engine).
So, any tips from you guys? Other free engines? Or even any solution for my Tokamak problem.. some updated website about it, or some new versions? Cause maybe Im just missing information.

Thanks,
Cya


Sweenie(Posted 2009) [#169]
I've stopped using tokamak a long time ago, but if you still want to use the wrapper I've kept the files on this site.

http://www.svenberra.net/twrapperv071.zip

And the 1.2.5 version of Tokamak should still be available for download here...
http://www.tokamakphysics.com/download.htm


Ian Caio(Posted 2009) [#170]
i guess im using this wrapper, but the thing is that i dont know if tokamak is the best option you know. theres that crash, and you know, all the information, and tutorials are old, so most cannot be open.

but i was thinking, what other options do i have? i mean, free and non free

thanks for the wrapper and the help by the way :)

cya


Guy Fawkes(Posted 2009) [#171]
use newton


Ian Caio(Posted 2009) [#172]
I have thought about that, but the problem are the wrappers..
which wrapper should i use?
is there any newton free wrapper?

cya


WildCat(Posted 2009) [#173]
Please help me with Tokamak collisions trouble... I use code by BotBuilder to pass my level data to Tokamak. As it said in manual, I run TOK_AddMesh(mesh,0,1) first, one time for each model, then I run TOK_SetMesh () once.

The problem is that only first model acts as collider normally, but everything else can be passed thru.

When I glue together all level data and pass it to TOK_AddMesh as a single model, everything works fine... Is that the only way out?

Tokamak Wrapper is v0.71. Is there a newer version?


Yue(Posted 2011) [#174]
It's free tokaman? as I download, I asked for a password or something, greetings.


Captain Wicker (crazy hillbilly)(Posted 2012) [#175]
Here is a newer version: http://blitz3dfr.com/hedgehog/data/documents/EasyTok.zip

Last edited 2012