Jump to content

Search the Community

Showing results for tags 'getIntersection'.

  • 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 1 result

  1. [SOLVED] Finding the HAT

    Hi there For the Unigine v1, we used the following code to get the height above terrain (HAT) and pack it into the CigiHatHotExtResponse packet. int ret[0]; dvec3 p0 = position + vec3(0.0f,0.0f,1000.0f); dvec3 p1 = position - vec3(0.0f,0.0f,1000.0f); Object object = engine.world.getIntersection(p0,p1,~0,ret); CigiHatHotExtResponse response = new CigiHatHotExtResponse(hathot_id); if(object != NULL) { dvec3 point = ret[0]; vec3 normal = ret[1]; response.setResponseValid(1); response.setHeightAbove(position.z - point.z); response.setHeightOf(point.z); response.setAzimuth(atan2(normal.x,normal.y) * RAD2DEG); response.setElevation(acos(clamp(-normal.z,-1.0f,1.0f)) * RAD2DEG - 90.0f); } engine.cigi.addIGPacket(response); In Unigine V2 there are some changes in the getIntersection* commands. We tried it as followed: int ret[0]; dvec3 p0 = position + vec3(0.0f, 0.0f, -200.0f); dvec3 p1 = position - vec3(0.0f, 0.0f, 1000.0f); int intersected = engine.world.getIntersectionObjects(p0, p1, ret); But as it seems, the returned 'ret' value doesn't contains any more the point and its normal of the ground model. As described in the documentation, the ret array contains the result. Is my approach correct? I should get the point on the ground vertically below the spectator. Thanks a lot, Renato
×
×
  • Create New...