Search the Community

Showing results for tags 'callback'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • Welcome to UNIGINE Forums
    • News & Announcements
    • Getting started
  • Development
    • Content Creation
    • World Design
    • Rendering
    • Animation
    • Physics, Navigation and Path Finding
    • UI Systems
    • Sound & Video
    • Editor
    • C++ Programming
    • C# Programming
    • Networking
    • Sim IG (Image Generator)
    • VR Discussions
    • General
  • Improving UNIGINE
    • Documentation
    • Feeback for UNIGINE team
    • Bug Reports
    • Unigine SDK Beta feedback
  • Community
    • Collaboration
    • Tools, Plugins, Materials & Tutorials
    • Showcase
    • General Discussions
  • Legacy
    • UnigineScript

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...

Found 9 results

  1. Problems with console callbacks

    Hi, I've added a few console commands. But the only one that works is the one with no arguments. The console commands I've added with arguments don't work. Could you help me figure out what I've done wrong? Here's a callback: class SetCameraTargetCallback : public CallbackBase3<double, double, double> { void run (double x, double y, double z) { Log::message("Testing...\n"); PlayerSpectatorPtr player = PlayerSpectator::create(Game::get()->getPlayer()); Vec3 camPos(x,y,z); player->setNodeWorldPosition(camPos); } } SetCameraPosCallback
  2. Hi, I have a variable a = 0. It is changed to 5 in a callback function. But onUpdate function I get 0 not 5. How can I access new value? int a = 0 Body right_holder_body; right_holder_body.setContactCallback(functionid(onColl)); void onColl() { a = 5; log.message("%d",a); // Output: 5 } void onUpdate() { log.message("%d",a); // Output: 0 } Thanks.
  3. In my previous posts I talked about rendering single pixel lines in 3D space. I need to detect clicking on those lines. The trouble is, renderline3d doesn't create a node in the scene to interact with. My first idea was to create an invisible capsule node underneath each 3D line and detect click events on this capsule. I have used the example code outlined here: Trouble is, even setting up all of the collision masks, I can't seem to get a click to register on the capsule. Is this the "best" way t
  4. Hello. I have two ObjectGui on the scene. Both of them have WidgetSprite with callbacks: GUI_ENTER, GUI_LEAVE, GUI_PRESSED and GUI_RELEASED. So the problem: callbacks are firing when they should not. Sometimes when i click on one sprite, i see click on both sprites. Sometimes i just click somewhere in the world and one of sprites become clicked too. It is clearly seen in attached simple demo. I expect sprites to work like independent buttons with 3 states (normal, mouse over, pressed). sprite_callbacks.rar
  5. Problem Strange system behavior when an objectgui widget is clicked. It causes wrong intersection operations and player control failure. Reproduction steps It's not automatic but easy to reproduce (just repeat steps 3-4 until it happens): Place attached zip content in data/samples folder. Execute guiproblem world Click on any of the labels (an engine message is shown "s:label 1" or "s:label 2") Click over the box and the label callback is invoked again. Once this happens, you can click the background and the callback will be invoked again. In addition you wouldn't be able to control
  6. A bug with the order of events on the stack for GUI ... Gui gui = engine.getGui(); WidgetButton btn1 = new WidgetButton(gui, "Button 1"); btn1.setCallback( GUI_ENTER, "onEnter", 1 ); btn1.setCallback( GUI_LEAVE, "onLeave", 1 ); gui.addChild(btn1); WidgetButton btn2 = new WidgetButton(gui, "Button 2"); btn2.setCallback( GUI_ENTER, "onEnter", 2 ); btn2.setCallback( GUI_LEAVE, "onLeave", 2 ); gui.addChild(btn2); ... void onEnter( int id ) { log.message("onEnter( 'Button %d' )\n", id); } void onLeave( int id ) { log.message("onLeave( 'Button %d' )\n", id); } Please see the result in the a
  7. Hi. How do I file a interfeys.ui the call callback to set more than one parameter? Example: // inventory.ui <button> <text>Buy</text> <callback type="clicked" string="abc" string="50">Game::buy</callback> </button> // game.h void buy (string name, string cost) { // } Thank.
  8. Hi, I've managed to make a plugin that is loaded successfully by the game. Right now, I'm trying to call a function in the world script via the plugin. I can't figure out how to make the sample in the documentation work. I tried inserting the provided code into my plugin script, but it does not seem to load correctly. I suppose it's because main(int argc,char **argv) is not called. I would have attempted to call aforementioned function in the definition of my plugin init but I do not know what parameters to provide. Any help on the matter would be appreciated.
  9. Related to this post it would be awesome to have some callback system at WorldClutter and WorldCluster classes at every creation/deletion of dynamic nodes (or batch of nodes). This could make these classes more powerful and dynamic. Thanks!