Jump to content

Search the Community

Showing results for tags 'class'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • 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
    • Feedback for UNIGINE team
    • Bug Reports
    • Unigine SDK Beta feedback
  • Community
    • Add-on Store (https://store.unigine.com/)
    • Showcase
    • Collaboration
    • Tools, Plugins, Materials & Tutorials
    • General Discussions
  • Legacy
    • UnigineScript

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Found 4 results

  1. Hi folks! I'm currently facing a rather annoying issue in Unigine, created by myself and my lack of understanding of course, which I need your help on! My situation is this: I have two characters, I want to calculate the mid-point between these two characters' heads and make a camera inside of the game look at that mid-point. What I am currently doing is: 1. Cycling through bones and finding the head bones of each character 2. Using ObjectMeshSkinned::getWorldBoneTransform to get the transform of each head bone as a mat4 3. Getting the 12th, 13th and 14th values from the head bone mat4s that represent the position of the head bones 4. Creating two separate vec3s for each head bone position using the values from stage 3 5. Finding the distance between the two values and normalising them to give me a look direction for my camera 6. Using Node::setDirection to set the direction the camera is facing like in the default setup of: camera = new PlayerSpectator(); camera.setDirection(Vec3(-1.0f, 0.0f, -0.5f)); The script I am using to get the PlayerSpectator from the world is: PlayerSpectator camera_Player = node_cast(engine.world.getnode(0123456789)); My problem is: When I try to do anything PlayerSpectator/Player/Node related with the PlayerSpectator variable I get an error saying: Project001/Project001.cpp: 1092: ExternClass::run_function(): can't find "class PlayerSpectator * __ptr64" base class in "class PlayerDummy" * __ptr64" class Can anyone suggest what I am doing wrong? Should I not node_cast cameras or something? Am I referencing them the wrong way? I can't even call Node::getNodeName or anything! Thanks in advance for your help! Tom
  2. Hello. Проблема с наследование от MovieClip во Flash. Пример прилагается: Есть клип (movie) к которому подключен класс (_movie) без наследования, в клипе есть несколько кадров, по которым будем переключаться с помощью функции в классе. Если сейчас откомпилировать данный пример во Flash, то ничего работать не будет, обязательно надо в классе (_movie) сделать наследование от extends MovieClip. А вот в Unigine все как раз наоборот, будет работать. Если наследование сделать, то во Flash работать будет хорошо, а в Unigine будет много ошибок. ===================== translation from google ===================== The problem with inheriting from MovieClip in Flash. Example attached: a clip (movie) is connected to the class (_movie) without inheritance, the clip is a few frames, which will switch from using in the classroom. If you now compile this example in Flash, then it will not work, be sure to be in the class (_movie) to inherit from extends MovieClip. But in Unigine is just the opposite will work. If inheritance is done, the Flash will work well, and in Unigine will be a lot of errors. Thank you. flash_mc.zip
  3. Здравствуйте. Проблема с наследованием в классах Flash. Простой пример прилагается. Результаты во Flash и Unigine разные. вкратце: Проблема заключается в обращении из frame к функции (в примере Hide() ), которая имеет одинаковое имя во всех трех классах. Мы вызываем Hide() из FIRST, а срабатывает Hide из SECOND. Проблема исчезнет если убрать у классов наследников наследование от родителя "extends _main". Спасибо. ===================== translation from google ===================== Hello The problem with inheritance in classes Flash. A simple example is attached. Results in Flash and Unigine different. briefly: The problem is to use a function of the from frame (in the example Hide() ), which has the same name in all three classes. We call Hide() from FIRST, and works from Hide SECOND. The problem goes away if you remove the classes of heirs to inherit from parent "extends _main". Thank you. flash.rar
  4. Hello ! I am currently seeking for a scripting functionality that I can't really find. Problem: I would like to share a user class across each World scripts. This class could handle and save some attributes for example (it is like some kind of "singleton" pattern). According to the documentation, I have foundb(from https://developer.un...stem.get_string) : variable engine.system.get(string var) Description Returns a variable from the system script. Instances of user-defined classes cannot be requested in such a manner. Arguments string var - Variable name with a namespace, if needed. Return value Requested instance. As you could read : Instances of user-defined classes cannot be requested in such a manner And it is true, trying to share user class in such a manner lead to Unigine crash. Could you please give me some tips on how to achieve that kind of task ? (I believe I could write my own C++ plug-in that will expose my user class to Unigine script and ensure "singleton" pattern but I think it is a bit too "complicated" only for that) Thanks for reading me !
×
×
  • Create New...