|
Post by botbuilder on Feb 1, 2004 20:55:15 GMT
Just wondering-anybody working on an editer to apply rigidbodies to static meshs? I'm not very far. all I have is the gui. nothing actually functions yet. I just realized that spmeone else might be working on this and I could either stop, help that person, or just release my source for furtherr dev. If anyone wants to help, their welcome, etc. I'll be releasing the source if anyone wants it, and at release.
|
|
|
Post by GhostDag on Feb 1, 2004 22:23:35 GMT
I am going to have to make a rigidbody editor sooner or later for my project,i'm just waiting for the wrapper to be completed & documented.I've made an editor for the previous physics sistem , the one that was using verlets ,it was messy and had a v poor interface ,but it served his goal.I would gladly help
How would you make a rigid link between two rigid bodies ,using jointlimits with anglelimit 0 ?
Sweenie ,when are you planning the next release?
|
|
|
Post by botbuilder on Feb 2, 2004 0:15:48 GMT
Actually, it's very simple. if you check out my table/chair demo, you can see that actaully, the commands TOKRB_Add* commands are of the Geometry class in tokamak. These commands return a geometry handle. So, basically, you create one rigid body and add all your primitives. then, (new in .3), you can call TOKGEOM_SetPositionAndRotation to rotate and position the various objects in one rigid body. Okay, so my description might sound a little complex, but all you have to do is: 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 TOKGEOM_SetPositionAndRotation TOKRB_AddBox(rb(i),2.0,10.0,2.0),9,-5,9,0,0,0 c=CreateCube(obj(i)) ScaleEntity c,1,5,1,1 PositionEntity c,9,-5,9,1 this creates my table with only one leg . Eventually, this editer might support joints, however, it's initial design will not be so. I'll work on it a bit more, then post it up. in it's current state it would be hard to have anyone help with it.
|
|
|
Post by botbuilder on Feb 2, 2004 0:36:40 GMT
ok - here's one thing I'd like help on. I have a central camera pivot that will be in the same position the rigid object is. Now I'd like to have the camera rotate around the pivot based on mouse movements. I've already tried turnetity on the center pivot. does wierd stuff. I'm just looking for somthing like the stuff you see in 3d editers.(max;truespac etc.)
|
|
|
Post by GhostDag on Feb 2, 2004 14:08:51 GMT
God ...i didn't notice the "addBox" function in .3 ;D
Here is some code i put together to help you out
Graphics3D 800,600,16 Global mxs#,mys#,c_smooth_angle#,p_smooth_angle#,p_angle#,c_angle# Global c_mousez
Global plane=CreatePlane() EntityBlend plane,3
;******************* Texture
Global texture=CreateTexture(256,256) SetBuffer TextureBuffer(texture)
Color 0,0,0 Rect 0,0,256,256
Color 255,255,255 Line 128,0,128,256 Line 0,128,256,128 SetBuffer BackBuffer()
ScaleTexture texture,10,10 EntityTexture plane,texture
;********************
Global camera=CreateCamera() Global pivot1=CreatePivot() Global pivot2=CreatePivot()
EntityParent pivot2,pivot1 EntityParent camera,pivot2
MoveEntity camera,0,0,-20
Global cube=CreateCube() EntityColor cube,255,100,100
c_mouseZ=MouseZ()
While Not KeyDown(1)
Mouse_look() Mouse_zoom() UpdateWorld() RenderWorld()
Flip
Wend
Function Mouse_look()
mxs#=MouseXSpeed()/4.0 mys#=MouseYSpeed()/4.0 MoveMouse GraphicsWidth()/2,GraphicsHeight()/2
p_angle#=(p_angle#-mxs#) If p_angle#>360 Then p_angle#=p_angle#-360 p_smooth_angle#=p_smooth_angle#-360 EndIf If p_angle#<0 Then p_angle#=p_angle#+360 p_smooth_angle#=p_smooth_angle#+360 EndIf c_angle#=(c_angle#+mys#) If c_angle#>360 Then c_angle#=c_angle#-360 c_smooth_angle#=c_smooth_angle#-360 EndIf If c_angle#<0 Then c_angle#=c_angle#+360 c_smooth_angle#=c_smooth_angle#+360 EndIf p_smooth_angle#=p_smooth_angle#-((p_smooth_angle#-p_angle#)/2.5) c_smooth_angle#=c_smooth_angle#-((c_smooth_angle#-c_angle#)/2.5) RotateEntity pivot1,0,p_smooth_angle#,0 RotateEntity pivot2,c_smooth_angle#,0,0
End Function
Function mouse_zoom()
If c_mousez<MouseZ() Then c_mousez=MouseZ() If EntityDistance(camera,cube)>10 Then MoveEntity camera,0,0,3 End If
If c_mousez>MouseZ() Then c_mousez=MouseZ() MoveEntity camera,0,0,-3 End If
End Function
hope it helps.Use the mousescroll to zoom in and out
|
|
|
Post by botbuilder on Feb 3, 2004 1:17:38 GMT
cool. it's integrated. I'll post code once I have the addition of boxes.
|
|
|
Post by botbuilder on Feb 3, 2004 6:44:39 GMT
|
|
|
Post by GhostDag on Feb 3, 2004 9:29:57 GMT
Damm 250free.com .Seems like my ip class is banned.I can't download anything from there . Mail me the editor cristea_radus@yahoo.com ,im really curious
|
|
StOrM3
New Member
Pain Killa Entertainment(tm) - Pain Iz Reality...
Posts: 21
|
Post by StOrM3 on Feb 3, 2004 15:38:42 GMT
I would also be interested in helping out on this project.. I am at work today, but will download it when I get home tonight. I think this could really help out development of game projects with awesome physics of Tokamak implemented much easier, than coding everything manually.
Thanks again, to sweenie and everyone helping out on this.
Ken
|
|
raye
New Member
Posts: 27
|
Post by raye on Feb 3, 2004 16:50:23 GMT
This function is missing within in the download: OpenFileDialog$()
|
|
|
Post by botbuilder on Feb 3, 2004 23:32:18 GMT
oops. sorry. Left out a dll. Now the zip is updated. Now it's about 47K. Put the decl and dll files in your userlib folder.
Also sent it to ghostdag.
|
|
|
Post by botbuilder on Feb 4, 2004 2:32:55 GMT
okay - I fixed the grid. now it is transparent as it should be.
Global gridtex=CreateTexture(256,256,2) tb=TextureBuffer(gridtex) SetBuffer tb Color 0,0,0 Rect 0,0,256,256 Color 255,255,255 Rect 0,0,256,20 Rect 0,0,20,256 LockBuffer tb For x=1 To 255 For y=1 To 255 p=ReadPixelFast(x,y,tb) If (p And $FF)=0 Then WritePixelFast x,y,0,tb Next Next UnlockBuffer tb SetBuffer BackBuffer()
Replace the stuff that was creating the texture before with this.
Sorry for anyone who doesn't like the usage of gosubs, I can make them functions if you like. I just thought it was sorta rediculus - they are only called in one place and they have no parameters. I just did it that way to split it up into sections
|
|
|
Post by botbuilder on Feb 4, 2004 6:14:09 GMT
All the people who do not nativly speak english will be happy - I added multilingual support and babelfished my text file so now we have English,French,German,Italian,Spanish, and Portuguese! hehehe. Well, whenever text is added, it'll require a bit more work, but eh. I think it's pretty cool.
|
|
|
Post by GhostDag on Feb 4, 2004 13:22:37 GMT
Nice work bot builder .Lets do this thing
|
|
|
Post by botbuilder on Feb 5, 2004 6:49:07 GMT
ok. here's a new ver. This time I decided to uploaded external files seperate from source, as source will be updated more frequently. If anyone speaks french,german, italian, portuguese, or spanish, then it would be helpful to check the translations. if you fix anything, send the corrected version to me at bot_builder56 AT fastmail.fm (change AT to @). Here's the external files: blitzstuff.250free.com/zips/Tok_RBE_External.zipand the source: blitzstuff.250free.com/other/tok_RBE.bbAnd yes, I'll email it to you ghostdag.
|
|