Jump to content

ZeroByte

Members
  • Posts

    99
  • Joined

  • Last visited

Posts posted by ZeroByte

  1. Hi, i can't seem to get Buoyancy working on my Character Controller, but it collides with everthing else in my map.

     

    here is my player code:

     

    Controller player;
    player.Create(1.8f, .3f, .5f, 45.0f, 1.0f);
    player.SetMass(1);
    player.SetDamping(.0f, .0f);
    player.SetBuoyancyMode(1);
    player.SetType(1);
    player.SetPosition(Vec3(15.0f, 12.0f, 80.0f), LOCAL);
    
    Collisions::Set(1,1,SLIDINGCOLLISION);
    

     

     

    I can't remember what changed after Character Controller was updated awhile back.

     

    My spectator cam has Buoyancy, and all the other objects as well.

  2. Ok, i got the control working in vb.net if anyone is interested.

     

    I'm using Visual Studio 2010 Express, it was just released. Link: http://www.microsoft.com/express/

     

    Here is the code

     

    Imports Leadwerks
    Imports Leadwerks.Control
    
    Public Class Form1
    
       Private buffer As Buffer
       Private ground As Body
       Private groundmesh As Mesh
       Private mesh As Mesh
       Private body As Body
    
       Private Sub LetkControl1_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LetkControl1.Init
           Dim world As New World
           Dim cam As New Camera
           FileSystem.AbstractPath = "C:\Leadwerks Engine SDK"
           cam.ClearColor = New Color(0, 0, 1, 1)
           cam.Move(New Vector3(0.0!, 0.0!, -8.0!))
           Dim Light As Light = Light.CreateDirectional()
           Light.Rotation = New Vector3(45, 45, 0)
           Light.Position = New Vector3(0, 100, 0)
           Light.Range = 1000
           buffer = New Buffer(LetkControl1.Width, LetkControl1.Height, 7)
           body = body.CreateBox(1.0!, 1.0!, 1.0!)
           body.Mass = 1.0!
           body.Position = New Vector3(0, 4, 0)
           mesh = mesh.CreateCube
           mesh.Parent = Me.body
           body.SetKey("name", "body1")
           ground = body.CreateBox(10.0!, 0.1!, 10.0!)
           groundmesh = mesh.CreateCube
           'groundmesh.Scale = New Vector3(10.0!, 0.1!, 10.0!)  //It crashes on this line, so i can't scale ground yet.
           groundmesh.Parent = Me.ground
           ground.Position = New Vector3(0.0!, -1.0!, 0.0!)
           ground.SetKey("name", "ground")
           body.CollisionType = 1
           ground.CollisionType = 1
           Collisions.Set(1, 1, True)
           LetkControl1.Start()
       End Sub
    
       Private Sub LetkControl1_Redraw(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LetkControl1.Redraw
           Me.Text = Leadwerks.Timing.FPS.ToString
           World.Update(Core.AppSpeed)
           buffer.Current = buffer
           World.Render()
           buffer.Current = LetkControl1.Buffer
           Light.Render(buffer)
       End Sub
    
       Private Sub LetkControl1_Resize(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LetkControl1.Resize
           buffer = New Buffer(LetkControl1.Width, LetkControl1.Height, 7)
       End Sub
    
       Private Sub Form1_FormClosing(ByVal sender As System.Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing
           LetkControl1.Stop()
           End
       End Sub
    
    End Class
    
    

     

    Hope this helps anyone using vb.net.

  3. Since a model is an extension of the body class, and models are entities -> Would freeing a model entity not also free its associated physics body?

     

    Well, i delete the windmill model in my app, but the physics body remains.

     

    I have tried changing entity type also, but the physics body is still there.

  4. Hi, sorry if this has been asked before.

     

    When i call FreeEntity

     

    if(KeyHit(KEY_DELETE)) {
    if(pick.entity != NULL) {
    FreeEntity(pick.entity);
    pick.entity=NULL;
    }
    }
    

     

    is there a way to free the physics body ?

     

    I know there must be a way, or i'm just blind. :)

  5. Yes, you just drop the control as every other control in your form. the Custombuffer is automatically created. The control will provide 2 extra events.

     

    1. OnInit: In there youinitilize your objects, framewerk etc.

    2. OnUpdate: In there you update the code ( no Flip needed as it this is done autmatically)

     

    You only need to keep track of your own buffers via the resize events.

     

    Both the TAO Control and the OpenTK Control are working exactly the same as the control, so you can swap the controls without changing the underlying code. (I prefer the OpenTK as it is still continued and already offers OGL4.0). I still need to fix some issues. But I think i will upload my version the coming weekend.

     

    Ubu_Net_LeadwerksControl.jpg

     

     

    OMG, this is exactly what i've been looking for, thank's klepto2. :)

  6. Sorry to hear that you don't have time to continue on this, I will continue working on the delegates and some other functions which are currently missing or named wrong. I also have 2 working Leadwerks Controls (1 for the TAO Framework and 1 for the OpenTK lib). I will post the new files as soon as possible.

     

    Hi klepto2, will those 2 controls make it easier to setup a custom buffer with TAO Framework ?

     

    I've been trying to get that working in vb.net, and this great wrapper.

     

    BTW, thank's for releasing the source Ubu.

  7. I would prefer to use vb.net also, but as mentioned, it's not officially supported yet, and i haven't been able to get the Custom Buffer working

     

    with vb.net since LE 2.12. So i've been using c/c++, thank's to the easy to understand tutorials, and helpful community. LE makes using c/c++ easier than

     

    other engines i've tried, but i still struggle with it's syntax when i run into problem's. :)

  8. Hi, i coded a 6 speed automatic gearbox, using the sound pitch synced with GetBodyVelocity(chassis, 0); on my car.

     

    Probably not the best way to do it, but it work's ok for me.

     

    I hope the video will play, sorry about the quality, had to shrink it down, also speedometer not working yet.

     

    Here is the link, for anyone interested, it's 2.26mb:

     

    http://66.244.240.14/

  9. With Leadwerk's awesome lighting, i think it would be cool to have it effect gameplay.

     

    Could be just day/night, or something cool like theif games had, where you could hide in the shadows.

     

    Oh, i like your vehicle concept Josh, that would be cool for troop transport..

×
×
  • Create New...