Jump to content
  • Advertisement


  • Content count

  • Joined

  • Last visited

Community Reputation

1480 Excellent

About xexuxjy

  • Rank

Personal Information

  • Role
  • Interests

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Sure, but what logic do you want to drive off the individual clicks? You could have something like the one below (snippets of code from a project) where the buttons are created and their on click listener is passed the button itself. Then in a controller method you can drive some logic from the button you provide. Not sure you need to create separate arrays of objects to handle this? Apologies if I've got completely wrong end of the stick. menuPanel.ArenaButton = UIFactory.CreateStandardButton("ArenaButton", "Arena", region, buttonPanel).GetComponent<Button>(); menuPanel.ArenaButton.onClick.AddListener(() => { menuPanel.TownMenuPanel_Click(menuPanel.ArenaButton); }); menuPanel.ShopButton = UIFactory.CreateStandardButton("ShopButton", "Shop", region, buttonPanel).GetComponent<Button>(); menuPanel.ShopButton.onClick.AddListener(() => { menuPanel.TownMenuPanel_Click(menuPanel.ShopButton); }); menuPanel.SchoolButton = UIFactory.CreateStandardButton("SchoolButton", "School", region, buttonPanel).GetComponent<Button>(); menuPanel.SchoolButton.onClick.AddListener(() => { menuPanel.TownMenuPanel_Click(menuPanel.SchoolButton); }); menuPanel.LeaveTownButton = UIFactory.CreateStandardButton("LeaveButton", "Leave Town", region, buttonPanel).GetComponent<Button>(); menuPanel.LeaveTownButton.onClick.AddListener(() => { menuPanel.TownMenuPanel_Click(menuPanel.LeaveTownButton); }); public void TownMenuPanel_Click(Button control) { if (control == ShopButton) { m_townGuiController.NextPanel(m_townGuiController.ShopPanel); } else if (control == SchoolButton) { m_townGuiController.NextPanel(m_townGuiController.SchoolPanel); } else if (control == ArenaButton) { m_townGuiController.NextPanel(m_townGuiController.ArenaMenuPanel); } else if (control == LeaveTownButton) { GameStateManager.SetNewState(GameMode.Overland); } }
  2. Can't remember exactly, but is the order of items returned by the query guaranteed to be consistent? I think relying on a particular index value to match on could be unreliable and suggests you might be trying to work against the framework. You might be better off naming your red buttons (as well as tagging them as redbuttons) then your code would just be : foreach(GameObject go in red_buttons_go) { if(go) { Debug.Log(go.Name+" Pressed."); } } ? Still not quite clear what you're trying to achieve though ? The OnClick event should have information about it's origin could just test that?
  3. I'll have a look, but I agree with Zakwayda, I think you are getting side tracked by the OpenGL stuff for Bullet - it really doesn't have any dependencies on OpenGL except as an optional debug drawer to help visualise the Physics Simulation.If you debug your program you should be able to inspect the fields for the Matrix in your MotionState class, from there it should be fairly obvious which parts make up the position and which are the rotation values. Once you've looked at that, compare it to the Matrices the rest of your program is using and the worst you'll probably have to figure out is whether it is AxB or BxA or if you have to Transpose one of the matrices before you multiply. This is what I ended up having for the XNA DefaultMotionState : https://github.com/ousttrue/bullet-xna/blob/master/BulletXNA/DefaultMotionState.cs which if I remember had a different matrix order to the standard bullet one , so needed to do some conversions.
  4. Not sure it's a direct help but it's stuff I came across when converting Bullet C+ to XNA /C# : Bullet doesn't have any in built dependency on drawing things / renderer. All that is done by an implementation of the DebugDraw interface. It's relatively easy to have your own version that uses VertexBuffers etc rather than immediate mode commands. I haven't got an up to date Java version, but this code in the xna version might be of help. https://github.com/xexuxjy/bullet-xna Communication with the internals of bullet is best done via MotionState objects/interfaces. Bullet will write to / query the values there automatically. You might want to write your own implantation of that rather than the default one , it's a very simple class and it lets you keep all your matrix order issues in one place. You need to use the MotionStates consistently and get the matrix values from them ,rather than getting the Transform directly from the RigidBody - I suspect some of the issues you're getting are because you're using a couple of different ways to get /set the data. Hope this gets you a bit further.....
  5. xexuxjy

    A 3D engine that doesn't render...

    If you need .NET compatibility, I ported Bullet Physics to XNA a while back, (https://github.com/xexuxjy/bullet-xna) , or you can use a c# binding such as Bullet Sharp (https://andrestraks.github.io/BulletSharp/) . It should do pretty much what you need and doesn't expect any form of renderer, though you can attach a simple debug renderer for testing.
  6. xexuxjy

    How do I render bullet physics height fields?

    you should be able to find a directx implementation of btDebugDrawer , if not it's easy enough to write one (I did it for XNA), as long as you implement the methods in the interface then bullet will do all the drawing for you (not just heightfields)
  7. You'd do something like this :   Menu names : Fee    = &Fee Fi        = F&i Fo         = F&o Fum     = F&um   or whatever you like really - it's just there as a convenience and the ampersand is the shortcut key. You don't have to have it at all which may be easier if menus are dynamic.
  8. It just provides an automatic shortcut key so you can do alt-f (in this case) to open the menu.
  9. xexuxjy

    Extract assets from an old windows (1998) game

    It's worth looking at the Xentax forums if you haven't already as they have a good list of tools and expertise in reverse engineering formats. I started there when I worked on extracting the assets from Gladius.  No harm in putting your code on github to look at.
  10. What you could also do is when you 'pickup' the grabbed object you could just parent it to the gameObject - would mean that any changes in position , rotation etc from the gameObject would be automatically transferred to the grabbed object.
  11. Not sure if a typo or something, but line 49 looks like you're setting grabbed object to null, rather than testing?   also line 45 you have :   grabbedObject.GetComponent<Rigidbody> ().velocity = Vector3.forward * 50;   when you _probably_ want something like :   grabbedObject.GetComponent<Rigidbody> ().velocity = grabbedObject.transform.forward * 50;   as your update code looks to be already setting the position/rotation of the object.
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!