Jump to content

Search the Community

Showing results for tags 'collision detection'.

  • 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. I am trying to get a vehicle to interact with a physical trigger in the world, but the objects don't interact and no callback is ever called. For creating the physical trigger I use the following code: //Create a box-shaped trigger, with size 0. m_physical = Unigine::PhysicalTrigger::create(3, Unigine::Math::vec3()); m_physical->setVisible(true); m_physical->setEnabled(true); m_physical->setCollisionMask(-1); m_physical->setPhysicalMask(-1); m_physical->setExclusionMask(0); m_physical->setEnterCallback(new cHitCallback(this)); Elsewhere in the code, the size, location and rotation is set. To make sure that the trigger is at the expected place, I draw it on screen with with the following code: Unigine::Visualizer::get()->renderSolidBox(m_physical->getSize(), m_physical->getWorldTransform(), m_color); The vehicle has a body and shape created like this: Unigine::ObjectPtr body = Unigine::Object::cast (m_body_node->getReference()) ; m_rigidBody = Unigine::BodyRigid::create(); m_boxShape = Unigine::ShapeBox::create(Unigine::Math::vec3(4.78, 2.52, 3.10)); m_boxShape->setCollisionMask(-1); m_boxShape->setExclusionMask(0); m_boxShape->setEnabled(1); m_rigidBody->addShape(m_boxShape->getShape()); m_rigidBody->setPhysicalMask(-1); m_rigidBody->setEnabled(1); body->setBody(m_rigidBody->getBody()); For testing purposes, I used the following line to visualize the shape of my vehicle: Unigine::Visualizer::get()->renderBox(m_boxShape->getSize(), m_rigidBody->getTransform(), Unigine::Math::vec4(0, 0, 1.0, 1.0)); I have placed a break point in the callbackmethod "void run(Unigine::Ptr<Unigine::Body> body)" of the cHitCallback class, to make sure that the callback is infact called. The break point is never triggered. Did I miss something here? Please help me out.
×
×
  • Create New...